From 17d27633c206f2cca2f65fee0c4653794e309620 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Oct 2015 22:22:07 -0400 Subject: [PATCH 001/102] [RSP] added working MinGW compile script --- Source/Script/MinGW/rsp.cmd | 91 +++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 Source/Script/MinGW/rsp.cmd diff --git a/Source/Script/MinGW/rsp.cmd b/Source/Script/MinGW/rsp.cmd new file mode 100644 index 000000000..24128206a --- /dev/null +++ b/Source/Script/MinGW/rsp.cmd @@ -0,0 +1,91 @@ +@ECHO OFF +TITLE MinGW Compiler Suite Invocation + +set src=%CD%\..\..\RSP +set obj=%CD%\RSP + +if not exist %obj% ( +mkdir %obj% +) + + set MinGW=C:\MinGW +REM set MinGW=C:\msys64\mingw64\x86_64-w64-mingw32\.. + +set FLAGS_x86=^ + -Wno-write-strings^ + -I"%src%\.."^ + -S^ + -masm=intel^ + -march=native^ + -Os + +set C_FLAGS=%FLAGS_x86% + +cd %MinGW%\bin +set CC=%MinGW%\bin\gcc.exe +set AS=%MinGW%\bin\as.exe + +ECHO Compiling RSP plugin sources... +%CC% -o %obj%\Main.asm %src%\Main.cpp %C_FLAGS% +%CC% -o %obj%\Cpu.asm %src%\Cpu.c %C_FLAGS% +%CC% -o %obj%\memory.asm %src%\memory.c %C_FLAGS% +%CC% -o %obj%\dma.asm %src%\dma.c %C_FLAGS% +%CC% -o %obj%\breakpoint.asm %src%\breakpoint.c %C_FLAGS% +%CC% -o %obj%\log.asm %src%\log.cpp %C_FLAGS% +%CC% -o %obj%\InterpreterCPU.asm "%src%\Interpreter CPU.c" %C_FLAGS% +%CC% -o %obj%\RecompilerCPU.asm "%src%\Recompiler CPU.c" %C_FLAGS% +%CC% -o %obj%\InterpreterOps.asm "%src%\Interpreter Ops.c" %C_FLAGS% +%CC% -o %obj%\RecompilerOps.asm "%src%\Recompiler Ops.c" %C_FLAGS% +%CC% -o %obj%\Profiling.asm %src%\Profiling.cpp %C_FLAGS% +%CC% -o %obj%\RSPCommand.asm "%src%\RSP Command.c" %C_FLAGS% +%CC% -o %obj%\RSPRegister.asm "%src%\RSP Register.c" %C_FLAGS% +%CC% -o %obj%\RecompilerSections.asm "%src%\Recompiler Sections.c" %C_FLAGS% +%CC% -o %obj%\RecompilerAnalysis.asm "%src%\Recompiler Analysis.c" %C_FLAGS% +%CC% -o %obj%\X86.asm %src%\X86.c %C_FLAGS% +%CC% -o %obj%\Mmx.asm %src%\Mmx.c %C_FLAGS% +%CC% -o %obj%\Sse.asm %src%\Sse.c %C_FLAGS% + +ECHO Assembling RSP sources... +%AS% -o %obj%\Main.o %obj%\Main.asm +%AS% -o %obj%\Cpu.o %obj%\Cpu.asm +%AS% -o %obj%\memory.o %obj%\memory.asm +%AS% -o %obj%\dma.o %obj%\dma.asm +%AS% -o %obj%\breakpoint.o %obj%\breakpoint.asm +%AS% -o %obj%\log.o %obj%\log.asm +%AS% -o %obj%\InterpreterCPU.o %obj%\InterpreterCPU.asm +%AS% -o %obj%\RecompilerCPU.o %obj%\RecompilerCPU.asm +%AS% -o %obj%\InterpreterOps.o %obj%\InterpreterOps.asm +%AS% -o %obj%\RecompilerOps.o %obj%\RecompilerOps.asm +%AS% -o %obj%\Profiling.o %obj%\Profiling.asm +%AS% -o %obj%\RSPCommand.o %obj%\RSPCommand.asm +%AS% -o %obj%\RSPRegister.o %obj%\RSPRegister.asm +%AS% -o %obj%\RecompilerSections.o %obj%\RecompilerSections.asm +%AS% -o %obj%\RecompilerAnalysis.o %obj%\RecompilerAnalysis.asm +%AS% -o %obj%\X86.o %obj%\X86.asm +%AS% -o %obj%\Mmx.o %obj%\Mmx.asm +%AS% -o %obj%\Sse.o %obj%\Sse.asm +ECHO. + +set OBJ_LIST=^ + %obj%\Sse.o^ + %obj%\Mmx.o^ + %obj%\X86.o^ + %obj%\RecompilerAnalysis.o^ + %obj%\RecompilerSections.o^ + %obj%\RSPRegister.o^ + %obj%\RSPCommand.o^ + %obj%\Profiling.o^ + %obj%\RecompilerOps.o^ + %obj%\InterpreterOps.o^ + %obj%\RecompilerCPU.o^ + %obj%\InterpreterCPU.o^ + %obj%\log.o^ + %obj%\breakpoint.o^ + %obj%\dma.o^ + %obj%\memory.o^ + %obj%\Cpu.o^ + %obj%\Main.o + +ECHO Linking RSP objects... +%MinGW%\bin\g++.exe -o %obj%\RSP_1.7.dll %OBJ_LIST% -lgdi32 -s +PAUSE From 068811dc221547aaa0e295bb543be494a7532476 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Oct 2015 22:54:29 -0400 Subject: [PATCH 002/102] fixed SP DMA for pointer-to-integer casts --- Source/RSP/dma.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/RSP/dma.c b/Source/RSP/dma.c index faad399af..5da046e38 100644 --- a/Source/RSP/dma.c +++ b/Source/RSP/dma.c @@ -71,7 +71,7 @@ void SP_DMA_READ (void) { for (i = 0 ; i < Length; i++) { - *(BYTE *)(((DWORD)Dest + j * Length + i) ^ 3) = *(BYTE *)(((DWORD)Source + j * Skip + i) ^ 3); + *(uint8_t *)(((size_t)Dest + j * Length + i) ^ 3) = *(uint8_t *)(((size_t)Source + j * Skip + i) ^ 3); } } #else @@ -90,7 +90,7 @@ void SP_DMA_READ (void) { for (i = 0 ; i < Length; i++) { - *(BYTE *)(((DWORD)Dest + i) ^ 3) = *(BYTE *)(((DWORD)Source + i) ^ 3); + *(uint8_t *)(((size_t)Dest + i) ^ 3) = *(uint8_t *)(((size_t)Source + i) ^ 3); } Source += Skip; Dest += Length; @@ -138,7 +138,7 @@ void SP_DMA_WRITE (void) { for (i = 0 ; i < Length; i++) { - *(BYTE *)(((DWORD)Dest + j * Skip + i) ^ 3) = *(BYTE *)(((DWORD)Source + j * Length + i) ^ 3); + *(uint8_t *)(((size_t)Dest + j * Skip + i) ^ 3) = *(uint8_t *)(((size_t)Source + j * Length + i) ^ 3); } } #else @@ -157,7 +157,7 @@ void SP_DMA_WRITE (void) { for (i = 0 ; i < Length; i++) { - *(BYTE *)(((DWORD)Dest + i) ^ 3) = *(BYTE *)(((DWORD)Source + i) ^ 3); + *(uint8_t *)(((size_t)Dest + i) ^ 3) = *(uint8_t *)(((size_t)Source + i) ^ 3); } Source += Length; Dest += Skip; From fbc9b8027069a14d9f956aa639ecfdcb05a00423 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Oct 2015 00:02:20 -0400 Subject: [PATCH 003/102] MoveOffsetToX86reg --- Source/RSP/Recompiler Ops.c | 38 ++++++++++++++++++------------------- Source/RSP/X86.c | 2 +- Source/RSP/X86.h | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 594f3c925..894839d9f 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -2451,14 +2451,14 @@ void Compile_Vector_VMUDM ( void ) { Push(x86_EBP); sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); if (bWriteToDest) { sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.sa); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.sa].HW[0], Reg, x86_ECX); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.sa].HW[0], Reg, x86_ECX); } else if (!bOptimize) { sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rt); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rt].HW[0], Reg, x86_ECX); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rt].HW[0], Reg, x86_ECX); } for (count = 0; count < 8; count++) { @@ -2575,7 +2575,7 @@ void Compile_Vector_VMUDN ( void ) { Push(x86_EBP); sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); for (count = 0; count < 8; count++) { CPU_Message(" Iteration: %i", count); @@ -2719,7 +2719,7 @@ void Compile_Vector_VMUDH ( void ) { */ sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); MoveSxX86RegPtrDispToX86RegHalf(x86_EBP, 0, x86_EAX); MoveSxX86RegPtrDispToX86RegHalf(x86_EBP, 2, x86_ECX); @@ -2732,7 +2732,7 @@ void Compile_Vector_VMUDH ( void ) { ImulX86RegToX86Reg(x86_ESI, x86_EBX); XorX86RegToX86Reg(x86_EDX, x86_EDX); - MoveOffsetToX86reg((DWORD)&RSP_ACCUM[0].W[0], "RSP_ACCUM[0].W[0]", x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_ACCUM[0].W[0], "RSP_ACCUM[0].W[0]", x86_EBP); MoveX86RegToX86regPointerDisp(x86_EDX, x86_EBP, 0); MoveX86RegToX86regPointerDisp(x86_EAX, x86_EBP, 4); @@ -2748,7 +2748,7 @@ void Compile_Vector_VMUDH ( void ) { */ sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); MoveSxX86RegPtrDispToX86RegHalf(x86_EBP, 8, x86_EAX); MoveSxX86RegPtrDispToX86RegHalf(x86_EBP, 10, x86_ECX); @@ -2761,7 +2761,7 @@ void Compile_Vector_VMUDH ( void ) { ImulX86RegToX86Reg(x86_ESI, x86_EBX); XorX86RegToX86Reg(x86_EDX, x86_EDX); - MoveOffsetToX86reg((DWORD)&RSP_ACCUM[0].W[0], "RSP_ACCUM[0].W[0]", x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_ACCUM[0].W[0], "RSP_ACCUM[0].W[0]", x86_EBP); MoveX86RegToX86regPointerDisp(x86_EDX, x86_EBP, 32); MoveX86RegToX86regPointerDisp(x86_EAX, x86_EBP, 36); @@ -2987,14 +2987,14 @@ void Compile_Vector_VMADM ( void ) { Push(x86_EBP); sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); if (bWriteToDest) { sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.sa); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.sa].HW[0], Reg, x86_ECX); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.sa].HW[0], Reg, x86_ECX); } else if (!bOptimize) { sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rt); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rt].HW[0], Reg, x86_ECX); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rt].HW[0], Reg, x86_ECX); } for (count = 0; count < 8; count++) { @@ -3070,7 +3070,7 @@ void Compile_Vector_VMADN ( void ) { Push(x86_EBP); sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); for (count = 0; count < 8; count++) { CPU_Message(" Iteration: %i", count); @@ -3146,7 +3146,7 @@ void Compile_Vector_VMADH ( void ) { if (bWriteToDest == FALSE && bOptimize == TRUE) { Push(x86_EBP); sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); /* * Pipe lined segment 0 @@ -3196,14 +3196,14 @@ void Compile_Vector_VMADH ( void ) { } else { Push(x86_EBP); sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); if (bWriteToDest) { sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.sa); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.sa].HW[0], Reg, x86_ECX); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.sa].HW[0], Reg, x86_ECX); } else if (!bOptimize) { sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rt); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rt].HW[0], Reg, x86_ECX); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rt].HW[0], Reg, x86_ECX); } for (count = 0; count < 8; count++) { @@ -3686,7 +3686,7 @@ void Compile_Vector_VADDC ( void ) { Push(x86_EBP); sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rd); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rd].HW[0], Reg, x86_EBP); for (count = 0; count < 8; count++) { CPU_Message(" Iteration: %i", count); @@ -5251,7 +5251,7 @@ void Compile_Opcode_LDV ( void ) { CPU_Message(" Unaligned:"); x86_SetBranch32b(Jump[0], RecompPos); sprintf(Reg, "RSP_Vect[%i].UB[%i]", RSPOpC.rt, 15 - RSPOpC.del); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rt].UB[15 - RSPOpC.del], Reg, x86_EDI); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rt].UB[15 - RSPOpC.del], Reg, x86_EDI); length = 8; if (RSPOpC.del == 12){ length = 4; @@ -5993,7 +5993,7 @@ void Compile_Opcode_SDV ( void ) { x86_SetBranch32b((DWORD*)Jump[0], (DWORD*)RecompPos); sprintf(Reg, "RSP_Vect[%i].UB[%i]", RSPOpC.rt, 15 - RSPOpC.del); - MoveOffsetToX86reg((DWORD)&RSP_Vect[RSPOpC.rt].UB[15 - RSPOpC.del], Reg, x86_EDI); + MoveOffsetToX86reg((size_t)&RSP_Vect[RSPOpC.rt].UB[15 - RSPOpC.del], Reg, x86_EDI); MoveConstToX86reg(8, x86_ECX); CPU_Message(" Loop:"); diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index 3abdf6c0e..b28b9cf48 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -1178,7 +1178,7 @@ void MoveConstToX86reg(DWORD Const, int x86reg) { PUTDST32(RecompPos,Const); } -void MoveOffsetToX86reg(DWORD Const, char * VariableName, int x86reg) { +void MoveOffsetToX86reg(size_t Const, char * VariableName, int x86reg) { CPU_Message(" mov %s, offset %s",x86_Name(x86reg),VariableName); switch (x86reg) { case x86_EAX: PUTDST16(RecompPos,0xC0C7); break; diff --git a/Source/RSP/X86.h b/Source/RSP/X86.h index 6723fe11b..c3e003213 100644 --- a/Source/RSP/X86.h +++ b/Source/RSP/X86.h @@ -114,7 +114,7 @@ void MoveConstToN64Mem ( DWORD Const, int AddrReg ); void MoveConstToN64MemDisp ( DWORD Const, int AddrReg, BYTE Disp ); void MoveConstToVariable ( DWORD Const, void *Variable, char *VariableName ); void MoveConstToX86reg ( DWORD Const, int x86reg ); -void MoveOffsetToX86reg ( DWORD Const, char * VariableName, int x86reg ); +void MoveOffsetToX86reg ( size_t Const, char * VariableName, int x86reg ); void MoveX86regByteToX86regPointer ( int Source, int AddrReg ); void MoveX86regHalfToX86regPointer ( int Source, int AddrReg ); void MoveX86regHalfToX86regPointerDisp ( int Source, int AddrReg, BYTE Disp); From 4736a76f8a8a34b7fba39b660e18f9b2d15082d0 Mon Sep 17 00:00:00 2001 From: oddMLan Date: Fri, 30 Oct 2015 00:26:23 -0700 Subject: [PATCH 004/102] Link to Common Controls 6.0 With this we get themed buttons and controls. --- Source/Project64/stdafx.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Project64/stdafx.h b/Source/Project64/stdafx.h index 2c0f1950b..f7f730497 100644 --- a/Source/Project64/stdafx.h +++ b/Source/Project64/stdafx.h @@ -13,6 +13,8 @@ #pragma warning(disable:4247) #pragma warning(disable:4786) +#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") + #include #include #include From f2a5b01620d4ba1e5e7eccaa0f6469d205e2d073 Mon Sep 17 00:00:00 2001 From: oddMLan Date: Fri, 30 Oct 2015 00:39:40 -0700 Subject: [PATCH 005/102] Delete statement linking to old manifest file Visual Studio will generate one during compilation. --- Source/Project64/User Interface/UI Resources.rc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/Project64/User Interface/UI Resources.rc b/Source/Project64/User Interface/UI Resources.rc index 3c1555d97..a7bee1480 100644 --- a/Source/Project64/User Interface/UI Resources.rc +++ b/Source/Project64/User Interface/UI Resources.rc @@ -19,10 +19,6 @@ ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources -#ifdef _M_IX86 -CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "..\Project64.exe.manifest" -#endif - #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US From 0b5fa5ba555ade6b4b6c7a08c31242e0865aab24 Mon Sep 17 00:00:00 2001 From: oddMLan Date: Fri, 30 Oct 2015 00:44:44 -0700 Subject: [PATCH 006/102] Delete Project64.exe.manifest Redundant since Visual Studio will generate an intermediate manifest and embed it into the executable. So it should be safe to delete. --- Source/Project64/Project64.exe.manifest | 28 ------------------------- 1 file changed, 28 deletions(-) delete mode 100644 Source/Project64/Project64.exe.manifest diff --git a/Source/Project64/Project64.exe.manifest b/Source/Project64/Project64.exe.manifest deleted file mode 100644 index ab4df5075..000000000 --- a/Source/Project64/Project64.exe.manifest +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - From 69ebe1672b0440257b41545027cb254b89a38715 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Oct 2015 13:27:02 -0400 Subject: [PATCH 007/102] LeaSourceAndOffset: pointer-to-int truncation fixed --- Source/RSP/Recompiler Ops.c | 2 +- Source/RSP/X86.c | 5 +++-- Source/RSP/X86.h | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 894839d9f..105852e81 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -5444,7 +5444,7 @@ void Compile_Opcode_LRV ( void ) { Jump[0] = RecompPos - 1; /* DecX86reg(x86_EAX); - LeaSourceAndOffset(x86_EAX, x86_EAX, (DWORD) &RSP_Vect[RSPOpC.rt].B[0]); + LeaSourceAndOffset(x86_EAX, x86_EAX, (size_t)&RSP_Vect[RSPOpC.rt].B[0]); DecX86reg(x86_EAX); */ AddConstToX86Reg(x86_EAX, ((DWORD)&RSP_Vect[RSPOpC.rt].UB[0]) - 2); diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index b28b9cf48..fc31849e2 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -1101,7 +1101,7 @@ void JsLabel32(char *Label, DWORD Value) { ** if we need this rewrite it into 1 function **/ -void LeaSourceAndOffset(int x86DestReg, int x86SourceReg, int offset) { +void LeaSourceAndOffset(int x86DestReg, int x86SourceReg, size_t offset) { WORD x86Command = 0; CPU_Message(" lea %s, [%s + %0Xh]",x86_Name(x86DestReg),x86_Name(x86SourceReg),offset); @@ -1130,7 +1130,8 @@ void LeaSourceAndOffset(int x86DestReg, int x86SourceReg, int offset) { DisplayError("LeaSourceAndOffset\nUnknown x86 Register"); } - if ((offset & 0xFFFFFF80) != 0 && (offset & 0xFFFFFF80) != 0xFFFFFF80) { +// To do: Check high DWORD of offset for 64-bit x86. + if ((offset & 0x00000000FFFFFF80) != 0 && (offset & ~0x7F) != ~0x7F) { PUTDST16(RecompPos,x86Command); PUTDST32(RecompPos,offset); } else { diff --git a/Source/RSP/X86.h b/Source/RSP/X86.h index c3e003213..4075f4684 100644 --- a/Source/RSP/X86.h +++ b/Source/RSP/X86.h @@ -105,7 +105,7 @@ void JneLabel32 ( char * Label, DWORD Value ); void JnsLabel8 ( char * Label, BYTE Value ); void JnsLabel32 ( char * Label, DWORD Value ); void JsLabel32 ( char * Label, DWORD Value ); -void LeaSourceAndOffset ( int x86DestReg, int x86SourceReg, int offset ); +void LeaSourceAndOffset ( int x86DestReg, int x86SourceReg, size_t offset ); void MoveConstByteToN64Mem ( BYTE Const, int AddrReg ); void MoveConstHalfToN64Mem ( WORD Const, int AddrReg ); void MoveConstByteToVariable ( BYTE Const,void *Variable, char *VariableName ); From e7fed940de559d958d2f0c905525f68f79d092c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Oct 2015 14:08:19 -0400 Subject: [PATCH 008/102] AddConstToX86Reg: pointer-to-int truncation fixed --- Source/RSP/Recompiler Ops.c | 2 +- Source/RSP/X86.c | 10 ++++++++-- Source/RSP/X86.h | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 105852e81..3861f482f 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -5447,7 +5447,7 @@ void Compile_Opcode_LRV ( void ) { LeaSourceAndOffset(x86_EAX, x86_EAX, (size_t)&RSP_Vect[RSPOpC.rt].B[0]); DecX86reg(x86_EAX); */ - AddConstToX86Reg(x86_EAX, ((DWORD)&RSP_Vect[RSPOpC.rt].UB[0]) - 2); + AddConstToX86Reg(x86_EAX, ((size_t)&RSP_Vect[RSPOpC.rt].UB[0]) - 2); CPU_Message(" Loop:"); Loop = RecompPos; diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index fc31849e2..947dfb06c 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -152,9 +152,15 @@ void AddConstToVariable (DWORD Const, void *Variable, char *VariableName) { PUTDST32(RecompPos,Const); } -void AddConstToX86Reg (int x86Reg, DWORD Const) { +void AddConstToX86Reg(int x86Reg, size_t Const) +{ + const size_t zero_extension_mask = 0x00000000000000007F; + const size_t sign_extension_mask = ~(zero_extension_mask); + const size_t extension_from_8bit = Const & sign_extension_mask; + +/* To do: if 64-bit x86, then what if `Const' upper DWORD set? */ CPU_Message(" add %s, %Xh",x86_Name(x86Reg),Const); - if ((Const & 0xFFFFFF80) != 0 && (Const & 0xFFFFFF80) != 0xFFFFFF80) { + if (extension_from_8bit != 0 && extension_from_8bit != sign_extension_mask) { switch (x86Reg) { case x86_EAX: PUTDST16(RecompPos,0xC081); break; case x86_EBX: PUTDST16(RecompPos,0xC381); break; diff --git a/Source/RSP/X86.h b/Source/RSP/X86.h index 4075f4684..6f08aa30a 100644 --- a/Source/RSP/X86.h +++ b/Source/RSP/X86.h @@ -46,7 +46,7 @@ void AdcConstToX86reg ( BYTE Constant, int x86reg ); void AdcConstToVariable ( void *Variable, char *VariableName, BYTE Constant ); void AdcConstHalfToVariable ( void *Variable, char *VariableName, BYTE Constant ); void AddConstToVariable ( DWORD Const, void *Variable, char *VariableName ); -void AddConstToX86Reg ( int x86Reg, DWORD Const ); +void AddConstToX86Reg ( int x86Reg, size_t Const ); void AddVariableToX86reg ( int x86reg, void * Variable, char * VariableName ); void AddX86regToVariable ( int x86reg, void * Variable, char * VariableName ); void AddX86regHalfToVariable ( int x86reg, void * Variable, char * VariableName ); From 354cf1bf5d9bf673e105095a535f0c747a53f514 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Oct 2015 15:48:30 -0400 Subject: [PATCH 009/102] fixed x86 compiler address writes --- Source/RSP/Mmx.c | 20 +++---- Source/RSP/Sse.c | 18 ++++--- Source/RSP/X86.c | 132 ++++++++++++++++++++++++----------------------- 3 files changed, 88 insertions(+), 82 deletions(-) diff --git a/Source/RSP/Mmx.c b/Source/RSP/Mmx.c index 718fd44e7..a21c23c94 100644 --- a/Source/RSP/Mmx.c +++ b/Source/RSP/Mmx.c @@ -35,6 +35,8 @@ #define PUTDST8(dest,value) (*((BYTE *)(dest))=(BYTE)(value)); dest += 1; #define PUTDST16(dest,value) (*((WORD *)(dest))=(WORD)(value)); dest += 2; #define PUTDST32(dest,value) (*((DWORD *)(dest))=(DWORD)(value)); dest += 4; +#define PUTDSTPTR(dest, value) \ + *(void **)(dest) = (void *)(value); dest += sizeof(void *); char * mmx_Strings[8] = { "mm0", "mm1", "mm2", "mm3", @@ -96,7 +98,7 @@ void MmxMoveQwordVariableToReg(int Dest, void *Variable, char *VariableName) { PUTDST16(RecompPos,0x6f0f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MmxMoveQwordRegToVariable(int Dest, void *Variable, char *VariableName) { @@ -117,7 +119,7 @@ void MmxMoveQwordRegToVariable(int Dest, void *Variable, char *VariableName) { PUTDST16(RecompPos,0x7f0f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MmxPorRegToReg(int Dest, int Source) { @@ -167,7 +169,7 @@ void MmxPorVariableToReg(void * Variable, char * VariableName, int Dest) { PUTDST16(RecompPos,0xeb0f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MmxPandRegToReg(int Dest, int Source) { @@ -217,7 +219,7 @@ void MmxPandVariableToReg(void * Variable, char * VariableName, int Dest) { PUTDST16(RecompPos,0xdb0f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MmxPandnRegToReg(int Dest, int Source) { @@ -296,7 +298,7 @@ void MmxShuffleMemoryToReg(int Dest, void * Variable, char * VariableName, BYTE PUTDST16(RecompPos,0x700f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST8(RecompPos, Immed); } @@ -375,7 +377,7 @@ void MmxPmullwVariableToReg(int Dest, void * Variable, char * VariableName) { } PUTDST16(RecompPos,0xd50f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos, Variable); + PUTDSTPTR(RecompPos, Variable); } void MmxPmulhuwRegToReg(int Dest, int Source) { @@ -453,7 +455,7 @@ void MmxPmulhwRegToVariable(int Dest, void * Variable, char * VariableName) { } PUTDST16(RecompPos,0xe50f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos, Variable); + PUTDSTPTR(RecompPos, Variable); } @@ -596,7 +598,7 @@ void MmxPaddswVariableToReg(int Dest, void * Variable, char * VariableName) { PUTDST16(RecompPos,0xed0f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos, Variable); + PUTDSTPTR(RecompPos, Variable); } void MmxPsubswVariableToReg(int Dest, void * Variable, char * VariableName) { @@ -617,7 +619,7 @@ void MmxPsubswVariableToReg(int Dest, void * Variable, char * VariableName) { PUTDST16(RecompPos,0xe90f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos, Variable); + PUTDSTPTR(RecompPos, Variable); } void MmxPaddwRegToReg(int Dest, int Source) { diff --git a/Source/RSP/Sse.c b/Source/RSP/Sse.c index 6eddbefba..11729e5fb 100644 --- a/Source/RSP/Sse.c +++ b/Source/RSP/Sse.c @@ -35,6 +35,8 @@ #define PUTDST8(dest,value) (*((BYTE *)(dest))=(BYTE)(value)); dest += 1; #define PUTDST16(dest,value) (*((WORD *)(dest))=(WORD)(value)); dest += 2; #define PUTDST32(dest,value) (*((DWORD *)(dest))=(DWORD)(value)); dest += 4; +#define PUTDSTPTR(dest, value) \ + *(void **)(dest) = (void *)(value); dest += sizeof(void *); char * sse_Strings[8] = { "xmm0", "xmm1", "xmm2", "xmm3", @@ -61,7 +63,7 @@ void SseMoveAlignedVariableToReg(void *Variable, char *VariableName, int sseReg) PUTDST16(RecompPos,0x280f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SseMoveAlignedN64MemToReg(int sseReg, int AddrReg) { @@ -92,7 +94,7 @@ void SseMoveAlignedN64MemToReg(int sseReg, int AddrReg) { PUTDST16(RecompPos,0x280f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void SseMoveAlignedRegToVariable(int sseReg, void *Variable, char *VariableName) { @@ -113,7 +115,7 @@ void SseMoveAlignedRegToVariable(int sseReg, void *Variable, char *VariableName) PUTDST16(RecompPos,0x290f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SseMoveAlignedRegToN64Mem(int sseReg, int AddrReg) { @@ -144,7 +146,7 @@ void SseMoveAlignedRegToN64Mem(int sseReg, int AddrReg) { PUTDST16(RecompPos,0x290f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void SseMoveUnalignedVariableToReg(void *Variable, char *VariableName, int sseReg) { @@ -165,7 +167,7 @@ void SseMoveUnalignedVariableToReg(void *Variable, char *VariableName, int sseRe PUTDST16(RecompPos,0x100f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SseMoveUnalignedN64MemToReg(int sseReg, int AddrReg) { @@ -196,7 +198,7 @@ void SseMoveUnalignedN64MemToReg(int sseReg, int AddrReg) { PUTDST16(RecompPos,0x100f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void SseMoveUnalignedRegToVariable(int sseReg, void *Variable, char *VariableName) { @@ -217,7 +219,7 @@ void SseMoveUnalignedRegToVariable(int sseReg, void *Variable, char *VariableNam PUTDST16(RecompPos,0x110f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SseMoveUnalignedRegToN64Mem(int sseReg, int AddrReg) { @@ -248,7 +250,7 @@ void SseMoveUnalignedRegToN64Mem(int sseReg, int AddrReg) { PUTDST16(RecompPos,0x110f); PUTDST8(RecompPos, x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void SseMoveRegToReg(int Dest, int Source) { diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index 947dfb06c..fa20085fa 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -37,6 +37,8 @@ #define PUTDST8(dest,value) (*((BYTE *)(dest))=(BYTE)(value)); dest += 1; #define PUTDST16(dest,value) (*((WORD *)(dest))=(WORD)(value)); dest += 2; #define PUTDST32(dest,value) (*((DWORD *)(dest))=(DWORD)(value)); dest += 4; +#define PUTDSTPTR(dest, value) \ + *(void **)(dest) = (void *)(value); dest += sizeof(void *); char * x86_Strings[8] = { "eax", "ebx", "ecx", "edx", @@ -99,7 +101,7 @@ void AdcX86regToVariable(int x86reg, void * Variable, char * VariableName) { default: DisplayError("AddVariableToX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AdcX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) { @@ -118,13 +120,13 @@ void AdcX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) { default: DisplayError("AdcX86regHalfToVariable\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AdcConstToVariable(void *Variable, char *VariableName, BYTE Constant) { CPU_Message(" adc dword ptr [%s], %Xh", VariableName, Constant); PUTDST16(RecompPos,0x1583); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST8(RecompPos,Constant); } @@ -148,7 +150,7 @@ void AdcConstToX86reg( BYTE Constant, int x86reg ) { void AddConstToVariable (DWORD Const, void *Variable, char *VariableName) { CPU_Message(" add dword ptr [%s], 0x%X",VariableName, Const); PUTDST16(RecompPos,0x0581); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos,Const); } @@ -194,7 +196,7 @@ void AdcConstHalfToVariable(void *Variable, char *VariableName, BYTE Constant) { PUTDST8(RecompPos,0x83); PUTDST8(RecompPos,0x15); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST8(RecompPos,Constant); } @@ -213,7 +215,7 @@ void AddVariableToX86reg(int x86reg, void * Variable, char * VariableName) { default: DisplayError("AddVariableToX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AddX86regToVariable(int x86reg, void * Variable, char * VariableName) { @@ -230,7 +232,7 @@ void AddX86regToVariable(int x86reg, void * Variable, char * VariableName) { default: DisplayError("AddVariableToX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AddX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) { @@ -250,7 +252,7 @@ void AddX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) { default: DisplayError("AddVariableToX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AddX86RegToX86Reg(int Destination, int Source) { @@ -283,7 +285,7 @@ void AddX86RegToX86Reg(int Destination, int Source) { void AndConstToVariable (DWORD Const, void *Variable, char *VariableName) { CPU_Message(" and dword ptr [%s], 0x%X",VariableName, Const); PUTDST16(RecompPos,0x2581); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos,Const); } @@ -328,7 +330,7 @@ void AndVariableToX86Reg(void * Variable, char * VariableName, int x86Reg) { case x86_ESP: PUTDST16(RecompPos,0x2523); break; case x86_EBP: PUTDST16(RecompPos,0x2D23); break; } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AndVariableToX86regHalf(void * Variable, char * VariableName, int x86Reg) { @@ -344,7 +346,7 @@ void AndVariableToX86regHalf(void * Variable, char * VariableName, int x86Reg) { case x86_ESP: PUTDST16(RecompPos,0x2523); break; case x86_EBP: PUTDST16(RecompPos,0x2D23); break; } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AndX86RegToVariable(void * Variable, char * VariableName, int x86Reg) { @@ -359,7 +361,7 @@ void AndX86RegToVariable(void * Variable, char * VariableName, int x86Reg) { case x86_ESP: PUTDST16(RecompPos,0x2521); break; case x86_EBP: PUTDST16(RecompPos,0x2D21); break; } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void AndX86RegToX86Reg(int Destination, int Source) { @@ -466,13 +468,13 @@ void BsrX86RegToX86Reg(int Destination, int Source) { void Call_Direct(void * FunctAddress, char * FunctName) { CPU_Message(" call offset %s",FunctName); PUTDST8(RecompPos,0xE8); - PUTDST32(RecompPos,(DWORD)FunctAddress-(DWORD)RecompPos - 4); + PUTDSTPTR(RecompPos, (size_t)FunctAddress - (size_t)RecompPos - sizeof(void *)); } void Call_Indirect(void * FunctAddress, char * FunctName) { CPU_Message(" call [%s]",FunctName); PUTDST16(RecompPos,0x15FF); - PUTDST32(RecompPos,FunctAddress); + PUTDSTPTR(RecompPos, FunctAddress); } void CondMoveEqual(int Destination, int Source) { @@ -730,7 +732,7 @@ void CondMoveLessEqual(int Destination, int Source) { void CompConstToVariable(DWORD Const, void * Variable, char * VariableName) { CPU_Message(" cmp dword ptr [%s], 0x%X",VariableName, Const); PUTDST16(RecompPos,0x3D81); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos,Const); } @@ -740,7 +742,7 @@ void CompConstHalfToVariable(WORD Const, void * Variable, char * VariableName) { PUTDST8(RecompPos,0x81); PUTDST8(RecompPos,0x3D); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST16(RecompPos,Const); } @@ -789,7 +791,7 @@ void CompX86regToVariable(int x86Reg, void * Variable, char * VariableName) { default: DisplayError("Unknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void CompVariableToX86reg(int x86Reg, void * Variable, char * VariableName) { @@ -806,7 +808,7 @@ void CompVariableToX86reg(int x86Reg, void * Variable, char * VariableName) { default: DisplayError("Unknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void CompX86RegToX86Reg(int Destination, int Source) { @@ -1149,7 +1151,7 @@ void LeaSourceAndOffset(int x86DestReg, int x86SourceReg, size_t offset) { void MoveConstByteToVariable (BYTE Const,void *Variable, char *VariableName) { CPU_Message(" mov byte ptr [%s], %Xh",VariableName,Const); PUTDST16(RecompPos,0x05C6); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST8(RecompPos,Const); } @@ -1157,14 +1159,14 @@ void MoveConstHalfToVariable (WORD Const,void *Variable, char *VariableName) { CPU_Message(" mov word ptr [%s], %Xh",VariableName,Const); PUTDST8(RecompPos,0x66); PUTDST16(RecompPos,0x05C7); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST16(RecompPos,Const); } void MoveConstToVariable (DWORD Const,void *Variable, char *VariableName) { CPU_Message(" mov dword ptr [%s], %Xh",VariableName,Const); PUTDST16(RecompPos,0x05C7); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos,Const); } @@ -1481,7 +1483,7 @@ void MoveN64MemDispToX86reg(int x86reg, int AddrReg, BYTE Disp) { case x86_EBP: x86Command += 0xA800; break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM + Disp); + PUTDSTPTR(RecompPos, RSPInfo.DMEM + Disp); } void MoveN64MemToX86reg(int x86reg, int AddrReg) { @@ -1510,7 +1512,7 @@ void MoveN64MemToX86reg(int x86reg, int AddrReg) { case x86_EBP: x86Command += 0xA800; break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveN64MemToX86regByte(int x86reg, int AddrReg) { @@ -1537,7 +1539,7 @@ void MoveN64MemToX86regByte(int x86reg, int AddrReg) { break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveN64MemToX86regHalf(int x86reg, int AddrReg) { @@ -1567,7 +1569,7 @@ void MoveN64MemToX86regHalf(int x86reg, int AddrReg) { case x86_EBP: x86Command += 0xA800; break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveX86regByteToN64Mem(int x86reg, int AddrReg) { @@ -1590,7 +1592,7 @@ void MoveX86regByteToN64Mem(int x86reg, int AddrReg) { case x86_EDX: x86Command += 0x9000; break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveX86regHalfToN64Mem(int x86reg, int AddrReg) { @@ -1619,7 +1621,7 @@ void MoveX86regHalfToN64Mem(int x86reg, int AddrReg) { case x86_EBP: x86Command += 0xA800; break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveX86regToN64Mem(int x86reg, int AddrReg) { @@ -1647,7 +1649,7 @@ void MoveX86regToN64Mem(int x86reg, int AddrReg) { case x86_EBP: x86Command += 0xA800; break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveX86regToN64MemDisp(int x86reg, int AddrReg, BYTE Disp) { @@ -1675,7 +1677,7 @@ void MoveX86regToN64MemDisp(int x86reg, int AddrReg, BYTE Disp) { case x86_EBP: x86Command += 0xA800; break; } PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM+Disp); + PUTDSTPTR(RecompPos, RSPInfo.DMEM + Disp); } void MoveVariableToX86reg(void *Variable, char *VariableName, int x86reg) { @@ -1691,7 +1693,7 @@ void MoveVariableToX86reg(void *Variable, char *VariableName, int x86reg) { case x86_EBP: PUTDST16(RecompPos,0x2D8B); break; default: DisplayError("MoveVariableToX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveVariableToX86regByte(void *Variable, char *VariableName, int x86reg) { @@ -1703,7 +1705,7 @@ void MoveVariableToX86regByte(void *Variable, char *VariableName, int x86reg) { case x86_EDX: PUTDST16(RecompPos,0x158A); break; default: DisplayError("MoveVariableToX86regByte\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) { @@ -1720,7 +1722,7 @@ void MoveVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) { case x86_EBP: PUTDST16(RecompPos,0x2D8B); break; default: DisplayError("MoveVariableToX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveX86regByteToVariable(int x86reg, void * Variable, char * VariableName) { @@ -1733,7 +1735,7 @@ void MoveX86regByteToVariable(int x86reg, void * Variable, char * VariableName) default: DisplayError("MoveX86regByteToVariable\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) { @@ -1751,7 +1753,7 @@ void MoveX86regHalfToVariable(int x86reg, void * Variable, char * VariableName) default: DisplayError("MoveX86regHalfToVariable\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveX86regToVariable(int x86reg, void * Variable, char * VariableName) { @@ -1768,7 +1770,7 @@ void MoveX86regToVariable(int x86reg, void * Variable, char * VariableName) { default: DisplayError("MoveX86regToVariable\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveX86RegToX86Reg(int Source, int Destination) { @@ -1877,7 +1879,7 @@ void MoveSxVariableToX86regByte(void *Variable, char *VariableName, int x86reg) case x86_EBP: PUTDST8(RecompPos,0x2D); break; default: DisplayError("MoveSxVariableToX86regByte\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveSxVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) { @@ -1896,7 +1898,7 @@ void MoveSxVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) case x86_EBP: PUTDST8(RecompPos,0x2D); break; default: DisplayError("MoveSxVariableToX86regHalf\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveSxN64MemToX86regByte(int x86reg, int AddrReg) { @@ -1924,7 +1926,7 @@ void MoveSxN64MemToX86regByte(int x86reg, int AddrReg) { } PUTDST8(RecompPos,0x0f); PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveSxN64MemToX86regHalf(int x86reg, int AddrReg) { @@ -1955,7 +1957,7 @@ void MoveSxN64MemToX86regHalf(int x86reg, int AddrReg) { PUTDST8(RecompPos, 0x0f); PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveZxX86RegHalfToX86Reg(int Source, int Destination) { @@ -2035,7 +2037,7 @@ void MoveZxVariableToX86regByte(void *Variable, char *VariableName, int x86reg) case x86_EBP: PUTDST8(RecompPos,0x2D); break; default: DisplayError("MoveZxVariableToX86regByte\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveZxVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) { @@ -2054,7 +2056,7 @@ void MoveZxVariableToX86regHalf(void *Variable, char *VariableName, int x86reg) case x86_EBP: PUTDST8(RecompPos,0x2D); break; default: DisplayError("MoveZxVariableToX86regHalf\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void MoveZxN64MemToX86regByte(int x86reg, int AddrReg) { @@ -2082,7 +2084,7 @@ void MoveZxN64MemToX86regByte(int x86reg, int AddrReg) { } PUTDST8(RecompPos,0x0f); PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MoveZxN64MemToX86regHalf(int x86reg, int AddrReg) { @@ -2113,7 +2115,7 @@ void MoveZxN64MemToX86regHalf(int x86reg, int AddrReg) { PUTDST8(RecompPos, 0x0f); PUTDST16(RecompPos,x86Command); - PUTDST32(RecompPos,RSPInfo.DMEM); + PUTDSTPTR(RecompPos, RSPInfo.DMEM); } void MulX86reg(int x86reg) { @@ -2167,7 +2169,7 @@ void NotX86reg(int x86reg) { void OrConstToVariable(DWORD Const, void * Variable, char * VariableName) { CPU_Message(" or dword ptr [%s], 0x%X",VariableName, Const); PUTDST16(RecompPos,0x0D81); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos,Const); } @@ -2212,7 +2214,7 @@ void OrVariableToX86Reg(void * Variable, char * VariableName, int x86Reg) { case x86_ESP: PUTDST16(RecompPos,0x250B); break; case x86_EBP: PUTDST16(RecompPos,0x2D0B); break; } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void OrVariableToX86regHalf(void * Variable, char * VariableName, int x86Reg) { @@ -2228,7 +2230,7 @@ void OrVariableToX86regHalf(void * Variable, char * VariableName, int x86Reg) { case x86_ESP: PUTDST16(RecompPos,0x250B); break; case x86_EBP: PUTDST16(RecompPos,0x2D0B); break; } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void OrX86RegToVariable(void * Variable, char * VariableName, int x86Reg) { @@ -2243,7 +2245,7 @@ void OrX86RegToVariable(void * Variable, char * VariableName, int x86Reg) { case x86_ESP: PUTDST16(RecompPos,0x2509); break; case x86_EBP: PUTDST16(RecompPos,0x2D09); break; } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void OrX86RegToX86Reg(int Destination, int Source) { @@ -2341,14 +2343,14 @@ void SetlVariable(void * Variable, char * VariableName) { CPU_Message(" setl byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x9C0F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SetleVariable(void * Variable, char * VariableName) { CPU_Message(" setle byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x9E0F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void Setb(int x86reg) { @@ -2368,7 +2370,7 @@ void SetbVariable(void * Variable, char * VariableName) { CPU_Message(" setb byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x920F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void Setg(int x86reg) { @@ -2388,14 +2390,14 @@ void SetgVariable(void * Variable, char * VariableName) { CPU_Message(" setg byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x9F0F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SetgeVariable(void * Variable, char * VariableName) { CPU_Message(" setge byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x9D0F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void Seta(int x86reg) { @@ -2415,7 +2417,7 @@ void SetaVariable(void * Variable, char * VariableName) { CPU_Message(" seta byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x970F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void Setae(int x86reg) { @@ -2448,7 +2450,7 @@ void SetzVariable(void * Variable, char * VariableName) { CPU_Message(" setz byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x940F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void Setnz(int x86reg) { @@ -2468,7 +2470,7 @@ void SetnzVariable(void * Variable, char * VariableName) { CPU_Message(" setnz byte ptr [%s]",VariableName); PUTDST16(RecompPos,0x950F); PUTDST8(RecompPos,0x05); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void ShiftLeftDoubleImmed(int Destination, int Source, BYTE Immediate) { @@ -2568,7 +2570,7 @@ void ShiftLeftSignVariableImmed(void *Variable, char *VariableName, BYTE Immedia CPU_Message(" shl dword ptr [%s], %Xh",VariableName, Immediate); PUTDST16(RecompPos,0x25C1) - PUTDST32(RecompPos, Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST8(RecompPos,Immediate); } @@ -2593,7 +2595,7 @@ void ShiftRightSignVariableImmed(void *Variable, char *VariableName, BYTE Immedi CPU_Message(" sar dword ptr [%s], %Xh",VariableName, Immediate); PUTDST16(RecompPos,0x3DC1) - PUTDST32(RecompPos, Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST8(RecompPos,Immediate); } @@ -2630,14 +2632,14 @@ void ShiftRightUnsignVariableImmed(void *Variable, char *VariableName, BYTE Imme CPU_Message(" shr dword ptr [%s], %Xh",VariableName, Immediate); PUTDST16(RecompPos,0x2DC1) - PUTDST32(RecompPos, Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST8(RecompPos,Immediate); } void SubConstFromVariable (DWORD Const, void *Variable, char *VariableName) { CPU_Message(" sub dword ptr [%s], 0x%X",VariableName, Const);\ PUTDST16(RecompPos,0x2D81); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos,Const); } @@ -2684,7 +2686,7 @@ void SubVariableFromX86reg(int x86reg, void * Variable, char * VariableName) { default: DisplayError("SubVariableFromX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SubX86regFromVariable(int x86reg, void * Variable, char * VariableName) { @@ -2701,7 +2703,7 @@ void SubX86regFromVariable(int x86reg, void * Variable, char * VariableName) { default: DisplayError("SubX86regFromVariable\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void SubX86RegToX86Reg(int Destination, int Source) { @@ -2759,7 +2761,7 @@ void SbbX86RegToX86Reg(int Destination, int Source) { void TestConstToVariable(DWORD Const, void * Variable, char * VariableName) { CPU_Message(" test dword ptr [%s], 0x%X",VariableName, Const); PUTDST16(RecompPos,0x05F7); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos,Const); } @@ -2840,7 +2842,7 @@ void XorConstToVariable(void *Variable, char *VariableName, DWORD Const) { CPU_Message(" xor dword ptr [%s], 0x%X",VariableName, Const); PUTDST16(RecompPos, 0x3581); - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); PUTDST32(RecompPos, Const); } @@ -2885,7 +2887,7 @@ void XorVariableToX86reg(void *Variable, char *VariableName, int x86reg) { case x86_EBP: PUTDST16(RecompPos,0x2D33); break; default: DisplayError("XorVariableToX86reg\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } void XorX86RegToVariable(void *Variable, char *VariableName, int x86reg) { @@ -2901,5 +2903,5 @@ void XorX86RegToVariable(void *Variable, char *VariableName, int x86reg) { case x86_EBP: PUTDST16(RecompPos,0x2D31); break; default: DisplayError("XorX86RegToVariable\nUnknown x86 Register"); } - PUTDST32(RecompPos,Variable); + PUTDSTPTR(RecompPos, Variable); } From a53526163be770f78105fc218e0e17c4ff0b7c6d Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 30 Oct 2015 16:08:18 -0400 Subject: [PATCH 010/102] fixed a couple remaining 64-bit pointer truncations --- Source/RSP/Recompiler CPU.c | 12 ++++++++---- Source/RSP/X86.c | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/RSP/Recompiler CPU.c b/Source/RSP/Recompiler CPU.c index 15cc590b3..f805bd383 100644 --- a/Source/RSP/Recompiler CPU.c +++ b/Source/RSP/Recompiler CPU.c @@ -754,9 +754,10 @@ void CompilerLinkBlocks(void) { x86_SetBranch32b(RecompPos - 4, KnownCode); } -void CompilerRSPBlock ( void ) { - DWORD Count, Padding, X86BaseAddress = (DWORD)RecompPos; +void CompilerRSPBlock(void) +{ BYTE * IMEM_SAVE = (BYTE *)malloc(0x1000); + const size_t X86BaseAddress = (size_t)RecompPos; NextInstruction = NORMAL; CompilePC = *PrgCount; @@ -766,8 +767,11 @@ void CompilerRSPBlock ( void ) { CurrentBlock.CurrPC = CompilePC; /* Align the block to a boundary */ - if (X86BaseAddress & 7) { - Padding = (8 - (X86BaseAddress & 7)) & 7; + if (X86BaseAddress & 7) + { + register size_t Count; + const size_t Padding = (8 - (X86BaseAddress & 7)) & 7; + for (Count = 0; Count < Padding; Count++) { CPU_Message("%08X: nop", RecompPos); *(RecompPos++) = 0x90; diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index fa20085fa..3fc44a965 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -427,7 +427,11 @@ void BreakPointNotification (const char * const FileName, const int LineNumber) void X86BreakPoint (LPCSTR FileName, int LineNumber) { Pushad(); PushImm32("LineNumber",LineNumber); +#if defined(_M_IX86) PushImm32("FileName",(DWORD)FileName); +#else + DisplayError("PushImm64\nUnimplemented."); +#endif Call_Direct(BreakPointNotification,"BreakPointNotification"); AddConstToX86Reg(x86_ESP, 8); Popad(); From d08baf90cf01619c5b78f1c29675c1648920de0b Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 1 Nov 2015 21:51:06 -0500 Subject: [PATCH 011/102] Filter compiled sources and build files from Git view. --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index 72a128650..77fdc2e0b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,14 @@ *.sdf *.suo *.user + +# compiler-generated sources (MSVC, GCC) +*.asm +*.s + +# assembled linker objects (GCC) +*.o + Thumbs.db /Bin/Debug /Bin/Debug64 From 695ebfa9ad69b452142505b6737dfdcf5bf22855 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Mon, 9 Nov 2015 04:39:36 -0700 Subject: [PATCH 012/102] Use a standard window for the About Dialog --- Source/Project64/Project64.vcxproj | 2 +- Source/Project64/Project64.vcxproj.filters | 6 +- .../Bitmaps/AboutScreenLogo.bmp | Bin 0 -> 126294 bytes Source/Project64/User Interface/Gui Class.cpp | 107 ++++-------------- .../Project64/User Interface/UI Resources.rc | 8 +- Source/Project64/User Interface/resource.h | 2 +- 6 files changed, 31 insertions(+), 94 deletions(-) create mode 100644 Source/Project64/User Interface/Bitmaps/AboutScreenLogo.bmp diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj index c0fc9b536..45a6e4904 100644 --- a/Source/Project64/Project64.vcxproj +++ b/Source/Project64/Project64.vcxproj @@ -157,9 +157,9 @@ + - diff --git a/Source/Project64/Project64.vcxproj.filters b/Source/Project64/Project64.vcxproj.filters index e831f9869..9805e41ad 100644 --- a/Source/Project64/Project64.vcxproj.filters +++ b/Source/Project64/Project64.vcxproj.filters @@ -431,9 +431,6 @@ Resource Files - - Resource Files - Resource Files @@ -455,6 +452,9 @@ Resource Files + + Resource Files + diff --git a/Source/Project64/User Interface/Bitmaps/AboutScreenLogo.bmp b/Source/Project64/User Interface/Bitmaps/AboutScreenLogo.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9d8822f82d90f91ddad521a694793d577dcd0945 GIT binary patch literal 126294 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 literal 0 HcmV?d00001 diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index e60f3754c..8b46abed9 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -973,45 +973,9 @@ LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWO return TRUE; } -WNDPROC pfnWndAboutBoxCancelProc = NULL; -HBITMAP hCloseButton = NULL; - -DWORD CALLBACK AboutBoxCancelProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) -{ - switch (uMsg) { - case WM_PAINT: - { - PAINTSTRUCT ps; - - if (BeginPaint(hWnd, &ps)) - { - if (hCloseButton) - { - RECT rcClient; - GetClientRect(hWnd, &rcClient); - - BITMAP bmTL1; - GetObject(hCloseButton, sizeof(BITMAP), &bmTL1); - HDC memdc = CreateCompatibleDC(ps.hdc); - HGDIOBJ save = SelectObject(memdc, hCloseButton); - BitBlt(ps.hdc, 0, 0, bmTL1.bmWidth, bmTL1.bmHeight, memdc, 0, 0, SRCCOPY); - SelectObject(memdc, save); - DeleteDC(memdc); - } - EndPaint(hWnd, &ps); - } - } - break; - } - - return CallWindowProc(pfnWndAboutBoxCancelProc, hWnd, uMsg, wParam, lParam); -} - DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) { static HBITMAP hbmpBackgroundTop = NULL; - static HBITMAP hbmpBackgroundBottom = NULL; - static HBITMAP hbmpBackgroundMiddle = NULL; static HFONT hPageHeadingFont = NULL; static HFONT hTextFont = NULL; static HFONT hAuthorFont = NULL; @@ -1019,24 +983,18 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) switch (uMsg) { case WM_INITDIALOG: { - enum { ROUND_EDGE = 15 }; - - DWORD dwStyle = GetWindowLong(hWnd, GWL_STYLE); - dwStyle &= ~(WS_CAPTION | WS_SIZEBOX); - SetWindowLong(hWnd, GWL_STYLE, dwStyle); + //Title + LONG_PTR originalWndProc = GetWindowLongPtrW(hWnd, GWLP_WNDPROC); + SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR)DefWindowProcW); + SetWindowTextW(hWnd, GS(PLUG_ABOUT)); + SetWindowLongPtrW(hWnd, GWLP_WNDPROC, originalWndProc); // Use the size of the image - hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_TOP)); - hbmpBackgroundBottom = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_BOTTOM)); - hbmpBackgroundMiddle = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_MIDDLE)); + hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_LOGO)); BITMAP bmTL; GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); - hCloseButton = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_CLOSE_NORMAL)); - pfnWndAboutBoxCancelProc = (WNDPROC)::GetWindowLongPtr(GetDlgItem(hWnd, IDCANCEL), GWLP_WNDPROC); - ::SetWindowLongPtr(GetDlgItem(hWnd, IDCANCEL), GWLP_WNDPROC, (LONG_PTR)AboutBoxCancelProc); - if (hbmpBackgroundTop) { // int iHeight = bmTL.bmHeight; @@ -1047,13 +1005,6 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) rect.left -= rect.left; rect.bottom -= rect.top; rect.top -= rect.top; - - HRGN hWindowRegion = CreateRoundRectRgn(rect.left, rect.top, rect.left + iWidth + GetSystemMetrics(SM_CXEDGE) - 1, rect.bottom + GetSystemMetrics(SM_CYEDGE) - 1, ROUND_EDGE, ROUND_EDGE); - if (hWindowRegion) - { - SetWindowRgn(hWnd, hWindowRegion, TRUE); - DeleteObject(hWindowRegion); - } } hTextFont = ::CreateFont(18, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); @@ -1114,6 +1065,22 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); } break; + case WM_ERASEBKGND: + { + HPEN outline; + HBRUSH fill; + RECT rect; + + outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); + fill = CreateSolidBrush(0x00FFFFFF); + SelectObject((HDC)wParam, outline); + SelectObject((HDC)wParam, fill); + + GetClientRect(hWnd, &rect); + + Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); + } + break; case WM_PAINT: { PAINTSTRUCT ps; @@ -1123,10 +1090,8 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) RECT rcClient; GetClientRect(hWnd, &rcClient); - BITMAP bmTL_top, bmTL_bottom, bmTL_Middle; + BITMAP bmTL_top; GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL_top); - GetObject(hbmpBackgroundBottom, sizeof(BITMAP), &bmTL_bottom); - GetObject(hbmpBackgroundMiddle, sizeof(BITMAP), &bmTL_Middle); HDC memdc = CreateCompatibleDC(ps.hdc); HGDIOBJ save = SelectObject(memdc, hbmpBackgroundTop); @@ -1134,24 +1099,6 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) SelectObject(memdc, save); DeleteDC(memdc); - memdc = CreateCompatibleDC(ps.hdc); - save = SelectObject(memdc, hbmpBackgroundMiddle); - for (int x = bmTL_top.bmHeight; x < rcClient.bottom; x += bmTL_Middle.bmHeight) - { - BitBlt(ps.hdc, 0, x, bmTL_Middle.bmWidth, bmTL_Middle.bmHeight, memdc, 0, 0, SRCCOPY); - } - SelectObject(memdc, save); - DeleteDC(memdc); - - BITMAP; - memdc = CreateCompatibleDC(ps.hdc); - save = SelectObject(memdc, hbmpBackgroundBottom); - BitBlt(ps.hdc, 0, rcClient.bottom - bmTL_bottom.bmHeight, bmTL_bottom.bmWidth, bmTL_bottom.bmHeight, memdc, 0, 0, SRCCOPY); - SelectObject(memdc, save); - DeleteDC(memdc); - - BITMAP; - EndPaint(hWnd, &ps); } } @@ -1165,14 +1112,6 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) { DeleteObject(hbmpBackgroundTop); } - if (hbmpBackgroundBottom) - { - DeleteObject(hbmpBackgroundBottom); - } - if (hbmpBackgroundMiddle) - { - DeleteObject(hbmpBackgroundMiddle); - } if (hTextFont) { ::DeleteObject(hTextFont); diff --git a/Source/Project64/User Interface/UI Resources.rc b/Source/Project64/User Interface/UI Resources.rc index 3c1555d97..27a521eb3 100644 --- a/Source/Project64/User Interface/UI Resources.rc +++ b/Source/Project64/User Interface/UI Resources.rc @@ -383,12 +383,10 @@ BEGIN PUSHBUTTON "OK",IDOK,134,230,47,13 END -IDD_About DIALOGEX 0, 0, 254, 258 -STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -EXSTYLE WS_EX_RIGHT | WS_EX_RTLREADING | WS_EX_LEFTSCROLLBAR +IDD_About DIALOGEX 0, 0, 233, 265 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - PUSHBUTTON "X",IDCANCEL,211,8,14,13,BS_LEFT,WS_EX_RIGHT | WS_EX_RTLREADING LTEXT "Core Project 64 Team:",IDC_TEAM,15,87,168,17 LTEXT "Zilmar",IDC_ZILMAR,15,108,49,11 LTEXT "founder. Core and application programmer. Web site.",IDC_ZILMAR_DETAILS,69,107,151,24 @@ -889,7 +887,7 @@ END IDB_TRI_STATE BITMAP "Bitmaps\\tri-state.bmp" IDB_LISTITEMS BITMAP "Bitmaps\\ListItems.bmp" -IDB_CLOSE_NORMAL BITMAP "Bitmaps\\CloseNormal.bmp" +IDB_ABOUT_LOGO BITMAP "Bitmaps\\AboutScreenLogo.bmp" IDB_ABOUT_TOP BITMAP "Bitmaps\\AboutScreenTop.bmp" IDB_ABOUT_BOTTOM BITMAP "Bitmaps\\AboutScreenBottom.bmp" IDB_ABOUT_MIDDLE BITMAP "Bitmaps\\AboutScreenMiddle.bmp" diff --git a/Source/Project64/User Interface/resource.h b/Source/Project64/User Interface/resource.h index 42c1d2172..ed3fe6642 100644 --- a/Source/Project64/User Interface/resource.h +++ b/Source/Project64/User Interface/resource.h @@ -34,7 +34,7 @@ #define IDD_Settings_RomBrowser 140 #define IDD_About_UserInfo 141 #define IDD_About_Ini 143 -#define IDB_CLOSE_NORMAL 143 +#define IDB_ABOUT_LOGO 143 #define IDD_Settings_General 144 #define IDB_ABOUT_TOP 144 #define IDD_Settings_Accelerator 145 From 6f74e382816ebdbaa4f26d08393f2f8050006fff Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 9 Nov 2015 19:09:40 -0500 Subject: [PATCH 013/102] Try making Project64.sln UTF-8, not UTF-16 LE. --- Project64.sln | Bin 33434 -> 16720 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Project64.sln b/Project64.sln index 3c73f1127d8bdef38b89f9ec501fb7f6cf077a5d..513cfdcfdf212121e26535b55db23c21ba9f116b 100644 GIT binary patch literal 16720 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 Date: Mon, 9 Nov 2015 19:17:43 -0500 Subject: [PATCH 014/102] [Plugin Specs] Change uint32_t to int32_t (formerly BOOL). --- Source/Project64/Plugins/Controller Plugin.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Project64/Plugins/Controller Plugin.h b/Source/Project64/Plugins/Controller Plugin.h index b8cf32595..2887e5bd2 100644 --- a/Source/Project64/Plugins/Controller Plugin.h +++ b/Source/Project64/Plugins/Controller Plugin.h @@ -45,9 +45,9 @@ typedef union typedef struct { - uint32_t Present; - uint32_t RawData; - int32_t Plugin; + int32_t Present; + int32_t RawData; + int32_t Plugin; } CONTROL; enum PluginType From 67bd22acc2e54e839147c6e99c30fd0a3e53aca9 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Mon, 9 Nov 2015 21:10:47 -0700 Subject: [PATCH 015/102] Create window using DialogBoxParamW --- Source/Project64/User Interface/Gui Class.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 8b46abed9..d708ddb3f 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -149,7 +149,7 @@ void CMainGui::ChangeWinSize(long width, long height) void CMainGui::AboutBox(void) { - DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About), m_hMainWindow, (DLGPROC)AboutBoxProc, (LPARAM)this); + DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_About), m_hMainWindow, (DLGPROC)AboutBoxProc, (LPARAM)this); } void CMainGui::AboutIniBox(void) @@ -984,10 +984,7 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) case WM_INITDIALOG: { //Title - LONG_PTR originalWndProc = GetWindowLongPtrW(hWnd, GWLP_WNDPROC); - SetWindowLongPtrW(hWnd, GWLP_WNDPROC, (LONG_PTR)DefWindowProcW); SetWindowTextW(hWnd, GS(PLUG_ABOUT)); - SetWindowLongPtrW(hWnd, GWLP_WNDPROC, originalWndProc); // Use the size of the image hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_LOGO)); From 26d9339e2c0b7f0250fa643378dbb9b207483751 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Mon, 9 Nov 2015 21:12:48 -0700 Subject: [PATCH 016/102] Remove some dead code This doesn't do anything anymore --- Source/Project64/User Interface/Gui Class.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index d708ddb3f..f3a3d5fa6 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -992,18 +992,6 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) BITMAP bmTL; GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); - if (hbmpBackgroundTop) - { - // int iHeight = bmTL.bmHeight; - int iWidth = bmTL.bmWidth; - - RECT rect; - GetWindowRect(hWnd, &rect); - rect.left -= rect.left; - rect.bottom -= rect.top; - rect.top -= rect.top; - } - hTextFont = ::CreateFont(18, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); hAuthorFont = ::CreateFont(18, 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); From 923f6a485af1a6bb8608be05cb4d2dab0b800c98 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Mon, 9 Nov 2015 22:21:49 -0700 Subject: [PATCH 017/102] "Project 64" -> "Project64" --- Source/Installer/Installer.iss | 10 +++++----- Source/Project64/Logging.cpp | 2 +- Source/Project64/Logging.h | 2 +- Source/Project64/Multilanguage.h | 2 +- Source/Project64/Multilanguage/Language Class.cpp | 2 +- Source/Project64/Multilanguage/Language Class.h | 2 +- Source/Project64/Multilanguage/LanguageSelector.cpp | 2 +- Source/Project64/Multilanguage/LanguageSelector.h | 2 +- Source/Project64/N64 System.h | 2 +- Source/Project64/N64 System/C Core/r4300i Commands.cpp | 2 +- Source/Project64/N64 System/C Core/r4300i Commands.h | 2 +- Source/Project64/N64 System/Cheat Class.cpp | 2 +- Source/Project64/N64 System/Cheat Class.h | 2 +- .../N64 System/Debugger/Debugger - Memory Dump.cpp | 2 +- .../N64 System/Debugger/Debugger - Memory Dump.h | 2 +- .../N64 System/Debugger/Debugger - Memory Search.cpp | 2 +- .../N64 System/Debugger/Debugger - Memory Search.h | 2 +- .../Project64/N64 System/Debugger/Debugger - TLB.cpp | 2 +- Source/Project64/N64 System/Debugger/Debugger - TLB.h | 2 +- .../N64 System/Debugger/Debugger - View Memory.cpp | 2 +- .../N64 System/Debugger/Debugger - View Memory.h | 2 +- Source/Project64/N64 System/Debugger/Debugger.cpp | 2 +- Source/Project64/N64 System/Debugger/debugger.h | 2 +- .../N64 System/Interpreter/Interpreter CPU.cpp | 2 +- .../Project64/N64 System/Interpreter/Interpreter CPU.h | 2 +- .../N64 System/Interpreter/Interpreter Ops 32.cpp | 2 +- .../N64 System/Interpreter/Interpreter Ops 32.h | 2 +- .../N64 System/Interpreter/Interpreter Ops.cpp | 2 +- .../Project64/N64 System/Interpreter/Interpreter Ops.h | 2 +- Source/Project64/N64 System/Mips/Audio.cpp | 2 +- Source/Project64/N64 System/Mips/Audio.h | 2 +- Source/Project64/N64 System/Mips/Dma.cpp | 2 +- Source/Project64/N64 System/Mips/Dma.h | 2 +- Source/Project64/N64 System/Mips/Eeprom.cpp | 2 +- Source/Project64/N64 System/Mips/Eeprom.h | 2 +- Source/Project64/N64 System/Mips/FlashRam.cpp | 2 +- Source/Project64/N64 System/Mips/FlashRam.h | 2 +- Source/Project64/N64 System/Mips/Memory Class.h | 2 +- .../Project64/N64 System/Mips/Memory Labels Class.cpp | 2 +- Source/Project64/N64 System/Mips/Memory Labels Class.h | 2 +- .../Project64/N64 System/Mips/Memory Virtual Mem.cpp | 2 +- Source/Project64/N64 System/Mips/Memory Virtual Mem.h | 2 +- Source/Project64/N64 System/Mips/Mempak.H | 2 +- Source/Project64/N64 System/Mips/Mempak.cpp | 2 +- Source/Project64/N64 System/Mips/OpCode.h | 2 +- Source/Project64/N64 System/Mips/Pif Ram.cpp | 2 +- Source/Project64/N64 System/Mips/Pif Ram.h | 2 +- Source/Project64/N64 System/Mips/Register Class.cpp | 2 +- Source/Project64/N64 System/Mips/Register Class.h | 2 +- Source/Project64/N64 System/Mips/Rumblepak.cpp | 2 +- Source/Project64/N64 System/Mips/Rumblepak.h | 2 +- Source/Project64/N64 System/Mips/Sram.cpp | 2 +- Source/Project64/N64 System/Mips/Sram.h | 2 +- Source/Project64/N64 System/Mips/System Events.cpp | 2 +- Source/Project64/N64 System/Mips/System Events.h | 2 +- Source/Project64/N64 System/Mips/System Timing.cpp | 2 +- Source/Project64/N64 System/Mips/System Timing.h | 2 +- Source/Project64/N64 System/Mips/TLB Class.h | 2 +- Source/Project64/N64 System/Mips/TLB class.cpp | 2 +- Source/Project64/N64 System/Mips/TranslateVaddr.h | 2 +- Source/Project64/N64 System/N64 Class.cpp | 2 +- Source/Project64/N64 System/N64 Class.h | 2 +- Source/Project64/N64 System/N64 Rom Class.cpp | 2 +- Source/Project64/N64 System/N64 Rom Class.h | 2 +- Source/Project64/N64 System/N64 Types.h | 2 +- Source/Project64/N64 System/Profiling Class.cpp | 2 +- Source/Project64/N64 System/Profiling Class.h | 2 +- Source/Project64/N64 System/Recompiler/Code Block.cpp | 2 +- Source/Project64/N64 System/Recompiler/Code Block.h | 2 +- .../Project64/N64 System/Recompiler/Code Section.cpp | 2 +- Source/Project64/N64 System/Recompiler/Code Section.h | 2 +- Source/Project64/N64 System/Recompiler/Exit Info.h | 2 +- .../Project64/N64 System/Recompiler/Function Info.cpp | 2 +- Source/Project64/N64 System/Recompiler/Function Info.h | 2 +- .../N64 System/Recompiler/Function Map Class.cpp | 2 +- .../N64 System/Recompiler/Function Map Class.h | 2 +- Source/Project64/N64 System/Recompiler/Jump Info.h | 2 +- .../Project64/N64 System/Recompiler/Loop Analysis.cpp | 2 +- Source/Project64/N64 System/Recompiler/Loop Analysis.h | 2 +- .../N64 System/Recompiler/Recompiler Class.cpp | 2 +- .../Project64/N64 System/Recompiler/Recompiler Class.h | 2 +- .../N64 System/Recompiler/Recompiler Memory.cpp | 2 +- .../N64 System/Recompiler/Recompiler Memory.h | 2 +- .../Project64/N64 System/Recompiler/Recompiler Ops.cpp | 2 +- .../Project64/N64 System/Recompiler/Recompiler Ops.h | 2 +- Source/Project64/N64 System/Recompiler/Reg Info.cpp | 2 +- Source/Project64/N64 System/Recompiler/Reg Info.h | 2 +- .../Project64/N64 System/Recompiler/Section Info.cpp | 2 +- Source/Project64/N64 System/Recompiler/Section Info.h | 2 +- Source/Project64/N64 System/Recompiler/X86ops.cpp | 2 +- Source/Project64/N64 System/Recompiler/X86ops.h | 2 +- Source/Project64/N64 System/Recompiler/x86CodeLog.cpp | 2 +- Source/Project64/N64 System/Recompiler/x86CodeLog.h | 2 +- Source/Project64/N64 System/Rom Information Class.cpp | 2 +- Source/Project64/N64 System/Rom Information Class.h | 2 +- Source/Project64/N64 System/Speed Limitor Class.cpp | 2 +- Source/Project64/N64 System/Speed Limitor Class.h | 2 +- Source/Project64/N64 System/System Globals.cpp | 2 +- Source/Project64/N64 System/System Globals.h | 2 +- Source/Project64/Plugin.h | 2 +- Source/Project64/Plugins/Audio Plugin.cpp | 2 +- Source/Project64/Plugins/Audio Plugin.h | 2 +- Source/Project64/Plugins/Controller Plugin.cpp | 2 +- Source/Project64/Plugins/Controller Plugin.h | 2 +- Source/Project64/Plugins/GFX plugin.cpp | 2 +- Source/Project64/Plugins/GFX plugin.h | 2 +- Source/Project64/Plugins/Plugin Base.cpp | 2 +- Source/Project64/Plugins/Plugin Base.h | 2 +- Source/Project64/Plugins/Plugin Class.cpp | 2 +- Source/Project64/Plugins/Plugin Class.h | 2 +- Source/Project64/Plugins/Plugin List.cpp | 2 +- Source/Project64/Plugins/RSP Plugin.cpp | 2 +- Source/Project64/Plugins/RSP Plugin.h | 2 +- Source/Project64/Settings.h | 2 +- Source/Project64/Settings/Debug Settings.cpp | 2 +- Source/Project64/Settings/Debug Settings.h | 2 +- Source/Project64/Settings/Game Settings.cpp | 2 +- Source/Project64/Settings/Game Settings.h | 2 +- Source/Project64/Settings/Gui Settings.cpp | 2 +- Source/Project64/Settings/Gui Settings.h | 2 +- Source/Project64/Settings/N64System Settings.cpp | 2 +- Source/Project64/Settings/N64System Settings.h | 2 +- Source/Project64/Settings/Notification Settings.cpp | 2 +- Source/Project64/Settings/Notification Settings.h | 2 +- Source/Project64/Settings/Recompiler Settings.cpp | 2 +- Source/Project64/Settings/Recompiler Settings.h | 2 +- .../Settings/SettingType/SettingsType-Application.cpp | 2 +- .../Settings/SettingType/SettingsType-Application.h | 2 +- .../SettingType/SettingsType-ApplicationIndex.cpp | 2 +- .../SettingType/SettingsType-ApplicationIndex.h | 2 +- .../SettingType/SettingsType-ApplicationPath.cpp | 2 +- .../SettingType/SettingsType-ApplicationPath.h | 2 +- .../Project64/Settings/SettingType/SettingsType-Base.h | 2 +- .../Settings/SettingType/SettingsType-Cheats.cpp | 2 +- .../Settings/SettingType/SettingsType-Cheats.h | 2 +- .../Settings/SettingType/SettingsType-GameSetting.cpp | 2 +- .../Settings/SettingType/SettingsType-GameSetting.h | 2 +- .../SettingType/SettingsType-GameSettingIndex.cpp | 2 +- .../SettingType/SettingsType-GameSettingIndex.h | 2 +- .../Settings/SettingType/SettingsType-RDBCpuType.cpp | 2 +- .../Settings/SettingType/SettingsType-RDBCpuType.h | 2 +- .../Settings/SettingType/SettingsType-RDBOnOff.cpp | 2 +- .../Settings/SettingType/SettingsType-RDBOnOff.h | 2 +- .../Settings/SettingType/SettingsType-RDBRamSize.cpp | 2 +- .../Settings/SettingType/SettingsType-RDBRamSize.h | 2 +- .../Settings/SettingType/SettingsType-RDBSaveChip.cpp | 2 +- .../Settings/SettingType/SettingsType-RDBSaveChip.h | 2 +- .../Settings/SettingType/SettingsType-RDBYesNo.cpp | 2 +- .../Settings/SettingType/SettingsType-RDBYesNo.h | 2 +- .../Settings/SettingType/SettingsType-RelativePath.cpp | 2 +- .../Settings/SettingType/SettingsType-RelativePath.h | 2 +- .../Settings/SettingType/SettingsType-RomDatabase.cpp | 2 +- .../Settings/SettingType/SettingsType-RomDatabase.h | 2 +- .../SettingType/SettingsType-RomDatabaseIndex.cpp | 2 +- .../SettingType/SettingsType-RomDatabaseIndex.h | 2 +- .../SettingType/SettingsType-RomDatabaseSetting.cpp | 2 +- .../SettingType/SettingsType-RomDatabaseSetting.h | 2 +- .../SettingType/SettingsType-SelectedDirectory.cpp | 2 +- .../SettingType/SettingsType-SelectedDirectory.h | 2 +- .../Settings/SettingType/SettingsType-TempBool.cpp | 2 +- .../Settings/SettingType/SettingsType-TempBool.h | 2 +- .../Settings/SettingType/SettingsType-TempNumber.cpp | 2 +- .../Settings/SettingType/SettingsType-TempNumber.h | 2 +- .../Settings/SettingType/SettingsType-TempString.cpp | 2 +- .../Settings/SettingType/SettingsType-TempString.h | 2 +- Source/Project64/Settings/Settings Class.cpp | 2 +- Source/Project64/Settings/Settings Class.h | 2 +- Source/Project64/User Interface.h | 2 +- Source/Project64/User Interface/Cheat Class UI.cpp | 2 +- Source/Project64/User Interface/Cheat Class UI.h | 2 +- .../User Interface/Frame Per Second Class.cpp | 2 +- .../Project64/User Interface/Frame Per Second Class.h | 2 +- Source/Project64/User Interface/Gui Class.cpp | 2 +- Source/Project64/User Interface/Gui Class.h | 2 +- Source/Project64/User Interface/Menu Class.h | 2 +- Source/Project64/User Interface/MenuShortCuts.h | 2 +- Source/Project64/User Interface/Notification Class.h | 2 +- Source/Project64/User Interface/Rom Browser.h | 2 +- .../Settings/Settings Page - Advanced Options.cpp | 2 +- .../Settings/Settings Page - Advanced Options.h | 2 +- .../Settings/Settings Page - Directories.cpp | 2 +- .../Settings/Settings Page - Directories.h | 2 +- .../Settings/Settings Page - Game - General.cpp | 2 +- .../Settings/Settings Page - Game - General.h | 2 +- .../Settings/Settings Page - Game - Plugin.cpp | 2 +- .../Settings/Settings Page - Game - Plugin.h | 2 +- .../Settings/Settings Page - Game - Recompiler.cpp | 2 +- .../Settings/Settings Page - Game - Recompiler.h | 2 +- .../Settings/Settings Page - Game - Status.cpp | 2 +- .../Settings/Settings Page - Game - Status.h | 2 +- .../Settings/Settings Page - Game Browser.cpp | 2 +- .../Settings/Settings Page - Game Browser.h | 2 +- .../Settings/Settings Page - Keyboard Shortcuts.cpp | 2 +- .../Settings/Settings Page - Keyboard Shortcuts.h | 2 +- .../Settings/Settings Page - Options.cpp | 2 +- .../User Interface/Settings/Settings Page - Options.h | 2 +- .../User Interface/Settings/Settings Page - Plugin.cpp | 2 +- .../User Interface/Settings/Settings Page - Plugin.h | 2 +- .../User Interface/Settings/Settings Page.cpp | 2 +- .../Project64/User Interface/Settings/Settings Page.h | 2 +- Source/Project64/User Interface/UI Resources.rc | 2 +- .../User Interface/WTL Controls/ModifiedCheckBox.h | 2 +- .../User Interface/WTL Controls/ModifiedComboBox.h | 2 +- .../User Interface/WTL Controls/ModifiedEditBox.cpp | 2 +- .../User Interface/WTL Controls/ModifiedEditBox.h | 2 +- .../User Interface/WTL Controls/PartialGroupBox.cpp | 2 +- .../User Interface/WTL Controls/PartialGroupBox.h | 2 +- .../Project64/User Interface/WTL Controls/numberctrl.h | 2 +- Source/Project64/Version.h | 4 ++-- Source/Project64/WTL App.h | 2 +- Source/Project64/stdafx.h | 2 +- Source/RSP/Cpu.c | 2 +- Source/RSP/Cpu.h | 2 +- Source/RSP/Interpreter CPU.c | 2 +- Source/RSP/Interpreter CPU.h | 2 +- Source/RSP/Interpreter Ops.c | 2 +- Source/RSP/Interpreter Ops.h | 2 +- Source/RSP/Main.cpp | 2 +- Source/RSP/Mmx.c | 2 +- Source/RSP/OpCode.h | 2 +- Source/RSP/Profiling.cpp | 2 +- Source/RSP/Profiling.h | 2 +- Source/RSP/RSP Command.c | 2 +- Source/RSP/RSP Command.h | 2 +- Source/RSP/RSP Register.c | 2 +- Source/RSP/RSP Registers.h | 2 +- Source/RSP/Recompiler Analysis.c | 2 +- Source/RSP/Recompiler CPU.c | 2 +- Source/RSP/Recompiler CPU.h | 2 +- Source/RSP/Recompiler Ops.c | 2 +- Source/RSP/Recompiler Ops.h | 2 +- Source/RSP/Recompiler Sections.c | 2 +- Source/RSP/Rsp.h | 2 +- Source/RSP/Sse.c | 2 +- Source/RSP/Types.h | 2 +- Source/RSP/Version.h | 2 +- Source/RSP/X86.c | 2 +- Source/RSP/X86.h | 2 +- Source/RSP/breakpoint.c | 2 +- Source/RSP/breakpoint.h | 2 +- Source/RSP/dma.c | 2 +- Source/RSP/dma.h | 2 +- Source/RSP/log.cpp | 2 +- Source/RSP/log.h | 2 +- Source/RSP/memory.c | 2 +- Source/RSP/memory.h | 2 +- 246 files changed, 251 insertions(+), 251 deletions(-) diff --git a/Source/Installer/Installer.iss b/Source/Installer/Installer.iss index b212f81fa..64e5d21df 100644 --- a/Source/Installer/Installer.iss +++ b/Source/Installer/Installer.iss @@ -5,7 +5,7 @@ [Setup] AppId={{BEB5FB69-4080-466F-96C4-F15DF271718B} -AppName=Project 64 +AppName=Project64 AppVersion={#AppVersion} DefaultDirName={pf}\Project64 2.2 VersionInfoVersion={#AppVersion} @@ -21,7 +21,7 @@ UninstallDisplayIcon={uninstallexe} SetupIconFile={#BaseDir}\Source\Project64\User Interface\Icons\pj64.ico [Run] -Filename: "{app}\Project64.exe"; Description: "{cm:LaunchProgram,{#StringChange('Project 64', '&', '&&')}}"; Flags: nowait postinstall skipifsilent +Filename: "{app}\Project64.exe"; Description: "{cm:LaunchProgram,{#StringChange('Project64', '&', '&&')}}"; Flags: nowait postinstall skipifsilent [Files] Source: "{#BaseDir}\Bin\{#Configuration}\Project64.exe"; DestDir: "{app}"; Flags: ignoreversion @@ -44,9 +44,9 @@ Name: "{app}\Screenshots"; Permissions: users-modify Name: "{app}\Textures"; Permissions: users-modify [Icons] -Name: "{commonprograms}\Project 64 2.2\Project 64"; Filename: "{app}\Project64.exe" -Name: "{commonprograms}\Project 64 2.2\Uninstall Project64 2.2"; Filename: "{uninstallexe}"; Parameters: "/LOG" -Name: "{commonprograms}\Project 64 2.2\Support"; Filename: "http://forum.pj64-emu.com" +Name: "{commonprograms}\Project64 2.2\Project64"; Filename: "{app}\Project64.exe" +Name: "{commonprograms}\Project64 2.2\Uninstall Project64 2.2"; Filename: "{uninstallexe}"; Parameters: "/LOG" +Name: "{commonprograms}\Project64 2.2\Support"; Filename: "http://forum.pj64-emu.com" [Code] function HaveCommandlineParam (inParam: String): Boolean; diff --git a/Source/Project64/Logging.cpp b/Source/Project64/Logging.cpp index 5f22e34ee..cb4a5ac33 100644 --- a/Source/Project64/Logging.cpp +++ b/Source/Project64/Logging.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Logging.h b/Source/Project64/Logging.h index c36aba4d4..9d2f34138 100644 --- a/Source/Project64/Logging.h +++ b/Source/Project64/Logging.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Multilanguage.h b/Source/Project64/Multilanguage.h index d0cf68ff3..910540d8a 100644 --- a/Source/Project64/Multilanguage.h +++ b/Source/Project64/Multilanguage.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Multilanguage/Language Class.cpp b/Source/Project64/Multilanguage/Language Class.cpp index dab71accb..e2f3d5855 100644 --- a/Source/Project64/Multilanguage/Language Class.cpp +++ b/Source/Project64/Multilanguage/Language Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Multilanguage/Language Class.h b/Source/Project64/Multilanguage/Language Class.h index 50cb67be1..19538d67b 100644 --- a/Source/Project64/Multilanguage/Language Class.h +++ b/Source/Project64/Multilanguage/Language Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Multilanguage/LanguageSelector.cpp b/Source/Project64/Multilanguage/LanguageSelector.cpp index e317d6b8b..5a93b00ea 100644 --- a/Source/Project64/Multilanguage/LanguageSelector.cpp +++ b/Source/Project64/Multilanguage/LanguageSelector.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Multilanguage/LanguageSelector.h b/Source/Project64/Multilanguage/LanguageSelector.h index bb88af757..5856c22ff 100644 --- a/Source/Project64/Multilanguage/LanguageSelector.h +++ b/Source/Project64/Multilanguage/LanguageSelector.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System.h b/Source/Project64/N64 System.h index 017ff868c..461cfca60 100644 --- a/Source/Project64/N64 System.h +++ b/Source/Project64/N64 System.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/C Core/r4300i Commands.cpp b/Source/Project64/N64 System/C Core/r4300i Commands.cpp index 9b01fd1f7..36e9049aa 100644 --- a/Source/Project64/N64 System/C Core/r4300i Commands.cpp +++ b/Source/Project64/N64 System/C Core/r4300i Commands.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/C Core/r4300i Commands.h b/Source/Project64/N64 System/C Core/r4300i Commands.h index 5f3a207c7..7390b9dea 100644 --- a/Source/Project64/N64 System/C Core/r4300i Commands.h +++ b/Source/Project64/N64 System/C Core/r4300i Commands.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Cheat Class.cpp b/Source/Project64/N64 System/Cheat Class.cpp index db795f744..65a6b6e1b 100644 --- a/Source/Project64/N64 System/Cheat Class.cpp +++ b/Source/Project64/N64 System/Cheat Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Cheat Class.h b/Source/Project64/N64 System/Cheat Class.h index a4416fc7c..5734a2cf1 100644 --- a/Source/Project64/N64 System/Cheat Class.h +++ b/Source/Project64/N64 System/Cheat Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp b/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp index 5921c429a..3aedc600d 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.h b/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.h index 274b997ce..3cc97858f 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.h +++ b/Source/Project64/N64 System/Debugger/Debugger - Memory Dump.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp b/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp index 0672dfb9f..aaa9cf7eb 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - Memory Search.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - Memory Search.h b/Source/Project64/N64 System/Debugger/Debugger - Memory Search.h index 478684269..9e7127a04 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - Memory Search.h +++ b/Source/Project64/N64 System/Debugger/Debugger - Memory Search.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp b/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp index d68f704ca..100a1f846 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - TLB.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - TLB.h b/Source/Project64/N64 System/Debugger/Debugger - TLB.h index 2588b1f67..5039d1ca5 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - TLB.h +++ b/Source/Project64/N64 System/Debugger/Debugger - TLB.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp b/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp index 8c577ab73..941c5c9d4 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger - View Memory.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger - View Memory.h b/Source/Project64/N64 System/Debugger/Debugger - View Memory.h index 4c48ad5b6..f90cb3507 100644 --- a/Source/Project64/N64 System/Debugger/Debugger - View Memory.h +++ b/Source/Project64/N64 System/Debugger/Debugger - View Memory.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/Debugger.cpp b/Source/Project64/N64 System/Debugger/Debugger.cpp index 433b7bf97..fa22d0dd3 100644 --- a/Source/Project64/N64 System/Debugger/Debugger.cpp +++ b/Source/Project64/N64 System/Debugger/Debugger.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Debugger/debugger.h b/Source/Project64/N64 System/Debugger/debugger.h index e8e48f1c0..568c3f89f 100644 --- a/Source/Project64/N64 System/Debugger/debugger.h +++ b/Source/Project64/N64 System/Debugger/debugger.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp index 0bd568b59..c56be2342 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Interpreter/Interpreter CPU.h b/Source/Project64/N64 System/Interpreter/Interpreter CPU.h index 8283f56ac..196c60612 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter CPU.h +++ b/Source/Project64/N64 System/Interpreter/Interpreter CPU.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp index f168b946d..339a208e3 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.h b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.h index 23a3965ed..f92d229ef 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.h +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp index 250893e37..1282ed151 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.h b/Source/Project64/N64 System/Interpreter/Interpreter Ops.h index 909a0acad..6c9b6484c 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.h +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Audio.cpp b/Source/Project64/N64 System/Mips/Audio.cpp index 06b7ec67b..fbe7dbb52 100644 --- a/Source/Project64/N64 System/Mips/Audio.cpp +++ b/Source/Project64/N64 System/Mips/Audio.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Audio.h b/Source/Project64/N64 System/Mips/Audio.h index 51a50ae17..6f66896d4 100644 --- a/Source/Project64/N64 System/Mips/Audio.h +++ b/Source/Project64/N64 System/Mips/Audio.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Dma.cpp b/Source/Project64/N64 System/Mips/Dma.cpp index 478e31b78..092e8e458 100644 --- a/Source/Project64/N64 System/Mips/Dma.cpp +++ b/Source/Project64/N64 System/Mips/Dma.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Dma.h b/Source/Project64/N64 System/Mips/Dma.h index a05c35e96..635e2596e 100644 --- a/Source/Project64/N64 System/Mips/Dma.h +++ b/Source/Project64/N64 System/Mips/Dma.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Eeprom.cpp b/Source/Project64/N64 System/Mips/Eeprom.cpp index 0dfa07c54..0e74ec3e9 100644 --- a/Source/Project64/N64 System/Mips/Eeprom.cpp +++ b/Source/Project64/N64 System/Mips/Eeprom.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Eeprom.h b/Source/Project64/N64 System/Mips/Eeprom.h index 34bd246ae..fe739445b 100644 --- a/Source/Project64/N64 System/Mips/Eeprom.h +++ b/Source/Project64/N64 System/Mips/Eeprom.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/FlashRam.cpp b/Source/Project64/N64 System/Mips/FlashRam.cpp index 19644dc24..e54bdb7b8 100644 --- a/Source/Project64/N64 System/Mips/FlashRam.cpp +++ b/Source/Project64/N64 System/Mips/FlashRam.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/FlashRam.h b/Source/Project64/N64 System/Mips/FlashRam.h index e3238b9fe..5c982c996 100644 --- a/Source/Project64/N64 System/Mips/FlashRam.h +++ b/Source/Project64/N64 System/Mips/FlashRam.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Memory Class.h b/Source/Project64/N64 System/Mips/Memory Class.h index 73579140a..8de1b2865 100644 --- a/Source/Project64/N64 System/Mips/Memory Class.h +++ b/Source/Project64/N64 System/Mips/Memory Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp index 1047a7c67..3158798fd 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.cpp +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Memory Labels Class.h b/Source/Project64/N64 System/Mips/Memory Labels Class.h index df1bcdb7a..559c04721 100644 --- a/Source/Project64/N64 System/Mips/Memory Labels Class.h +++ b/Source/Project64/N64 System/Mips/Memory Labels Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 1d5b05df3..1f8a415b5 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h index 000056827..069b393ca 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.h +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Mempak.H b/Source/Project64/N64 System/Mips/Mempak.H index 650b466c3..711fc640e 100644 --- a/Source/Project64/N64 System/Mips/Mempak.H +++ b/Source/Project64/N64 System/Mips/Mempak.H @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Mempak.cpp b/Source/Project64/N64 System/Mips/Mempak.cpp index 83470cc43..7fa9a8905 100644 --- a/Source/Project64/N64 System/Mips/Mempak.cpp +++ b/Source/Project64/N64 System/Mips/Mempak.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/OpCode.h b/Source/Project64/N64 System/Mips/OpCode.h index f764cfcf3..30585894e 100644 --- a/Source/Project64/N64 System/Mips/OpCode.h +++ b/Source/Project64/N64 System/Mips/OpCode.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index 7a4bfa37b..b732877be 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Pif Ram.h b/Source/Project64/N64 System/Mips/Pif Ram.h index dcacf494f..9cc1fdc42 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.h +++ b/Source/Project64/N64 System/Mips/Pif Ram.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Register Class.cpp b/Source/Project64/N64 System/Mips/Register Class.cpp index 6d12cc6cc..7983bb7c3 100644 --- a/Source/Project64/N64 System/Mips/Register Class.cpp +++ b/Source/Project64/N64 System/Mips/Register Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Register Class.h b/Source/Project64/N64 System/Mips/Register Class.h index 7e66deaae..c2715c579 100644 --- a/Source/Project64/N64 System/Mips/Register Class.h +++ b/Source/Project64/N64 System/Mips/Register Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Rumblepak.cpp b/Source/Project64/N64 System/Mips/Rumblepak.cpp index 51051cc6d..856a3aa86 100644 --- a/Source/Project64/N64 System/Mips/Rumblepak.cpp +++ b/Source/Project64/N64 System/Mips/Rumblepak.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Rumblepak.h b/Source/Project64/N64 System/Mips/Rumblepak.h index 73b476c15..55308dc8e 100644 --- a/Source/Project64/N64 System/Mips/Rumblepak.h +++ b/Source/Project64/N64 System/Mips/Rumblepak.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Sram.cpp b/Source/Project64/N64 System/Mips/Sram.cpp index d1f588691..45dd2817f 100644 --- a/Source/Project64/N64 System/Mips/Sram.cpp +++ b/Source/Project64/N64 System/Mips/Sram.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/Sram.h b/Source/Project64/N64 System/Mips/Sram.h index 1b9c9f32c..513a49ad3 100644 --- a/Source/Project64/N64 System/Mips/Sram.h +++ b/Source/Project64/N64 System/Mips/Sram.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/System Events.cpp b/Source/Project64/N64 System/Mips/System Events.cpp index 67e8334e3..590b05fb6 100644 --- a/Source/Project64/N64 System/Mips/System Events.cpp +++ b/Source/Project64/N64 System/Mips/System Events.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/System Events.h b/Source/Project64/N64 System/Mips/System Events.h index de868c75c..3b7101bb9 100644 --- a/Source/Project64/N64 System/Mips/System Events.h +++ b/Source/Project64/N64 System/Mips/System Events.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/System Timing.cpp b/Source/Project64/N64 System/Mips/System Timing.cpp index 82f23388a..681de9245 100644 --- a/Source/Project64/N64 System/Mips/System Timing.cpp +++ b/Source/Project64/N64 System/Mips/System Timing.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/System Timing.h b/Source/Project64/N64 System/Mips/System Timing.h index 74da3abc6..ab6c84633 100644 --- a/Source/Project64/N64 System/Mips/System Timing.h +++ b/Source/Project64/N64 System/Mips/System Timing.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/TLB Class.h b/Source/Project64/N64 System/Mips/TLB Class.h index d1a535fc8..7926b99e8 100644 --- a/Source/Project64/N64 System/Mips/TLB Class.h +++ b/Source/Project64/N64 System/Mips/TLB Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/TLB class.cpp b/Source/Project64/N64 System/Mips/TLB class.cpp index 4ae8b4d25..3af3da5b6 100644 --- a/Source/Project64/N64 System/Mips/TLB class.cpp +++ b/Source/Project64/N64 System/Mips/TLB class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Mips/TranslateVaddr.h b/Source/Project64/N64 System/Mips/TranslateVaddr.h index 679158c4e..4e9ea8340 100644 --- a/Source/Project64/N64 System/Mips/TranslateVaddr.h +++ b/Source/Project64/N64 System/Mips/TranslateVaddr.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index e8539ae97..73013aa41 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index bad891662..79971522a 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/N64 Rom Class.cpp b/Source/Project64/N64 System/N64 Rom Class.cpp index dd2569dc3..00d013eeb 100644 --- a/Source/Project64/N64 System/N64 Rom Class.cpp +++ b/Source/Project64/N64 System/N64 Rom Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/N64 Rom Class.h b/Source/Project64/N64 System/N64 Rom Class.h index 363add814..b576a68c1 100644 --- a/Source/Project64/N64 System/N64 Rom Class.h +++ b/Source/Project64/N64 System/N64 Rom Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/N64 Types.h b/Source/Project64/N64 System/N64 Types.h index 791cd9e3e..f892557d9 100644 --- a/Source/Project64/N64 System/N64 Types.h +++ b/Source/Project64/N64 System/N64 Types.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Profiling Class.cpp b/Source/Project64/N64 System/Profiling Class.cpp index 367ba545f..421b9320b 100644 --- a/Source/Project64/N64 System/Profiling Class.cpp +++ b/Source/Project64/N64 System/Profiling Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Profiling Class.h b/Source/Project64/N64 System/Profiling Class.h index 4e1221a86..0bf5d392e 100644 --- a/Source/Project64/N64 System/Profiling Class.h +++ b/Source/Project64/N64 System/Profiling Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Code Block.cpp b/Source/Project64/N64 System/Recompiler/Code Block.cpp index c618bf89d..d5712dc48 100644 --- a/Source/Project64/N64 System/Recompiler/Code Block.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Block.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Code Block.h b/Source/Project64/N64 System/Recompiler/Code Block.h index 7999b7691..8fbf4e5fa 100644 --- a/Source/Project64/N64 System/Recompiler/Code Block.h +++ b/Source/Project64/N64 System/Recompiler/Code Block.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Code Section.cpp b/Source/Project64/N64 System/Recompiler/Code Section.cpp index d176ff6b3..cc3128e58 100644 --- a/Source/Project64/N64 System/Recompiler/Code Section.cpp +++ b/Source/Project64/N64 System/Recompiler/Code Section.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Code Section.h b/Source/Project64/N64 System/Recompiler/Code Section.h index 236a78e7d..1e192d60f 100644 --- a/Source/Project64/N64 System/Recompiler/Code Section.h +++ b/Source/Project64/N64 System/Recompiler/Code Section.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Exit Info.h b/Source/Project64/N64 System/Recompiler/Exit Info.h index bf7dbfdc0..6e3e5a40c 100644 --- a/Source/Project64/N64 System/Recompiler/Exit Info.h +++ b/Source/Project64/N64 System/Recompiler/Exit Info.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Function Info.cpp b/Source/Project64/N64 System/Recompiler/Function Info.cpp index 2721ec1aa..2eac26329 100644 --- a/Source/Project64/N64 System/Recompiler/Function Info.cpp +++ b/Source/Project64/N64 System/Recompiler/Function Info.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Function Info.h b/Source/Project64/N64 System/Recompiler/Function Info.h index 0aaa2d960..f930b196f 100644 --- a/Source/Project64/N64 System/Recompiler/Function Info.h +++ b/Source/Project64/N64 System/Recompiler/Function Info.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Function Map Class.cpp b/Source/Project64/N64 System/Recompiler/Function Map Class.cpp index a76fc1901..942437040 100644 --- a/Source/Project64/N64 System/Recompiler/Function Map Class.cpp +++ b/Source/Project64/N64 System/Recompiler/Function Map Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Function Map Class.h b/Source/Project64/N64 System/Recompiler/Function Map Class.h index 49ad9c679..2abef6e36 100644 --- a/Source/Project64/N64 System/Recompiler/Function Map Class.h +++ b/Source/Project64/N64 System/Recompiler/Function Map Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Jump Info.h b/Source/Project64/N64 System/Recompiler/Jump Info.h index 9effed90e..b8e14c215 100644 --- a/Source/Project64/N64 System/Recompiler/Jump Info.h +++ b/Source/Project64/N64 System/Recompiler/Jump Info.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp b/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp index bdf61c8e8..6a5b14f4e 100644 --- a/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp +++ b/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Loop Analysis.h b/Source/Project64/N64 System/Recompiler/Loop Analysis.h index b840571b9..30afffa81 100644 --- a/Source/Project64/N64 System/Recompiler/Loop Analysis.h +++ b/Source/Project64/N64 System/Recompiler/Loop Analysis.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp index e3c578a8d..4849ed253 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Class.h b/Source/Project64/N64 System/Recompiler/Recompiler Class.h index 4e7e59eda..cc317e3f8 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Class.h +++ b/Source/Project64/N64 System/Recompiler/Recompiler Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Memory.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Memory.cpp index be4b9040a..c8a00419b 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Memory.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Memory.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Memory.h b/Source/Project64/N64 System/Recompiler/Recompiler Memory.h index 092a248c1..bff2a26e1 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Memory.h +++ b/Source/Project64/N64 System/Recompiler/Recompiler Memory.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index cfe6d5e67..a326a5da7 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h index 594097211..e7cce48a6 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Reg Info.cpp b/Source/Project64/N64 System/Recompiler/Reg Info.cpp index 071e5b530..3bde33a10 100644 --- a/Source/Project64/N64 System/Recompiler/Reg Info.cpp +++ b/Source/Project64/N64 System/Recompiler/Reg Info.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Reg Info.h b/Source/Project64/N64 System/Recompiler/Reg Info.h index d9ae33d63..5ed26b813 100644 --- a/Source/Project64/N64 System/Recompiler/Reg Info.h +++ b/Source/Project64/N64 System/Recompiler/Reg Info.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Section Info.cpp b/Source/Project64/N64 System/Recompiler/Section Info.cpp index 3bc75b8a4..a497e4b47 100644 --- a/Source/Project64/N64 System/Recompiler/Section Info.cpp +++ b/Source/Project64/N64 System/Recompiler/Section Info.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/Section Info.h b/Source/Project64/N64 System/Recompiler/Section Info.h index e67f665c0..0a1788dad 100644 --- a/Source/Project64/N64 System/Recompiler/Section Info.h +++ b/Source/Project64/N64 System/Recompiler/Section Info.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/X86ops.cpp b/Source/Project64/N64 System/Recompiler/X86ops.cpp index cdc2a8c95..f2239b028 100644 --- a/Source/Project64/N64 System/Recompiler/X86ops.cpp +++ b/Source/Project64/N64 System/Recompiler/X86ops.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/X86ops.h b/Source/Project64/N64 System/Recompiler/X86ops.h index 937e53f9d..d5f2172a9 100644 --- a/Source/Project64/N64 System/Recompiler/X86ops.h +++ b/Source/Project64/N64 System/Recompiler/X86ops.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp b/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp index c59730b78..870e1baf6 100644 --- a/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp +++ b/Source/Project64/N64 System/Recompiler/x86CodeLog.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Recompiler/x86CodeLog.h b/Source/Project64/N64 System/Recompiler/x86CodeLog.h index 3512675cb..03784d109 100644 --- a/Source/Project64/N64 System/Recompiler/x86CodeLog.h +++ b/Source/Project64/N64 System/Recompiler/x86CodeLog.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Rom Information Class.cpp b/Source/Project64/N64 System/Rom Information Class.cpp index 6eca5542a..d2c80225e 100644 --- a/Source/Project64/N64 System/Rom Information Class.cpp +++ b/Source/Project64/N64 System/Rom Information Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Rom Information Class.h b/Source/Project64/N64 System/Rom Information Class.h index e4be02d00..6ec536cac 100644 --- a/Source/Project64/N64 System/Rom Information Class.h +++ b/Source/Project64/N64 System/Rom Information Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Speed Limitor Class.cpp b/Source/Project64/N64 System/Speed Limitor Class.cpp index 03b7fa13b..061da0766 100644 --- a/Source/Project64/N64 System/Speed Limitor Class.cpp +++ b/Source/Project64/N64 System/Speed Limitor Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/Speed Limitor Class.h b/Source/Project64/N64 System/Speed Limitor Class.h index 301d8221f..375d6bd82 100644 --- a/Source/Project64/N64 System/Speed Limitor Class.h +++ b/Source/Project64/N64 System/Speed Limitor Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/System Globals.cpp b/Source/Project64/N64 System/System Globals.cpp index 0d88ceb51..64aae0e7c 100644 --- a/Source/Project64/N64 System/System Globals.cpp +++ b/Source/Project64/N64 System/System Globals.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/N64 System/System Globals.h b/Source/Project64/N64 System/System Globals.h index 803f8d401..a63350de3 100644 --- a/Source/Project64/N64 System/System Globals.h +++ b/Source/Project64/N64 System/System Globals.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugin.h b/Source/Project64/Plugin.h index e6130b2e9..3c684ab5d 100644 --- a/Source/Project64/Plugin.h +++ b/Source/Project64/Plugin.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Audio Plugin.cpp b/Source/Project64/Plugins/Audio Plugin.cpp index bed736a61..618fcee12 100644 --- a/Source/Project64/Plugins/Audio Plugin.cpp +++ b/Source/Project64/Plugins/Audio Plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Audio Plugin.h b/Source/Project64/Plugins/Audio Plugin.h index a6bd03c66..bd53392d4 100644 --- a/Source/Project64/Plugins/Audio Plugin.h +++ b/Source/Project64/Plugins/Audio Plugin.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Controller Plugin.cpp b/Source/Project64/Plugins/Controller Plugin.cpp index 8b399bace..7da456458 100644 --- a/Source/Project64/Plugins/Controller Plugin.cpp +++ b/Source/Project64/Plugins/Controller Plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Controller Plugin.h b/Source/Project64/Plugins/Controller Plugin.h index 2887e5bd2..eadd678c8 100644 --- a/Source/Project64/Plugins/Controller Plugin.h +++ b/Source/Project64/Plugins/Controller Plugin.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/GFX plugin.cpp b/Source/Project64/Plugins/GFX plugin.cpp index a25ba07bb..b08397a3f 100644 --- a/Source/Project64/Plugins/GFX plugin.cpp +++ b/Source/Project64/Plugins/GFX plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/GFX plugin.h b/Source/Project64/Plugins/GFX plugin.h index 01f3b71c0..8f5f7a4d4 100644 --- a/Source/Project64/Plugins/GFX plugin.h +++ b/Source/Project64/Plugins/GFX plugin.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Plugin Base.cpp b/Source/Project64/Plugins/Plugin Base.cpp index 0ff04e27b..3f3f8df09 100644 --- a/Source/Project64/Plugins/Plugin Base.cpp +++ b/Source/Project64/Plugins/Plugin Base.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Plugin Base.h b/Source/Project64/Plugins/Plugin Base.h index 4eb295d4f..eaf5dcd01 100644 --- a/Source/Project64/Plugins/Plugin Base.h +++ b/Source/Project64/Plugins/Plugin Base.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Plugin Class.cpp b/Source/Project64/Plugins/Plugin Class.cpp index 6dfccc915..30a5d291d 100644 --- a/Source/Project64/Plugins/Plugin Class.cpp +++ b/Source/Project64/Plugins/Plugin Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Plugin Class.h b/Source/Project64/Plugins/Plugin Class.h index 51deb2127..21c761293 100644 --- a/Source/Project64/Plugins/Plugin Class.h +++ b/Source/Project64/Plugins/Plugin Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/Plugin List.cpp b/Source/Project64/Plugins/Plugin List.cpp index dd1412d89..244492e76 100644 --- a/Source/Project64/Plugins/Plugin List.cpp +++ b/Source/Project64/Plugins/Plugin List.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/RSP Plugin.cpp b/Source/Project64/Plugins/RSP Plugin.cpp index b33d3d03d..2a992013d 100644 --- a/Source/Project64/Plugins/RSP Plugin.cpp +++ b/Source/Project64/Plugins/RSP Plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Plugins/RSP Plugin.h b/Source/Project64/Plugins/RSP Plugin.h index ef20275bf..72d1f7297 100644 --- a/Source/Project64/Plugins/RSP Plugin.h +++ b/Source/Project64/Plugins/RSP Plugin.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings.h b/Source/Project64/Settings.h index 869efbfa6..f4d74296b 100644 --- a/Source/Project64/Settings.h +++ b/Source/Project64/Settings.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Debug Settings.cpp b/Source/Project64/Settings/Debug Settings.cpp index 76110b9f2..dd9390966 100644 --- a/Source/Project64/Settings/Debug Settings.cpp +++ b/Source/Project64/Settings/Debug Settings.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Debug Settings.h b/Source/Project64/Settings/Debug Settings.h index 79a17c317..77a3283ff 100644 --- a/Source/Project64/Settings/Debug Settings.h +++ b/Source/Project64/Settings/Debug Settings.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Game Settings.cpp b/Source/Project64/Settings/Game Settings.cpp index af2ffdc57..8dc1d2e05 100644 --- a/Source/Project64/Settings/Game Settings.cpp +++ b/Source/Project64/Settings/Game Settings.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Game Settings.h b/Source/Project64/Settings/Game Settings.h index 44690d25f..f898dde78 100644 --- a/Source/Project64/Settings/Game Settings.h +++ b/Source/Project64/Settings/Game Settings.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Gui Settings.cpp b/Source/Project64/Settings/Gui Settings.cpp index 79b19c14e..9eca59014 100644 --- a/Source/Project64/Settings/Gui Settings.cpp +++ b/Source/Project64/Settings/Gui Settings.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Gui Settings.h b/Source/Project64/Settings/Gui Settings.h index 4e7fa4178..78c76326d 100644 --- a/Source/Project64/Settings/Gui Settings.h +++ b/Source/Project64/Settings/Gui Settings.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/N64System Settings.cpp b/Source/Project64/Settings/N64System Settings.cpp index 3c7b58f54..63bb1925d 100644 --- a/Source/Project64/Settings/N64System Settings.cpp +++ b/Source/Project64/Settings/N64System Settings.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/N64System Settings.h b/Source/Project64/Settings/N64System Settings.h index 73cf60dcf..1016d71b5 100644 --- a/Source/Project64/Settings/N64System Settings.h +++ b/Source/Project64/Settings/N64System Settings.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Notification Settings.cpp b/Source/Project64/Settings/Notification Settings.cpp index dad717a84..61ecf1ab5 100644 --- a/Source/Project64/Settings/Notification Settings.cpp +++ b/Source/Project64/Settings/Notification Settings.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Notification Settings.h b/Source/Project64/Settings/Notification Settings.h index 5e75da155..c7ad0dcac 100644 --- a/Source/Project64/Settings/Notification Settings.h +++ b/Source/Project64/Settings/Notification Settings.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Recompiler Settings.cpp b/Source/Project64/Settings/Recompiler Settings.cpp index b4dd56783..095d9d8d6 100644 --- a/Source/Project64/Settings/Recompiler Settings.cpp +++ b/Source/Project64/Settings/Recompiler Settings.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Recompiler Settings.h b/Source/Project64/Settings/Recompiler Settings.h index aedbd6c9f..b90d921f3 100644 --- a/Source/Project64/Settings/Recompiler Settings.h +++ b/Source/Project64/Settings/Recompiler Settings.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-Application.cpp b/Source/Project64/Settings/SettingType/SettingsType-Application.cpp index 98f0634be..ba655d8ba 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Application.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-Application.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-Application.h b/Source/Project64/Settings/SettingType/SettingsType-Application.h index ff14203c0..87a3a883c 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Application.h +++ b/Source/Project64/Settings/SettingType/SettingsType-Application.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.cpp b/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.cpp index 427917a15..c84cd20cd 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h b/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h index 336ed62b1..da2b8edc1 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h +++ b/Source/Project64/Settings/SettingType/SettingsType-ApplicationIndex.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.cpp b/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.cpp index ed907c7e1..d6707ab2d 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h b/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h index 65e1bf2c6..d74d15191 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h +++ b/Source/Project64/Settings/SettingType/SettingsType-ApplicationPath.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-Base.h b/Source/Project64/Settings/SettingType/SettingsType-Base.h index 56b8d7192..337b78027 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Base.h +++ b/Source/Project64/Settings/SettingType/SettingsType-Base.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-Cheats.cpp b/Source/Project64/Settings/SettingType/SettingsType-Cheats.cpp index 60efd7290..4cf52eec0 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Cheats.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-Cheats.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-Cheats.h b/Source/Project64/Settings/SettingType/SettingsType-Cheats.h index cc21be450..d5cc5017b 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-Cheats.h +++ b/Source/Project64/Settings/SettingType/SettingsType-Cheats.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-GameSetting.cpp b/Source/Project64/Settings/SettingType/SettingsType-GameSetting.cpp index 74b2d3c29..72f615211 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-GameSetting.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-GameSetting.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h b/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h index 9b3a35bc5..191d8e665 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h +++ b/Source/Project64/Settings/SettingType/SettingsType-GameSetting.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.cpp b/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.cpp index 8fdb9e52d..557cffb47 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h b/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h index 6940b6812..7cce0e804 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h +++ b/Source/Project64/Settings/SettingType/SettingsType-GameSettingIndex.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.cpp b/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.cpp index 79200f6a8..d2cdd3fdc 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h b/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h index 231c69ea8..776ddb4ed 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBCpuType.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.cpp b/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.cpp index 0e48cbba7..19f7aaf17 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h b/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h index 46f91bed4..064d9b540 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBOnOff.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.cpp b/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.cpp index aafda1a9e..43d60b4c8 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h b/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h index 81352e0f1..72b690fc5 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBRamSize.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.cpp b/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.cpp index 6946e9a4c..d98acc142 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h b/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h index bf98725d5..b04fb0cf7 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBSaveChip.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.cpp b/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.cpp index 3c4acaef2..d877a838d 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h b/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h index 6331504b0..986efafb0 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RDBYesNo.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RelativePath.cpp b/Source/Project64/Settings/SettingType/SettingsType-RelativePath.cpp index 19a547db5..d91a35187 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RelativePath.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RelativePath.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h b/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h index 4d3fc24b1..df6c9f4af 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RelativePath.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.cpp b/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.cpp index 13ed2e890..1f9fee913 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h b/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h index c74723a36..24bc28a01 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabase.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.cpp b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.cpp index 296d70d09..302184c9c 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h index 1373f4ef5..ac85c006c 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseIndex.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.cpp b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.cpp index 0c45ae4f3..b01742bea 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.h b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.h index 49db4fd06..b763ec032 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.h +++ b/Source/Project64/Settings/SettingType/SettingsType-RomDatabaseSetting.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.cpp b/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.cpp index 58de69139..12a4fcb19 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h b/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h index f6ebba028..baea2fda4 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h +++ b/Source/Project64/Settings/SettingType/SettingsType-SelectedDirectory.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempBool.cpp b/Source/Project64/Settings/SettingType/SettingsType-TempBool.cpp index 52dfd2a4c..cd27a200a 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempBool.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-TempBool.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempBool.h b/Source/Project64/Settings/SettingType/SettingsType-TempBool.h index 67e4ca8eb..891db0ed1 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempBool.h +++ b/Source/Project64/Settings/SettingType/SettingsType-TempBool.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempNumber.cpp b/Source/Project64/Settings/SettingType/SettingsType-TempNumber.cpp index d501ada61..f04640564 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempNumber.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-TempNumber.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h b/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h index b9c72d7eb..459d8dafb 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h +++ b/Source/Project64/Settings/SettingType/SettingsType-TempNumber.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempString.cpp b/Source/Project64/Settings/SettingType/SettingsType-TempString.cpp index a102b890c..b0e536c43 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempString.cpp +++ b/Source/Project64/Settings/SettingType/SettingsType-TempString.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/SettingType/SettingsType-TempString.h b/Source/Project64/Settings/SettingType/SettingsType-TempString.h index f79db8e33..4bb512d7d 100644 --- a/Source/Project64/Settings/SettingType/SettingsType-TempString.h +++ b/Source/Project64/Settings/SettingType/SettingsType-TempString.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index c083a3341..6e1e943c2 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Settings/Settings Class.h b/Source/Project64/Settings/Settings Class.h index 1f7479223..056fe255c 100644 --- a/Source/Project64/Settings/Settings Class.h +++ b/Source/Project64/Settings/Settings Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface.h b/Source/Project64/User Interface.h index a322eca86..9eaa923c0 100644 --- a/Source/Project64/User Interface.h +++ b/Source/Project64/User Interface.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Cheat Class UI.cpp b/Source/Project64/User Interface/Cheat Class UI.cpp index b9bdca508..b40130cea 100644 --- a/Source/Project64/User Interface/Cheat Class UI.cpp +++ b/Source/Project64/User Interface/Cheat Class UI.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Cheat Class UI.h b/Source/Project64/User Interface/Cheat Class UI.h index b72ed6307..3c0a199af 100644 --- a/Source/Project64/User Interface/Cheat Class UI.h +++ b/Source/Project64/User Interface/Cheat Class UI.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Frame Per Second Class.cpp b/Source/Project64/User Interface/Frame Per Second Class.cpp index 3228a31cc..e329a57c2 100644 --- a/Source/Project64/User Interface/Frame Per Second Class.cpp +++ b/Source/Project64/User Interface/Frame Per Second Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Frame Per Second Class.h b/Source/Project64/User Interface/Frame Per Second Class.h index 0525fe4b0..77d099b4c 100644 --- a/Source/Project64/User Interface/Frame Per Second Class.h +++ b/Source/Project64/User Interface/Frame Per Second Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index f3a3d5fa6..57661ec1b 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index 62dc6f9ad..264bcc7c6 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Menu Class.h b/Source/Project64/User Interface/Menu Class.h index a8e1fc8b7..fc0e4a3d6 100644 --- a/Source/Project64/User Interface/Menu Class.h +++ b/Source/Project64/User Interface/Menu Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/MenuShortCuts.h b/Source/Project64/User Interface/MenuShortCuts.h index f3ccb90cb..b53d62b11 100644 --- a/Source/Project64/User Interface/MenuShortCuts.h +++ b/Source/Project64/User Interface/MenuShortCuts.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Notification Class.h b/Source/Project64/User Interface/Notification Class.h index ed600f4f3..b125e8481 100644 --- a/Source/Project64/User Interface/Notification Class.h +++ b/Source/Project64/User Interface/Notification Class.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Rom Browser.h b/Source/Project64/User Interface/Rom Browser.h index 5890782fb..0d177d36d 100644 --- a/Source/Project64/User Interface/Rom Browser.h +++ b/Source/Project64/User Interface/Rom Browser.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * 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 ca0cb1678..8866d5ccd 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.h b/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.h index 5ed2bce48..85d0e4243 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Advanced Options.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp b/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp index 8aa9d0617..239073253 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Directories.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Directories.h b/Source/Project64/User Interface/Settings/Settings Page - Directories.h index 9e06715d9..f930d3232 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Directories.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Directories.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * 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 90cff8468..d2554c12d 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - General.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - General.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - General.h b/Source/Project64/User Interface/Settings/Settings Page - Game - General.h index f2d954907..f26b51801 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - General.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - General.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * 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 5cb478b02..b095059da 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.h b/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.h index 6d9f0769c..771bb5d15 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Plugin.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * 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 3b72f2860..eb4147028 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.h b/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.h index afefbe8c1..e1ecf8476 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Recompiler.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * 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 2a2e13a9a..83e4d1df1 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Status.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Status.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game - Status.h b/Source/Project64/User Interface/Settings/Settings Page - Game - Status.h index 31b93488c..8de3c6f9b 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game - Status.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Game - Status.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * 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 acdc22bc8..7d16e778f 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game Browser.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Game Browser.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Game Browser.h b/Source/Project64/User Interface/Settings/Settings Page - Game Browser.h index 795beeb9b..3cfd53af1 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Game Browser.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Game Browser.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * 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 0ff9a07f3..9eb9ebe51 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.h b/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.h index ca80fdf98..efe129cbf 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Options.cpp b/Source/Project64/User Interface/Settings/Settings Page - Options.cpp index f60659ea2..3449c4856 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Options.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Options.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Options.h b/Source/Project64/User Interface/Settings/Settings Page - Options.h index 4058ac7bf..00240541d 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Options.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Options.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp b/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp index d15e8f2a1..17be84740 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Plugin.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page - Plugin.h b/Source/Project64/User Interface/Settings/Settings Page - Plugin.h index ec6b04eec..5714ae5f6 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Plugin.h +++ b/Source/Project64/User Interface/Settings/Settings Page - Plugin.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page.cpp b/Source/Project64/User Interface/Settings/Settings Page.cpp index 5f9e20bd4..89277c68b 100644 --- a/Source/Project64/User Interface/Settings/Settings Page.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/Settings/Settings Page.h b/Source/Project64/User Interface/Settings/Settings Page.h index c1a4eff6c..0dce03282 100644 --- a/Source/Project64/User Interface/Settings/Settings Page.h +++ b/Source/Project64/User Interface/Settings/Settings Page.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/UI Resources.rc b/Source/Project64/User Interface/UI Resources.rc index 27a521eb3..c2217bb2a 100644 --- a/Source/Project64/User Interface/UI Resources.rc +++ b/Source/Project64/User Interface/UI Resources.rc @@ -387,7 +387,7 @@ IDD_About DIALOGEX 0, 0, 233, 265 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - LTEXT "Core Project 64 Team:",IDC_TEAM,15,87,168,17 + LTEXT "Core Project64 Team:",IDC_TEAM,15,87,168,17 LTEXT "Zilmar",IDC_ZILMAR,15,108,49,11 LTEXT "founder. Core and application programmer. Web site.",IDC_ZILMAR_DETAILS,69,107,151,24 LTEXT "Jabo",IDC_JABO,15,133,49,11 diff --git a/Source/Project64/User Interface/WTL Controls/ModifiedCheckBox.h b/Source/Project64/User Interface/WTL Controls/ModifiedCheckBox.h index 39a2495b4..aa42745d1 100644 --- a/Source/Project64/User Interface/WTL Controls/ModifiedCheckBox.h +++ b/Source/Project64/User Interface/WTL Controls/ModifiedCheckBox.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h b/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h index e6da4a608..ba7b6f96b 100644 --- a/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h +++ b/Source/Project64/User Interface/WTL Controls/ModifiedComboBox.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp index d64ba3449..d87c05bb1 100644 --- a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp +++ b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.h b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.h index 1a09514d6..5cdc56dfa 100644 --- a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.h +++ b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp b/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp index 38573ba3c..278c9cdcb 100644 --- a/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp +++ b/Source/Project64/User Interface/WTL Controls/PartialGroupBox.cpp @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/WTL Controls/PartialGroupBox.h b/Source/Project64/User Interface/WTL Controls/PartialGroupBox.h index 0a971f3da..52789ccec 100644 --- a/Source/Project64/User Interface/WTL Controls/PartialGroupBox.h +++ b/Source/Project64/User Interface/WTL Controls/PartialGroupBox.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/User Interface/WTL Controls/numberctrl.h b/Source/Project64/User Interface/WTL Controls/numberctrl.h index f75766d61..52ac4ef72 100644 --- a/Source/Project64/User Interface/WTL Controls/numberctrl.h +++ b/Source/Project64/User Interface/WTL Controls/numberctrl.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/Version.h b/Source/Project64/Version.h index becdd7831..12b051a77 100644 --- a/Source/Project64/Version.h +++ b/Source/Project64/Version.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * @@ -16,7 +16,7 @@ #define VERSION_REVISION 0 #define VERSION_BUILD 9999 -#define VER_FILE_DESCRIPTION_STR "Project 64" +#define VER_FILE_DESCRIPTION_STR "Project64" #define VER_FILE_VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD #define VER_FILE_VERSION_STR STRINGIZE(VERSION_MAJOR) \ "." STRINGIZE(VERSION_MINOR) \ diff --git a/Source/Project64/WTL App.h b/Source/Project64/WTL App.h index cfda490a8..be68d3e84 100644 --- a/Source/Project64/WTL App.h +++ b/Source/Project64/WTL App.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/Project64/stdafx.h b/Source/Project64/stdafx.h index 85725f863..941fedd89 100644 --- a/Source/Project64/stdafx.h +++ b/Source/Project64/stdafx.h @@ -1,6 +1,6 @@ /**************************************************************************** * * -* Project 64 - A Nintendo 64 emulator. * +* Project64 - A Nintendo 64 emulator. * * http://www.pj64-emu.com/ * * Copyright (C) 2012 Project64. All rights reserved. * * * diff --git a/Source/RSP/Cpu.c b/Source/RSP/Cpu.c index 567256593..dac54a873 100644 --- a/Source/RSP/Cpu.c +++ b/Source/RSP/Cpu.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Cpu.h b/Source/RSP/Cpu.h index 4159e8f89..038ab7607 100644 --- a/Source/RSP/Cpu.h +++ b/Source/RSP/Cpu.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Interpreter CPU.c b/Source/RSP/Interpreter CPU.c index f762d9b9f..881b6c192 100644 --- a/Source/RSP/Interpreter CPU.c +++ b/Source/RSP/Interpreter CPU.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Interpreter CPU.h b/Source/RSP/Interpreter CPU.h index 17c33ec3a..78ee3d6d7 100644 --- a/Source/RSP/Interpreter CPU.h +++ b/Source/RSP/Interpreter CPU.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Interpreter Ops.c b/Source/RSP/Interpreter Ops.c index 098dd98b4..135569b39 100644 --- a/Source/RSP/Interpreter Ops.c +++ b/Source/RSP/Interpreter Ops.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Interpreter Ops.h b/Source/RSP/Interpreter Ops.h index f684e5bc0..b422ff264 100644 --- a/Source/RSP/Interpreter Ops.h +++ b/Source/RSP/Interpreter Ops.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Main.cpp b/Source/RSP/Main.cpp index 82e00ac73..cfd068dea 100644 --- a/Source/RSP/Main.cpp +++ b/Source/RSP/Main.cpp @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Mmx.c b/Source/RSP/Mmx.c index 718fd44e7..26a91788d 100644 --- a/Source/RSP/Mmx.c +++ b/Source/RSP/Mmx.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/OpCode.h b/Source/RSP/OpCode.h index 77abb671f..c1e638661 100644 --- a/Source/RSP/OpCode.h +++ b/Source/RSP/OpCode.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Profiling.cpp b/Source/RSP/Profiling.cpp index c7d13aa1c..71ddd7390 100644 --- a/Source/RSP/Profiling.cpp +++ b/Source/RSP/Profiling.cpp @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Profiling.h b/Source/RSP/Profiling.h index c1aaafbef..06eaaad1c 100644 --- a/Source/RSP/Profiling.h +++ b/Source/RSP/Profiling.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/RSP Command.c b/Source/RSP/RSP Command.c index 221854342..6998b0c30 100644 --- a/Source/RSP/RSP Command.c +++ b/Source/RSP/RSP Command.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/RSP Command.h b/Source/RSP/RSP Command.h index 7c256dc4b..9c9bd544d 100644 --- a/Source/RSP/RSP Command.h +++ b/Source/RSP/RSP Command.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/RSP Register.c b/Source/RSP/RSP Register.c index bb8197415..fff4f245e 100644 --- a/Source/RSP/RSP Register.c +++ b/Source/RSP/RSP Register.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/RSP Registers.h b/Source/RSP/RSP Registers.h index 4543def26..3e7505724 100644 --- a/Source/RSP/RSP Registers.h +++ b/Source/RSP/RSP Registers.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Recompiler Analysis.c b/Source/RSP/Recompiler Analysis.c index 2fc25468a..612692e94 100644 --- a/Source/RSP/Recompiler Analysis.c +++ b/Source/RSP/Recompiler Analysis.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Recompiler CPU.c b/Source/RSP/Recompiler CPU.c index ff69c3ba5..7e7f8e248 100644 --- a/Source/RSP/Recompiler CPU.c +++ b/Source/RSP/Recompiler CPU.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Recompiler CPU.h b/Source/RSP/Recompiler CPU.h index e33d1263d..b83a3cf6a 100644 --- a/Source/RSP/Recompiler CPU.h +++ b/Source/RSP/Recompiler CPU.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 594f3c925..b6dde8e51 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Recompiler Ops.h b/Source/RSP/Recompiler Ops.h index 750353259..87ff702e4 100644 --- a/Source/RSP/Recompiler Ops.h +++ b/Source/RSP/Recompiler Ops.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Recompiler Sections.c b/Source/RSP/Recompiler Sections.c index 8a6558285..5069bae44 100644 --- a/Source/RSP/Recompiler Sections.c +++ b/Source/RSP/Recompiler Sections.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Rsp.h b/Source/RSP/Rsp.h index 4b1544853..4d9f15d62 100644 --- a/Source/RSP/Rsp.h +++ b/Source/RSP/Rsp.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Sse.c b/Source/RSP/Sse.c index 6eddbefba..15339f8ca 100644 --- a/Source/RSP/Sse.c +++ b/Source/RSP/Sse.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Types.h b/Source/RSP/Types.h index deaa101f0..d34535a0b 100644 --- a/Source/RSP/Types.h +++ b/Source/RSP/Types.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/Version.h b/Source/RSP/Version.h index 909f9602b..b4a4e8f6f 100644 --- a/Source/RSP/Version.h +++ b/Source/RSP/Version.h @@ -1,5 +1,5 @@ /* -* RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). +* RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/X86.c b/Source/RSP/X86.c index 3abdf6c0e..7ddb3dffa 100644 --- a/Source/RSP/X86.c +++ b/Source/RSP/X86.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/X86.h b/Source/RSP/X86.h index 6723fe11b..59dc0edd4 100644 --- a/Source/RSP/X86.h +++ b/Source/RSP/X86.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/breakpoint.c b/Source/RSP/breakpoint.c index b56bcecf1..416318859 100644 --- a/Source/RSP/breakpoint.c +++ b/Source/RSP/breakpoint.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/breakpoint.h b/Source/RSP/breakpoint.h index 8a4933f66..779458da5 100644 --- a/Source/RSP/breakpoint.h +++ b/Source/RSP/breakpoint.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/dma.c b/Source/RSP/dma.c index faad399af..cf74508a2 100644 --- a/Source/RSP/dma.c +++ b/Source/RSP/dma.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/dma.h b/Source/RSP/dma.h index 199ad2c2b..b9f285faa 100644 --- a/Source/RSP/dma.h +++ b/Source/RSP/dma.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/log.cpp b/Source/RSP/log.cpp index 5a07ec162..288950383 100644 --- a/Source/RSP/log.cpp +++ b/Source/RSP/log.cpp @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/log.h b/Source/RSP/log.h index 56700bfc1..206f87813 100644 --- a/Source/RSP/log.h +++ b/Source/RSP/log.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/memory.c b/Source/RSP/memory.c index a6cf3c026..19755675d 100644 --- a/Source/RSP/memory.c +++ b/Source/RSP/memory.c @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) diff --git a/Source/RSP/memory.h b/Source/RSP/memory.h index f882ba45e..e3ce42d96 100644 --- a/Source/RSP/memory.h +++ b/Source/RSP/memory.h @@ -1,5 +1,5 @@ /* - * RSP Compiler plug in for Project 64 (A Nintendo 64 emulator). + * RSP Compiler plug in for Project64 (A Nintendo 64 emulator). * * (c) Copyright 2001 jabo (jabo@emulation64.com) and * zilmar (zilmar@emulation64.com) From 623411ce99cebd6f1a1be96002e6a8c51a595b4c Mon Sep 17 00:00:00 2001 From: zilmar Date: Tue, 10 Nov 2015 18:13:49 +1100 Subject: [PATCH 018/102] [Project64] Fix plugin change from uint32_t to int32_t --- Source/Project64/Plugins/Controller Plugin.cpp | 2 +- Source/Project64/Plugins/Controller Plugin.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Project64/Plugins/Controller Plugin.cpp b/Source/Project64/Plugins/Controller Plugin.cpp index 8b399bace..00a07a75c 100644 --- a/Source/Project64/Plugins/Controller Plugin.cpp +++ b/Source/Project64/Plugins/Controller Plugin.cpp @@ -173,7 +173,7 @@ void CControl_Plugin::SetControl(CControl_Plugin const * const Plugin) } } -CCONTROL::CCONTROL(uint32_t &Present, uint32_t &RawData, int32_t &PlugType) : +CCONTROL::CCONTROL(int32_t &Present, int32_t &RawData, int32_t &PlugType) : m_Present(Present), m_RawData(RawData), m_PlugType(PlugType) { m_Buttons.Value = 0; diff --git a/Source/Project64/Plugins/Controller Plugin.h b/Source/Project64/Plugins/Controller Plugin.h index 2887e5bd2..a0a82c49a 100644 --- a/Source/Project64/Plugins/Controller Plugin.h +++ b/Source/Project64/Plugins/Controller Plugin.h @@ -64,7 +64,7 @@ class CControl_Plugin; class CCONTROL { public: - CCONTROL(uint32_t &Present, uint32_t &RawData, int32_t &PlugType); + CCONTROL(int32_t &Present, int32_t &RawData, int32_t &PlugType); inline bool Present(void) const { return m_Present != 0; } inline uint32_t Buttons(void) const { return m_Buttons.Value; } inline PluginType Plugin(void) const { return static_cast(m_PlugType); } From bdfb64c4e884ec6c8347f761f23e1edb14cb44b4 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Tue, 10 Nov 2015 02:50:08 -0700 Subject: [PATCH 019/102] Get rid of WS_EX_CLIENTEDGE Switch to CreateWindow, as CreateWindowEx is no longer need --- Source/Project64/User Interface/Rom Browser Class.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index 7992d092a..11683afb9 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -333,7 +333,7 @@ void CRomBrowser::AllocateBrushs(void) void CRomBrowser::CreateRomListControl(void) { - m_hRomList = (HWND)CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, NULL, + m_hRomList = (HWND)CreateWindow(WC_LISTVIEW, NULL, WS_TABSTOP | WS_VISIBLE | WS_CHILD | LVS_OWNERDRAWFIXED | LVS_SINGLESEL | LVS_REPORT, 0, 0, 0, 0, m_MainWindow, (HMENU)IDC_ROMLIST, GetModuleHandle(NULL), NULL); From 8358211e9ab996a62bb8caabb0c52d702dd7c0be Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Tue, 10 Nov 2015 03:04:11 -0700 Subject: [PATCH 020/102] Remove some leftover code from the old About box This allowed you click the top region of the About box to move the window. --- Source/Project64/User Interface/Gui Class.cpp | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 57661ec1b..f1ba42901 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -1017,31 +1017,6 @@ DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) SetWindowText(GetDlgItem(hWnd, IDC_VERSION), VersionDisplay.c_str()); } break; - case WM_NCHITTEST: - { - int xPos = LOWORD(lParam); - int yPos = HIWORD(lParam); - RECT client, a; - GetClientRect(hWnd, &a); - GetClientRect(hWnd, &client); - ClientToScreen(hWnd, (LPPOINT)&client); - client.right += client.left; - client.bottom += client.top; - - int nCaption = GetSystemMetrics(SM_CYCAPTION) * 4; - - LRESULT lResult = HTCLIENT; - - //check caption - if (xPos <= client.right && xPos >= client.left && - (yPos >= client.top + 0) && (yPos <= client.top + 0 + nCaption)) - { - lResult = HTCAPTION; - } - SetWindowLong(hWnd, DWLP_MSGRESULT, lResult); - return TRUE; - } - break; case WM_CTLCOLORSTATIC: { HDC hdcStatic = (HDC)wParam; From edf24e534319c350c10e6e104ac1e7571d8e4073 Mon Sep 17 00:00:00 2001 From: "Julio C. Rocha" Date: Tue, 10 Nov 2015 13:21:51 -0800 Subject: [PATCH 021/102] Fix typo in SLN and type for Controller Plugin member variables . --- Project64.sln | 2 +- Source/Project64/Plugins/Controller Plugin.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project64.sln b/Project64.sln index 513cfdcfd..25ada1938 100644 --- a/Project64.sln +++ b/Project64.sln @@ -9,7 +9,7 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Glide", "Glide", "{9FE699A5-41C3-4441-92AB-639B3D77DE26}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Common", "Source\Common\Common.vcxproj", "{B4A4B994-9111-42B1-93C2-6F1CA8BC4421}" -EndProjectt +EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project64", "Source\Project64\Project64.vcxproj", "{7E534C8E-1ACE-4A88-8807-39A11ED4DA18}" ProjectSection(ProjectDependencies) = postProject {FD617E80-9E40-4138-85DA-B94633972E6A} = {FD617E80-9E40-4138-85DA-B94633972E6A} diff --git a/Source/Project64/Plugins/Controller Plugin.h b/Source/Project64/Plugins/Controller Plugin.h index 7dc64ebca..5ac28657e 100644 --- a/Source/Project64/Plugins/Controller Plugin.h +++ b/Source/Project64/Plugins/Controller Plugin.h @@ -71,8 +71,8 @@ public: private: friend CControl_Plugin; //controller plugin class has full access - uint32_t & m_Present; - uint32_t & m_RawData; + int32_t & m_Present; + int32_t & m_RawData; int32_t & m_PlugType; BUTTONS m_Buttons; From 4df13b4a23ab9d1d159c68e62a58923ce7dbd399 Mon Sep 17 00:00:00 2001 From: exhalatio Date: Wed, 11 Nov 2015 10:10:10 +0900 Subject: [PATCH 022/102] Fix Blurry Fonts on High-DPI Windows 10 --- Source/Project64/Project64.vcxproj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj index 45a6e4904..7501a67a9 100644 --- a/Source/Project64/Project64.vcxproj +++ b/Source/Project64/Project64.vcxproj @@ -39,6 +39,9 @@ 1 false + + true + @@ -319,4 +322,4 @@ false - \ No newline at end of file + From 762fe5707448785b698e535ecd94a5f0be0c82e5 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Tue, 10 Nov 2015 20:00:15 -0700 Subject: [PATCH 023/102] Use a standard window for the Language Selector --- .../Multilanguage/LanguageSelector.cpp | 227 ++---------------- .../Project64/User Interface/UI Resources.rc | 6 +- 2 files changed, 20 insertions(+), 213 deletions(-) diff --git a/Source/Project64/Multilanguage/LanguageSelector.cpp b/Source/Project64/Multilanguage/LanguageSelector.cpp index 5a93b00ea..b1cdf940a 100644 --- a/Source/Project64/Multilanguage/LanguageSelector.cpp +++ b/Source/Project64/Multilanguage/LanguageSelector.cpp @@ -20,130 +20,15 @@ void CLanguageSelector::Select ( void ) DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_Lang_Select),NULL,(DLGPROC)LangSelectProc, (LPARAM)this); } -static WNDPROC pfnWndLangSelectOkProc = NULL; -static HBITMAP hOkButton = NULL; - -DWORD CALLBACK LangSelectOkProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) -{ - static bool m_fPressed = false; - static HBITMAP hOkButtonDown = NULL; - - switch (uMsg) - { - case WM_PAINT: - { - PAINTSTRUCT ps; - - if (BeginPaint(hWnd,&ps)) - { - if (m_fPressed) - { - if (hOkButtonDown == NULL) - { - hOkButtonDown = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_LANG_OK_DOWN)); - } - if (hOkButtonDown) - { - RECT rcClient; - GetClientRect(hWnd, &rcClient); - - BITMAP bmTL1; - GetObject(hOkButtonDown, sizeof(BITMAP), &bmTL1); - HDC memdc = CreateCompatibleDC(ps.hdc); - HGDIOBJ save = SelectObject(memdc, hOkButtonDown); - BitBlt(ps.hdc, 0, 0, bmTL1.bmWidth, bmTL1.bmHeight, memdc, 0, 0, SRCCOPY); - SelectObject(memdc, save); - DeleteDC(memdc); - } - } - else - { - if (hOkButton) - { - RECT rcClient; - GetClientRect(hWnd, &rcClient); - - BITMAP bmTL1; - GetObject(hOkButton, sizeof(BITMAP), &bmTL1); - HDC memdc = CreateCompatibleDC(ps.hdc); - HGDIOBJ save = SelectObject(memdc, hOkButton); - BitBlt(ps.hdc, 0, 0, bmTL1.bmWidth, bmTL1.bmHeight, memdc, 0, 0, SRCCOPY); - SelectObject(memdc, save); - DeleteDC(memdc); - } - } - EndPaint(hWnd,&ps); - } - } - break; - case WM_MOUSEMOVE: - if (::GetCapture() == hWnd) - { - POINT ptCursor = { ((int)(short)LOWORD(lParam)), ((int)(short)HIWORD(lParam)) }; - ClientToScreen(hWnd, &ptCursor); - RECT rect; - GetWindowRect(hWnd, &rect); - bool uPressed = ::PtInRect(&rect, ptCursor)==TRUE; - if ( m_fPressed != uPressed ) - { - m_fPressed = uPressed; - ::InvalidateRect(hWnd, NULL, TRUE); - UpdateWindow(hWnd); - } - } - break; - case WM_LBUTTONDOWN: - { - LRESULT lRet = 0; - lRet = DefWindowProc(hWnd, uMsg, wParam, lParam); - SetCapture(hWnd); - if ( ::GetCapture()==hWnd ) - { - m_fPressed = true; - - if (m_fPressed) - { - ::InvalidateRect(hWnd, NULL, TRUE); - UpdateWindow(hWnd); - } - } - return lRet; - } - break; - case WM_LBUTTONUP: - { - LRESULT lRet = 0; - lRet = DefWindowProc(hWnd, uMsg, wParam, lParam); - if ( ::GetCapture() == hWnd ) - { - ::ReleaseCapture(); - if ( m_fPressed ) - { - ::SendMessage(GetParent(hWnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hWnd), BN_CLICKED), (LPARAM)hWnd); - } - } - m_fPressed = false; - - return lRet; - } - break; - } - - return CallWindowProc(pfnWndLangSelectOkProc, hWnd, uMsg, wParam, lParam); -} - LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static HBITMAP hbmpBackgroundTop = NULL; - static HBITMAP hbmpBackgroundBottom = NULL; - static HBITMAP hbmpBackgroundMiddle = NULL; static HFONT hTextFont = NULL; static CLanguageSelector * lngClass; switch (uMsg) { case WM_INITDIALOG: - SetWindowPos(hDlg,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOREPOSITION|SWP_NOSIZE); { lngClass = (CLanguageSelector *)lParam; @@ -167,47 +52,11 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_SETCURSEL,0,0); } - enum { ROUND_EDGE = 15 }; - - DWORD dwStyle = GetWindowLong(hDlg, GWL_STYLE); - dwStyle &= ~(WS_CAPTION|WS_SIZEBOX); - SetWindowLong(hDlg, GWL_STYLE, dwStyle); - // Use the size of the image - hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT_TOP)); - hbmpBackgroundBottom = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT_BOTTOM)); - hbmpBackgroundMiddle = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT_MIDDLE)); + hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT_LOGO)); BITMAP bmTL; GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); - if (hbmpBackgroundTop) - { - // int iHeight = bmTL.bmHeight; - int iWidth = bmTL.bmWidth; - - RECT rect; - GetWindowRect(hDlg, &rect); - rect.left -= rect.left; - rect.bottom -= rect.top; - rect.top -= rect.top; - - // Tweaked - HRGN hWindowRegion= CreateRoundRectRgn - ( - rect.left, - rect.top, - rect.left+iWidth+GetSystemMetrics(SM_CXEDGE)-1, - rect.bottom+GetSystemMetrics(SM_CYEDGE)-1, - ROUND_EDGE, - ROUND_EDGE - ); - - if (hWindowRegion) - { - SetWindowRgn(hDlg, hWindowRegion, TRUE); - DeleteObject(hWindowRegion); - } - } hTextFont = ::CreateFont ( 18, @@ -227,35 +76,6 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM ); SendDlgItemMessage(hDlg,IDC_SELECT_LANG,WM_SETFONT,(WPARAM)hTextFont,TRUE); } - - hOkButton = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_LANG_OK)); - pfnWndLangSelectOkProc = (WNDPROC)::GetWindowLongPtr(GetDlgItem(hDlg,IDOK), GWLP_WNDPROC); - ::SetWindowLongPtr(GetDlgItem(hDlg,IDOK), GWLP_WNDPROC,(LONG_PTR)LangSelectOkProc); - break; - case WM_NCHITTEST: - { - int xPos = LOWORD(lParam); - int yPos = HIWORD(lParam); - RECT client, a; - GetClientRect(hDlg,&a); - GetClientRect(hDlg,&client); - ClientToScreen(hDlg,(LPPOINT)&client); - client.right += client.left; - client.bottom += client.top; - - int nCaption = GetSystemMetrics(SM_CYCAPTION)*4; - - LRESULT lResult = HTCLIENT; - - //check caption - if (xPos <= client.right && xPos >= client.left && - (yPos >= client.top+ 0)&& (yPos <= client.top + 0+nCaption)) - { - lResult = HTCAPTION; - } - SetWindowLong(hDlg, DWLP_MSGRESULT, lResult); - return TRUE; - } break; case WM_CTLCOLORSTATIC: { @@ -265,6 +85,22 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); } break; + case WM_ERASEBKGND: + { + HPEN outline; + HBRUSH fill; + RECT rect; + + outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); + fill = CreateSolidBrush(0x00FFFFFF); + SelectObject((HDC)wParam, outline); + SelectObject((HDC)wParam, fill); + + GetClientRect(hDlg, &rect); + + Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); + } + break; case WM_PAINT: { PAINTSTRUCT ps; @@ -276,8 +112,6 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM BITMAP bmTL_top, bmTL_bottom, bmTL_Middle; GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL_top); - GetObject(hbmpBackgroundBottom, sizeof(BITMAP), &bmTL_bottom); - GetObject(hbmpBackgroundMiddle, sizeof(BITMAP), &bmTL_Middle); HDC memdc = CreateCompatibleDC(ps.hdc); HGDIOBJ save = SelectObject(memdc, hbmpBackgroundTop); @@ -285,25 +119,6 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM SelectObject(memdc, save); DeleteDC(memdc); - memdc = CreateCompatibleDC(ps.hdc); - save = SelectObject(memdc, hbmpBackgroundMiddle); - for (int x = bmTL_top.bmHeight; x < rcClient.bottom; x += bmTL_Middle.bmHeight) - { - //BitBlt(ps.hdc, 0, bmTL_top.bmHeight, bmTL_Middle.bmWidth, rcClient.bottom - (bmTL_bottom.bmHeight + bmTL_top.bmHeight), memdc, 0, 0, SRCCOPY); - BitBlt(ps.hdc, 0, x, bmTL_Middle.bmWidth, bmTL_Middle.bmHeight, memdc, 0, 0, SRCCOPY); - } - SelectObject(memdc, save); - DeleteDC(memdc); - - BITMAP ; - memdc = CreateCompatibleDC(ps.hdc); - save = SelectObject(memdc, hbmpBackgroundBottom); - BitBlt(ps.hdc, 0, rcClient.bottom - bmTL_bottom.bmHeight, bmTL_bottom.bmWidth, bmTL_bottom.bmHeight, memdc, 0, 0, SRCCOPY); - SelectObject(memdc, save); - DeleteDC(memdc); - - BITMAP ; - EndPaint(hDlg,&ps); } } @@ -316,14 +131,6 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM { DeleteObject(hbmpBackgroundTop); } - if (hbmpBackgroundBottom) - { - DeleteObject(hbmpBackgroundBottom); - } - if (hbmpBackgroundMiddle) - { - DeleteObject(hbmpBackgroundMiddle); - } if (hTextFont) { diff --git a/Source/Project64/User Interface/UI Resources.rc b/Source/Project64/User Interface/UI Resources.rc index c2217bb2a..f763f1b14 100644 --- a/Source/Project64/User Interface/UI Resources.rc +++ b/Source/Project64/User Interface/UI Resources.rc @@ -492,9 +492,9 @@ BEGIN PUSHBUTTON "Close",IDCANCEL,154,110,50,14 END -IDD_Lang_Select DIALOGEX 0, 0, 237, 111 -STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Welcome to" +IDD_Lang_Select DIALOGEX 0, 0, 233, 120 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION +CAPTION "Project64" FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN DEFPUSHBUTTON "OK",IDOK,90,99,50,12 From 4b150ded0304d052cea5503420cc87ef61553954 Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 11 Nov 2015 17:47:22 +1100 Subject: [PATCH 024/102] [Project64] Get File Class.cpp to use standard types --- Source/Common/File Class.cpp | 27 +++++++++------------------ Source/Common/File Class.h | 8 ++++---- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/Source/Common/File Class.cpp b/Source/Common/File Class.cpp index 48acd893a..f9eb583eb 100644 --- a/Source/Common/File Class.cpp +++ b/Source/Common/File Class.cpp @@ -82,13 +82,12 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags) ULONG dwCreateFlag = 0; if (nOpenFlags & modeCreate) { - if (nOpenFlags & modeNoTruncate) - dwCreateFlag = OPEN_ALWAYS; - else - dwCreateFlag = CREATE_ALWAYS; + dwCreateFlag = nOpenFlags & modeNoTruncate == 0 ? OPEN_ALWAYS : CREATE_ALWAYS; } else + { dwCreateFlag = OPEN_EXISTING; + } // attempt file creation HANDLE hFile = ::CreateFile(lpszFileName, dwAccess, dwShareMode, &sa, dwCreateFlag, FILE_ATTRIBUTE_NORMAL, NULL); @@ -140,19 +139,15 @@ bool CFile::Flush() return ::FlushFileBuffers(m_hFile) != 0; } -bool CFile::Write(const void* lpBuf, size_t nCount) +bool CFile::Write(const void* lpBuf, uint32_t nCount) { if (nCount == 0) { return true; // avoid Win32 "null-write" option } - if (nCount > ULONG_MAX) - { - nCount = ULONG_MAX; /* Or should we loop WriteFile() every 2 GB? */ - } - DWORD nWritten = 0; - if (!::WriteFile(m_hFile, lpBuf, (DWORD)nCount, &nWritten, NULL)) + ULONG nWritten = 0; + if (!::WriteFile(m_hFile, lpBuf, nCount, &nWritten, NULL)) { return false; } @@ -165,23 +160,19 @@ bool CFile::Write(const void* lpBuf, size_t nCount) return true; } -size_t CFile::Read(void* lpBuf, size_t nCount) +uint32_t CFile::Read(void* lpBuf, uint32_t nCount) { if (nCount == 0) { return 0; // avoid Win32 "null-read" } - if (nCount > ULONG_MAX) - { - nCount = ULONG_MAX; /* Or should we loop ReadFile() every 2 GB? */ - } DWORD dwRead = 0; - if (!::ReadFile(m_hFile, lpBuf, (DWORD)nCount, &dwRead, NULL)) + if (!::ReadFile(m_hFile, lpBuf, nCount, &dwRead, NULL)) { return 0; } - return (dwRead); + return (uint32_t)dwRead; } long CFile::Seek(long lOff, SeekPosition nFrom) diff --git a/Source/Common/File Class.h b/Source/Common/File Class.h index c61730450..fc734f633 100644 --- a/Source/Common/File Class.h +++ b/Source/Common/File Class.h @@ -40,8 +40,8 @@ public: virtual bool SetLength(uint32_t dwNewLen) = 0; virtual uint32_t GetLength() const = 0; - virtual size_t Read(void* lpBuf, size_t nCount) = 0; - virtual bool Write(const void* lpBuf, size_t nCount) = 0; + virtual uint32_t Read(void* lpBuf, uint32_t nCount) = 0; + virtual bool Write(const void* lpBuf, uint32_t nCount) = 0; virtual bool Flush() = 0; virtual bool Close() = 0; @@ -78,8 +78,8 @@ public: virtual bool SetLength(uint32_t dwNewLen); virtual uint32_t GetLength() const; - virtual size_t Read(void* lpBuf, size_t nCount); - virtual bool Write(const void* lpBuf, size_t nCount); + virtual uint32_t Read(void* lpBuf, uint32_t nCount); + virtual bool Write(const void* lpBuf, uint32_t nCount); virtual bool Flush(); virtual bool Close(); From 53aa2faf3b673d6f311c52168e3f6628bd439b8f Mon Sep 17 00:00:00 2001 From: zilmar Date: Wed, 11 Nov 2015 17:51:19 +1100 Subject: [PATCH 025/102] [Project64] Log Class.cpp to use standard types --- Source/Common/Log Class.cpp | 17 ++++++++--------- Source/Common/Log Class.h | 12 ++++++------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Source/Common/Log Class.cpp b/Source/Common/Log Class.cpp index a0a9560fd..95f001dba 100644 --- a/Source/Common/Log Class.cpp +++ b/Source/Common/Log Class.cpp @@ -120,7 +120,7 @@ void CLog::LogArgs(const char * Message, va_list & args ) void CLog::Log( const char * Message ) { if (!m_hLogFile.IsOpen()) { return; } - m_hLogFile.Write(Message, strlen(Message)*sizeof(TCHAR)); + m_hLogFile.Write(Message,(uint32_t)strlen(Message)*sizeof(TCHAR)); if (m_FlushOnWrite) { m_hLogFile.Flush(); @@ -145,13 +145,13 @@ void CLog::Log( const char * Message ) m_hLogFile.Seek((end - m_MaxFileSize) + m_FileChangeSize,CFile::begin); // Find next end of line - size_t NextEnter = 0, dwRead = 0; + uint32_t NextEnter = 0, dwRead = 0; do { BYTE Data[300]; - size_t dwRead; + uint32_t dwRead; - dwRead = m_hLogFile.Read(Data, sizeof(Data)); + dwRead = m_hLogFile.Read(Data,sizeof(Data)); if (dwRead == 0) { break; @@ -170,9 +170,8 @@ void CLog::Log( const char * Message ) } while(dwRead != 0); // copy content of log to the new file - size_t ReadPos = (end - m_MaxFileSize) + m_FileChangeSize + NextEnter; - uint32_t WritePos = 0; - size_t SizeToRead; + uint32_t ReadPos = (end - m_MaxFileSize) + m_FileChangeSize + NextEnter; + uint32_t SizeToRead, WritePos = 0; do { enum { fIS_MvSize = 0x5000 }; @@ -183,8 +182,8 @@ void CLog::Log( const char * Message ) m_hLogFile.Seek(ReadPos,CFile::begin); - size_t dwRead; - dwRead = m_hLogFile.Read(Data, SizeToRead); + uint32_t dwRead; + dwRead = m_hLogFile.Read(Data,SizeToRead); m_hLogFile.Seek(WritePos,CFile::begin); diff --git a/Source/Common/Log Class.h b/Source/Common/Log Class.h index 1b155da5d..69d322cb1 100644 --- a/Source/Common/Log Class.h +++ b/Source/Common/Log Class.h @@ -15,8 +15,8 @@ class CLog bool m_FlushOnWrite; stdstr m_FileName; bool m_TruncateFileLog; - size_t m_MaxFileSize; - size_t m_FileChangeSize; + uint32_t m_MaxFileSize; + uint32_t m_FileChangeSize; public: CLog ( void ); @@ -29,10 +29,10 @@ public: bool Empty ( void ); void Close ( void ); - inline void SetMaxFileSize(size_t Size) - { - m_MaxFileSize = Size; - m_FileChangeSize = (size_t)(Size * 0.1); + inline void SetMaxFileSize ( uint32_t Size ) + { + m_MaxFileSize = Size; + m_FileChangeSize = (uint32_t)(Size * 0.1); } inline void SetTruncateFile( bool Truncate ) { m_TruncateFileLog = Truncate; } inline void SetFlush ( bool Always ) { m_FlushOnWrite = Always; } From d7429340185442b09734498cecd86797d3d6e893 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Wed, 11 Nov 2015 01:35:22 -0700 Subject: [PATCH 026/102] Nuke unused resource files --- Source/Project64/Project64.vcxproj | 11 +++-------- Source/Project64/Project64.vcxproj.filters | 15 --------------- .../Bitmaps/AboutScreenBottom.bmp | Bin 24252 -> 0 bytes .../Bitmaps/AboutScreenMiddle.bmp | Bin 8472 -> 0 bytes .../User Interface/Bitmaps/AboutScreenTop.bmp | Bin 132608 -> 0 bytes .../User Interface/Bitmaps/CloseHover.bmp | Bin 1398 -> 0 bytes .../User Interface/Bitmaps/CloseNormal.bmp | Bin 1400 -> 0 bytes .../User Interface/Bitmaps/ClosePushed.bmp | Bin 1398 -> 0 bytes .../User Interface/Bitmaps/LangOK.bmp | Bin 5576 -> 0 bytes .../User Interface/Bitmaps/LangOK_down.bmp | Bin 5576 -> 0 bytes .../Project64/User Interface/UI Resources.rc | 5 ----- Source/Project64/User Interface/resource.h | 5 ----- 12 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 Source/Project64/User Interface/Bitmaps/AboutScreenBottom.bmp delete mode 100644 Source/Project64/User Interface/Bitmaps/AboutScreenMiddle.bmp delete mode 100644 Source/Project64/User Interface/Bitmaps/AboutScreenTop.bmp delete mode 100644 Source/Project64/User Interface/Bitmaps/CloseHover.bmp delete mode 100644 Source/Project64/User Interface/Bitmaps/CloseNormal.bmp delete mode 100644 Source/Project64/User Interface/Bitmaps/ClosePushed.bmp delete mode 100644 Source/Project64/User Interface/Bitmaps/LangOK.bmp delete mode 100644 Source/Project64/User Interface/Bitmaps/LangOK_down.bmp diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj index 7501a67a9..0cea30d80 100644 --- a/Source/Project64/Project64.vcxproj +++ b/Source/Project64/Project64.vcxproj @@ -39,9 +39,9 @@ 1 false - + true - + @@ -159,12 +159,7 @@ - - - - - @@ -322,4 +317,4 @@ false - + \ No newline at end of file diff --git a/Source/Project64/Project64.vcxproj.filters b/Source/Project64/Project64.vcxproj.filters index 9805e41ad..1ae4ebd97 100644 --- a/Source/Project64/Project64.vcxproj.filters +++ b/Source/Project64/Project64.vcxproj.filters @@ -422,21 +422,6 @@ - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - Resource Files diff --git a/Source/Project64/User Interface/Bitmaps/AboutScreenBottom.bmp b/Source/Project64/User Interface/Bitmaps/AboutScreenBottom.bmp deleted file mode 100644 index bedfdac44917546f8a5d9f53b8178a4020868ab7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24252 zcmeI&y-plw6o>J5YZpk{#1%3Pinsu8=OS(p$X5Vbs@zKMg^mkIPlIp*2J>Zy4+rG% z;Rs?8F!}gtjv4LRvgGYNyXQzOf|+^6{MqNxdC%+*&wlQfsvdj&-dDF(%6GoE%ERjS zKRMoh5MR|Vyc``J?eFjJ?d@%EZ*OjHuB@!g&(DvKkGI?HiHV6PS(!j4Fr*0pd~9rN za&mHEVFCE?CjlxT1X?J?_ubvyt*xz%jSZ)?TCHxkyR@|QysBTS`ZX&P$OMKcf#5nA zUtC;-Jn-R90#rZ3|fDqhZDbCVMP(~c*5n^zWjoyWn!f!Tz5(_g=5WdfPNH=IB}uWy24 zID;D60Ec<>5VantfDmY*6i+2gBBE(;h* zGJ%F9&;#x}Aj28d&;~fn!47%g$L4|_2!R%S)}h_@Q|u;U20TE8O1R ze#puMGJ%FC0AzLxLjWA+V23>L;U7~6LZF3vH~2I|Od6tTupO~SAs1`h+}w!c?(XiN ztV|#iXm|oZhBK(44RDx)-97>MF?FDV9yj!EC_LXV#x$*nrh#HY4F6_j0-3;2BoKOl zwp{_t!47%g_iiih`vz`^N0&wtv7v}b1GDHrtQ3j-mz4=*0u4_fSOzt;0nQCzk8K6~ z>xY^BZt!`^+6_7l^UP=(^ibAocp~}dX9AhP#{}REYWo3z!yN3j8%Q8V4xhQ99z@2l zA>EK~r%Yh@66ke9j2!B5zMC?E;Y*;`4KUXTq#K6sznpiJ2@IY n;F;wWnZPI{@Re?OY985%&pzcWaunVdd5@XESGwWHC#C!kXqYi2 diff --git a/Source/Project64/User Interface/Bitmaps/AboutScreenMiddle.bmp b/Source/Project64/User Interface/Bitmaps/AboutScreenMiddle.bmp deleted file mode 100644 index 3bb8f1745bdedb09c75e9cb2168736bd35131347..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8472 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ΝK{?gU4w|`kw+Nx~d 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 Ye)wVB__+P?ud!e&z=nWrVF>^IFZGpsumAu6 diff --git a/Source/Project64/User Interface/Bitmaps/CloseHover.bmp b/Source/Project64/User Interface/Bitmaps/CloseHover.bmp deleted file mode 100644 index 14ea639e31081208d50da98fbaf629be19fd331e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1398 zcma)+-Afcv7>CayL07voJKr-Pm@GtyC}QGWbl*QvBDSrV5p*Fe!6u?sM3fOygoF|i zLPR7bQgk7OMbSlc6QRTsuG_^f*k792}bHjKH1uHHJVcW}Kw*AI+ zKPU9Xbq^Mvmi5B6U&D$^;rpK%#zRc5`>|9iHyRDs{j^`$d5Yb#mdF=>STU9oz?yc0 zz3+d=Nqv0(2isUX<^~o#v)Nhdg%y`uL^eC8Y13pu^1i>3aNS_*`|AnIIzH5|>vs%e zq1Yls=`j3*OlAV!ao+p>Pm}o6QXlD`EHD<(4V_cNI*SZPcUl!M?GibJSH5Ns;D zZNDXdUBAh&Va0U^{$4s=lp|P?35O{VC=Q`W8M;i{@zk_yRDIPG;`R~v*>rl0elSwm zwp}%=C^BxCzZ~`={eqv#3GwO}{hucv+g_nIndfHW&AZk-#fKC~nIip`eiz>JzQ%BCYbB}J?s?zvROcC@!oHm>dM6_m?uC53%z z>JL6t3Qr?qeu?woIIA5UTS}ds)vm5;clW`f1cuMBBc6C1Ar4kgPgSY6x7yeDyTAXR z*v7(>l6haq^ZV!Pe4d$y<7rZDZ51e3F8AGOgUy~loYB$xf282Gv-1DzL%~&9U~N+P GD~Z2Rwju2R diff --git a/Source/Project64/User Interface/Bitmaps/CloseNormal.bmp b/Source/Project64/User Interface/Bitmaps/CloseNormal.bmp deleted file mode 100644 index 5515f296f4d288398b2d0412257fa27c2760c063..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1400 zcmbW1KWoB37{=3~Q@28)pg7k>oC<=I4kB0)7ncmBDE1>{ao5eM{U)v7p)FKs*HUP$ zn$&*W2^2gwoz60!pXjUIo>2({w^nPGNW8`sD6oRB)ttC6 z@}MMND%s3i)}8CRyj2(Qamo&;5FR1AI7f?L+bnpxH8Sp#c*J3Mh_@+dGS)I o*g@eTA=M|R*%TiySiw^X{6h3au;AD4_oVsb4O|@|$rS#eKM;r!VE_OC diff --git a/Source/Project64/User Interface/Bitmaps/ClosePushed.bmp b/Source/Project64/User Interface/Bitmaps/ClosePushed.bmp deleted file mode 100644 index 4209968af2dffb57df748ad9ff06bf7634d627c0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1398 zcmbu8ze>YU7{xya=UbEJUn!-vlv*qu1Qi@alx`LuKt)8~K=xeCKy>C}g?S9;f&>hx-&ROI>5+#`%((#|w44*>p~t z6HmL|BoV8mc@A}hK6JHilXRHn^M0}Dm&<;&8q{h*y&g0gA5!oT!b&A5mHa}%M_+=` z0}I1A%47})7y5Dwsu7vysSurE1qv)p|APlhjfg)J;y|k1?uB83X(q{| zB!AqK<}2=R4IV7bCwa8f)pUXy_*w7^ith^1mj-louXn(MrA4A__FNxG&zLmn0w}Q5 z{OSB}Tclz6{wv^D)%p8EB$PToF+~~Yx4`e=GqElW<5(BN2z9S_K!J^T+rGx1!D8T# z1S3$2cbq%Rx{zX+lizYse16Zil{%d_Y{5(2Ajecs6z{svqe=0e_cEFy9^XG6x!n7( l0tJ>Hw%y*EiG}CA4lW7bZrJp=7V{O=yJQp_r4<^a<%b1QsF#+nl9JC6 zmkAJ+wvkb`ox5=LvCBWR8{c_Hy)?4At*m}RPT_#;FhX()`{b3@E2wtMsiw#%yLI-> zI(_|DMc4cI%-7By&(zc($;dpAmL5JxM&`b(++`)TO)6TgDmn>$lNX=6`Kz|~Lu%e@ zH=pMknvbaB*(FOpBbWL>F0!!?AO1!bLE|E;qzYSB?uL^3E;Zc=>IT{U(^j0n`KzuE z>|gKa>Kat=Z)@wj&6~dheFR59E>IBec(@0(v>pM~0Aa4uYdrR5V~GN7qvftG^(yBF-=`~mbY(3?Qd0=*0m z2O2R3gMTkx{0T|(z$8s0Z^Dfo4E_biEOH8myNwo%!QfwDjvi6z8R%b6&u2gq!k|U8 z!p$5c@e6d%z?9FoK=p50{%dz1>eRnLj{swBaJ4to_Nwbm(J(5QIDOTH+rL^Sf54ghZ=hfo%_D5i~A59a4)SCx25}W1oip3@y`=Nwd~nx%Yd@;!h1- z?^Ci~ySP6yHhE%b^w`jFm>?tL$GV1(b&M|=+N?2k>X^P@$E`=d*Y5tdX!Ym*X&=j~ z-)3aLPRSTf=v7?GE5C>r?qQd`V%IKNck0cDzlSdT+;{xPrd?kbuJ}A{&Zo&UKTeu4 zOwhy`AG;=hsOos1)A%l{_4=h7Z-E8N{bzs9-}-g@;?Lbjzi-+5ZPV^=8;1*8zw7I& zZC@8`{4! diff --git a/Source/Project64/User Interface/Bitmaps/LangOK_down.bmp b/Source/Project64/User Interface/Bitmaps/LangOK_down.bmp deleted file mode 100644 index 790c3a70d8f0d1bb16d9c445ff1d06601c627b40..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5576 zcmZ?rJt4{f24+A~1Be5FSR9BM86#19LWe_p@y>-MAH??3;ubnOvquSpip+l;L4*f>0OaDHm(kJP z7bR71d#8Pzx8}>mJHHkz+o@+!u4Ob!Rdb)b!c7^O2h!5R2g%Al(9wPDAN-=A;!WrD zk7us`nzv-Drcs`{-XtaUU2^g_sN&frOFko)`amwSu@4{qMixQiBCDhdTV3OkyU+8q z{MQZrA5L8THFxnA4WnE&-HAZ|%F11*+=|xLcbhkV1^Nh%fLx#;++?^1wX_}q)c|G7 z%HF_bsm@SSf8^%%JSFFKUGIkzSAGKht8SP>MgPLR19v&lQ$RsD7p}n4@(C~*(A2X) zOM(7%^#u91wr3#y3-l(?vp_Gy!+}PO!QkJE7k@(1JTOVq$eVCu2ZMisF^inS;clY^ zV=(v^n4?EjdItK})AJdSgfM6kt#C63N&EucGce`zqRr}t*{ZtzO6ohQQvU)y0*tl6 z)82r_Z|>`w?hnVW{G79JqnduIs!o@Z+E!V)Yw%=12?LlnA!!vtqSdg#wg<8Z8kZ7# zvFZi-*V*G)Le}ew&iBVI|C}**wSq>Fl4gmb`dm4s{jzdrWn|9{8zd`tPD$;WiS^T< zxR?3O?+%{-Id$d|X+>KJIZqkIELp`4S;gtHinE3dl2e?eq_Nn*a=UBDxuoi+drtq@ zf9Qmq8qmKsB9hi(QeF}=;gYh^!w1R5$f=}i8Q0kP&Wb77bM@{QV8K#c(FXJ~IF@b1 uWk5)5SRjaBfKjQS>1FDi(=%fayc9ij Date: Wed, 11 Nov 2015 12:31:17 -0500 Subject: [PATCH 027/102] inverted the inverted file flags condition --- Source/Common/File Class.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Common/File Class.cpp b/Source/Common/File Class.cpp index f9eb583eb..e6ab04651 100644 --- a/Source/Common/File Class.cpp +++ b/Source/Common/File Class.cpp @@ -82,7 +82,7 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags) ULONG dwCreateFlag = 0; if (nOpenFlags & modeCreate) { - dwCreateFlag = nOpenFlags & modeNoTruncate == 0 ? OPEN_ALWAYS : CREATE_ALWAYS; + dwCreateFlag = nOpenFlags & modeNoTruncate != 0 ? OPEN_ALWAYS : CREATE_ALWAYS; } else { From d9ef1cae17ace6a663147a59c6331bca5cc78e51 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Nov 2015 12:32:49 -0500 Subject: [PATCH 028/102] fixed implicit (but wrong) operator precedence --- Source/Common/File Class.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Common/File Class.cpp b/Source/Common/File Class.cpp index e6ab04651..50416675f 100644 --- a/Source/Common/File Class.cpp +++ b/Source/Common/File Class.cpp @@ -82,7 +82,7 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags) ULONG dwCreateFlag = 0; if (nOpenFlags & modeCreate) { - dwCreateFlag = nOpenFlags & modeNoTruncate != 0 ? OPEN_ALWAYS : CREATE_ALWAYS; + dwCreateFlag = (nOpenFlags & modeNoTruncate) != 0 ? OPEN_ALWAYS : CREATE_ALWAYS; } else { From ade04862f8631e34ed51face5b3e180ff2754266 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Nov 2015 12:43:57 -0500 Subject: [PATCH 029/102] minor clean-ups --- Source/Common/File Class.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Source/Common/File Class.cpp b/Source/Common/File Class.cpp index 50416675f..f2f431bff 100644 --- a/Source/Common/File Class.cpp +++ b/Source/Common/File Class.cpp @@ -79,14 +79,12 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags) sa.bInheritHandle = (nOpenFlags & modeNoInherit) == 0; // map creation flags - ULONG dwCreateFlag = 0; + ULONG dwCreateFlag = OPEN_EXISTING; if (nOpenFlags & modeCreate) { - dwCreateFlag = (nOpenFlags & modeNoTruncate) != 0 ? OPEN_ALWAYS : CREATE_ALWAYS; - } - else - { - dwCreateFlag = OPEN_EXISTING; + dwCreateFlag = + ((nOpenFlags & modeNoTruncate) != 0) + ? OPEN_ALWAYS : CREATE_ALWAYS; } // attempt file creation From 0174bae7a8cb5eea2eb4976e6042a7fc0db8c5b3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 11 Nov 2015 18:08:24 -0500 Subject: [PATCH 030/102] combined fix into a single line --- Source/Common/File Class.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Common/File Class.cpp b/Source/Common/File Class.cpp index f2f431bff..cc73de345 100644 --- a/Source/Common/File Class.cpp +++ b/Source/Common/File Class.cpp @@ -82,9 +82,7 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags) ULONG dwCreateFlag = OPEN_EXISTING; if (nOpenFlags & modeCreate) { - dwCreateFlag = - ((nOpenFlags & modeNoTruncate) != 0) - ? OPEN_ALWAYS : CREATE_ALWAYS; + dwCreateFlag = ((nOpenFlags & modeNoTruncate) != 0) ? OPEN_ALWAYS : CREATE_ALWAYS; } // attempt file creation From 70a368a8618e8d683b9efc4f4a8e5aa229163201 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 17:47:51 +1100 Subject: [PATCH 031/102] [Project64] Clean up N64 Class.cpp --- Source/Project64/N64 System/N64 Class.cpp | 1381 ++++++++++----------- Source/Project64/N64 System/N64 Class.h | 106 +- 2 files changed, 742 insertions(+), 745 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 73013aa41..54f149ba1 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -49,9 +49,9 @@ m_CheatsSlectionChanged(false) { gameHertz = (SystemType() == SYSTEM_PAL) ? 50 : 60; } - m_hPauseEvent = CreateEvent(NULL,true,false,NULL); + m_hPauseEvent = CreateEvent(NULL, true, false, NULL); m_Limitor.SetHertz(gameHertz); - g_Settings->SaveDword(GameRunning_ScreenHertz,gameHertz); + g_Settings->SaveDword(GameRunning_ScreenHertz, gameHertz); m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats), Plugins); } @@ -82,16 +82,16 @@ CN64System::~CN64System() } } -void CN64System::ExternalEvent ( SystemEvent action ) +void CN64System::ExternalEvent(SystemEvent action) { - switch (action) + switch (action) { - case SysEvent_Profile_GenerateLogs: - case SysEvent_Profile_StartStop: - case SysEvent_Profile_ResetLogs: - case SysEvent_ExecuteInterrupt: - case SysEvent_SaveMachineState: - case SysEvent_LoadMachineState: + case SysEvent_Profile_GenerateLogs: + case SysEvent_Profile_StartStop: + case SysEvent_Profile_ResetLogs: + case SysEvent_ExecuteInterrupt: + case SysEvent_SaveMachineState: + case SysEvent_LoadMachineState: case SysEvent_ChangingFullScreen: case SysEvent_GSButtonPressed: case SysEvent_ResetCPU_SoftDone: @@ -103,18 +103,18 @@ void CN64System::ExternalEvent ( SystemEvent action ) case SysEvent_Interrupt_DP: case SysEvent_ResetCPU_Hard: case SysEvent_ResetCPU_Soft: - case SysEvent_CloseCPU: + case SysEvent_CloseCPU: case SysEvent_ChangePlugins: QueueEvent(action); break; - case SysEvent_PauseCPU_FromMenu: - case SysEvent_PauseCPU_AppLostFocus: - case SysEvent_PauseCPU_AppLostActive: - case SysEvent_PauseCPU_SaveGame: - case SysEvent_PauseCPU_LoadGame: - case SysEvent_PauseCPU_DumpMemory: - case SysEvent_PauseCPU_SearchMemory: - case SysEvent_PauseCPU_Settings: + case SysEvent_PauseCPU_FromMenu: + case SysEvent_PauseCPU_AppLostFocus: + case SysEvent_PauseCPU_AppLostActive: + case SysEvent_PauseCPU_SaveGame: + case SysEvent_PauseCPU_LoadGame: + case SysEvent_PauseCPU_DumpMemory: + case SysEvent_PauseCPU_SearchMemory: + case SysEvent_PauseCPU_Settings: case SysEvent_PauseCPU_Cheats: if (!g_Settings->LoadBool(GameRunning_CPU_Paused)) { @@ -126,43 +126,43 @@ void CN64System::ExternalEvent ( SystemEvent action ) SetEvent(m_hPauseEvent); break; case SysEvent_ResumeCPU_AppGainedFocus: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostFocus ) + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostFocus) { SetEvent(m_hPauseEvent); } break; case SysEvent_ResumeCPU_AppGainedActive: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostActive ) + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostActive) { SetEvent(m_hPauseEvent); } break; case SysEvent_ResumeCPU_SaveGame: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SaveGame ) + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SaveGame) { SetEvent(m_hPauseEvent); } break; case SysEvent_ResumeCPU_LoadGame: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_LoadGame ) + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_LoadGame) { SetEvent(m_hPauseEvent); } break; case SysEvent_ResumeCPU_DumpMemory: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_DumpMemory ) + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_DumpMemory) { SetEvent(m_hPauseEvent); } break; case SysEvent_ResumeCPU_SearchMemory: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SearchMemory ) + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SearchMemory) { SetEvent(m_hPauseEvent); } break; case SysEvent_ResumeCPU_Settings: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Settings ) + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Settings) { SetEvent(m_hPauseEvent); } @@ -179,38 +179,38 @@ void CN64System::ExternalEvent ( SystemEvent action ) } } -bool CN64System::RunFileImage ( const char * FileLoc ) +bool CN64System::RunFileImage(const char * FileLoc) { CloseSystem(); if (g_Settings->LoadBool(GameRunning_LoadingInProgress)) { return false; } - g_Settings->SaveBool(GameRunning_LoadingInProgress,true); + g_Settings->SaveBool(GameRunning_LoadingInProgress, true); - WriteTrace(TraceDebug,__FUNCTION__ ": Mark Rom as loading"); + WriteTrace(TraceDebug, __FUNCTION__ ": Mark Rom as loading"); //Mark the rom as loading - g_Settings->SaveBool(GameRunning_LoadingInProgress,true); + g_Settings->SaveBool(GameRunning_LoadingInProgress, true); Notify().RefreshMenu(); //Try to load the passed N64 rom if (g_Rom == NULL) { - WriteTrace(TraceDebug,__FUNCTION__ ": Allocating global rom object"); + WriteTrace(TraceDebug, __FUNCTION__ ": Allocating global rom object"); g_Rom = new CN64Rom(); - } - else + } + else { - WriteTrace(TraceDebug,__FUNCTION__ ": Use existing global rom object"); + WriteTrace(TraceDebug, __FUNCTION__ ": Use existing global rom object"); } - WriteTraceF(TraceDebug,__FUNCTION__ ": Loading \"%s\"",FileLoc); - if (g_Rom->LoadN64Image(FileLoc)) + WriteTraceF(TraceDebug, __FUNCTION__ ": Loading \"%s\"", FileLoc); + if (g_Rom->LoadN64Image(FileLoc)) { g_System->RefreshGameSettings(); - WriteTrace(TraceDebug,__FUNCTION__ ": Add Recent Rom"); + WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); Notify().AddRecentRom(FileLoc); Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); @@ -219,7 +219,7 @@ bool CN64System::RunFileImage ( const char * FileLoc ) if (g_Settings->LoadDword(Setting_AutoStart) != 0) { - g_BaseSystem = new CN64System(g_Plugins,false); + g_BaseSystem = new CN64System(g_Plugins, false); if (g_BaseSystem) { g_BaseSystem->StartEmulation(true); @@ -228,11 +228,11 @@ bool CN64System::RunFileImage ( const char * FileLoc ) } else { - WriteTraceF(TraceError,__FUNCTION__ ": LoadN64Image failed (\"%s\")",FileLoc); + WriteTraceF(TraceError, __FUNCTION__ ": LoadN64Image failed (\"%s\")", FileLoc); g_Notify->DisplayError(g_Rom->GetError()); delete g_Rom; g_Rom = NULL; - g_Settings->SaveBool(GameRunning_LoadingInProgress,false); + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); Notify().RefreshMenu(); return false; } @@ -249,52 +249,52 @@ void CN64System::CloseSystem() } } -bool CN64System::EmulationStarting ( HANDLE hThread, DWORD ThreadId ) +bool CN64System::EmulationStarting(HANDLE hThread, DWORD ThreadId) { bool bRes = true; WriteTrace(TraceDebug, __FUNCTION__ ": Setting N64 system as active"); if (g_BaseSystem->SetActiveSystem(true)) { - g_BaseSystem->m_CPU_Handle = hThread; + g_BaseSystem->m_CPU_Handle = hThread; g_BaseSystem->m_CPU_ThreadID = ThreadId; - WriteTrace(TraceDebug,__FUNCTION__ ": Setting up N64 system done"); - g_Settings->SaveBool(GameRunning_LoadingInProgress,false); + WriteTrace(TraceDebug, __FUNCTION__ ": Setting up N64 system done"); + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); Notify().RefreshMenu(); try { - WriteTrace(TraceDebug,__FUNCTION__ ": Game set to auto start, starting"); - g_BaseSystem->StartEmulation2(false); - WriteTrace(TraceDebug,__FUNCTION__ ": Game Done"); - } + WriteTrace(TraceDebug, __FUNCTION__ ": Game set to auto start, starting"); + g_BaseSystem->StartEmulation2(false); + WriteTrace(TraceDebug, __FUNCTION__ ": Game Done"); + } catch (...) { - WriteTraceF(TraceError,__FUNCTION__ ": Exception caught\nFile: %s\nLine: %d",__FILE__,__LINE__); + WriteTraceF(TraceError, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); char Message[600]; - sprintf(Message,__FUNCTION__ ": Exception caught\nFile: %s\nLine: %d",__FILE__,__LINE__); - MessageBox(NULL,Message,"Exception",MB_OK); + sprintf(Message, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); + MessageBox(NULL, Message, "Exception", MB_OK); } } - else + else { - WriteTrace(TraceError,__FUNCTION__ ": SetActiveSystem failed"); + WriteTrace(TraceError, __FUNCTION__ ": SetActiveSystem failed"); g_Notify->DisplayError(__FUNCTIONW__ L": Failed to Initialize N64 System"); - g_Settings->SaveBool(GameRunning_LoadingInProgress,false); + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); Notify().RefreshMenu(); bRes = false; } return bRes; } - -void CN64System::StartEmulation2 ( bool NewThread ) + +void CN64System::StartEmulation2(bool NewThread) { if (NewThread) { - WriteTrace(TraceDebug,__FUNCTION__ ": Starting"); + WriteTrace(TraceDebug, __FUNCTION__ ": Starting"); Notify().HideRomBrowser(); - if (bHaveDebugger()) + if (bHaveDebugger()) { g_LogOptions.GenerateLog = g_Settings->LoadBool(Debugger_GenerateDebugLog); LoadLogOptions(&g_LogOptions, FALSE); @@ -305,7 +305,7 @@ void CN64System::StartEmulation2 ( bool NewThread ) DWORD CpuType = g_Settings->LoadDword(Game_CpuType); - if(CpuType == CPU_SyncCores && !g_Settings->LoadBool(Debugger_Enabled)) + if (CpuType == CPU_SyncCores && !g_Settings->LoadBool(Debugger_Enabled)) { g_Settings->SaveDword(Game_CpuType, CPU_Recompiler); CpuType = CPU_Recompiler; @@ -313,12 +313,12 @@ void CN64System::StartEmulation2 ( bool NewThread ) if (CpuType == CPU_SyncCores) { - g_Notify->DisplayMessage(5,L"Copy Plugins"); + g_Notify->DisplayMessage(5, L"Copy Plugins"); g_Plugins->CopyPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); #if defined(WINDOWS_UI) m_SyncWindow = new CMainGui(false); - m_SyncPlugins = new CPlugins( g_Settings->LoadStringVal(Directory_PluginSync) ); - m_SyncPlugins->SetRenderWindows(m_SyncWindow,m_SyncWindow); + m_SyncPlugins = new CPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); + m_SyncPlugins->SetRenderWindows(m_SyncWindow, m_SyncWindow); m_SyncCPU = new CN64System(m_SyncPlugins, true); #else @@ -328,7 +328,7 @@ void CN64System::StartEmulation2 ( bool NewThread ) if (CpuType == CPU_Recompiler || CpuType == CPU_SyncCores) { - m_Recomp = new CRecompiler(m_Reg,m_Profile,m_EndEmulation); + m_Recomp = new CRecompiler(m_Reg, m_Profile, m_EndEmulation); } bool bSetActive = true; @@ -344,7 +344,7 @@ void CN64System::StartEmulation2 ( bool NewThread ) if (!bSetActive) { - g_Settings->SaveBool(GameRunning_LoadingInProgress,false); + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); g_Notify->DisplayError(MSG_PLUGIN_NOT_INIT); Notify().RefreshMenu(); @@ -360,23 +360,23 @@ void CN64System::StartEmulation2 ( bool NewThread ) //create the needed info into a structure to pass as one parameter //for creating a thread Info->ThreadHandle = hThread; - - *hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)StartEmulationThread,Info,0, &Info->ThreadID); + + *hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)StartEmulationThread, Info, 0, &Info->ThreadID); } - else + else { //mark the emulation as starting and fix up menus - g_Notify->DisplayMessage(5,MSG_EMULATION_STARTED); + g_Notify->DisplayMessage(5, MSG_EMULATION_STARTED); - if (g_Settings->LoadBool(Setting_AutoFullscreen)) + if (g_Settings->LoadBool(Setting_AutoFullscreen)) { - WriteTrace(TraceDebug,__FUNCTION__ " 15"); + WriteTrace(TraceDebug, __FUNCTION__ " 15"); CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str()); stdstr Status = g_Settings->LoadStringVal(Rdb_Status); char String[100]; - RomIniFile.GetString("Rom Status",stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(),"true",String,sizeof(String)); - if (_stricmp(String,"true") == 0) + RomIniFile.GetString("Rom Status", stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(), "true", String, sizeof(String)); + if (_stricmp(String, "true") == 0) { Notify().ChangeFullScreen(); } @@ -385,25 +385,25 @@ void CN64System::StartEmulation2 ( bool NewThread ) } } -void CN64System::StartEmulation ( bool NewThread ) +void CN64System::StartEmulation(bool NewThread) { - __try + __try { StartEmulation2(NewThread); } - __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation())) + __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) { char Message[600]; - sprintf(Message,"Exception caught\nFile: %s\nLine: %d",__FILE__,__LINE__); - MessageBox(NULL,Message,"Exception",MB_OK); + sprintf(Message, "Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); + MessageBox(NULL, Message, "Exception", MB_OK); } } -void CN64System::StartEmulationThread ( ThreadInfo * Info ) +void CN64System::StartEmulationThread(ThreadInfo * Info) { CoInitialize(NULL); - - EmulationStarting(*Info->ThreadHandle,Info->ThreadID); + + EmulationStarting(*Info->ThreadHandle, Info->ThreadID); delete Info->ThreadHandle; delete Info; @@ -412,9 +412,9 @@ void CN64System::StartEmulationThread ( ThreadInfo * Info ) void CN64System::CloseCpu() { - if (m_CPU_Handle == NULL) + if (m_CPU_Handle == NULL) { - return; + return; } m_EndEmulation = true; @@ -422,26 +422,26 @@ void CN64System::CloseCpu() { SetEvent(m_hPauseEvent); } - + if (GetCurrentThreadId() == m_CPU_ThreadID) { ExternalEvent(SysEvent_CloseCPU); return; } - + HANDLE hThread = m_CPU_Handle; - for (int count = 0; count < 200; count ++ ) + for (int count = 0; count < 200; count++) { Sleep(100); if (Notify().ProcessGuiMessages()) { return; } - + DWORD ExitCode; - if (GetExitCodeThread(hThread,&ExitCode)) + if (GetExitCodeThread(hThread, &ExitCode)) { - if (ExitCode != STILL_ACTIVE) + if (ExitCode != STILL_ACTIVE) { break; } @@ -449,21 +449,21 @@ void CN64System::CloseCpu() } if (hThread) - { + { DWORD ExitCode; - GetExitCodeThread(hThread,&ExitCode); - if (ExitCode == STILL_ACTIVE) + GetExitCodeThread(hThread, &ExitCode); + if (ExitCode == STILL_ACTIVE) { - TerminateThread(hThread,0); + TerminateThread(hThread, 0); } } CpuStopped(); } -void CN64System::DisplayRomInfo ( HWND hParent ) +void CN64System::DisplayRomInfo(HWND hParent) { if (!g_Rom) { return; } - + RomInformation Info(g_Rom); Info.DisplayInformation(hParent); } @@ -475,36 +475,36 @@ void CN64System::Pause() return; } ResetEvent(m_hPauseEvent); - g_Settings->SaveBool(GameRunning_CPU_Paused,true); + g_Settings->SaveBool(GameRunning_CPU_Paused, true); Notify().RefreshMenu(); - g_Notify->DisplayMessage(5,MSG_CPU_PAUSED); + g_Notify->DisplayMessage(5, MSG_CPU_PAUSED); WaitForSingleObject(m_hPauseEvent, INFINITE); ResetEvent(m_hPauseEvent); - g_Settings->SaveBool(GameRunning_CPU_Paused,(DWORD)false); + g_Settings->SaveBool(GameRunning_CPU_Paused, (DWORD)false); Notify().RefreshMenu(); Notify().DisplayMessage(5, MSG_CPU_RESUMED); } -stdstr CN64System::ChooseFileToOpen ( HWND hParent ) +stdstr CN64System::ChooseFileToOpen(HWND hParent) { OPENFILENAME openfilename; - char FileName[_MAX_PATH],Directory[_MAX_PATH]; + char FileName[_MAX_PATH], Directory[_MAX_PATH]; memset(&FileName, 0, sizeof(FileName)); memset(&openfilename, 0, sizeof(openfilename)); - strcpy(Directory,g_Settings->LoadStringVal(Directory_Game).c_str()); + strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str()); - openfilename.lStructSize = sizeof( openfilename ); - openfilename.hwndOwner = (HWND)hParent; + openfilename.lStructSize = sizeof(openfilename); + openfilename.hwndOwner = (HWND)hParent; openfilename.lpstrFilter = "N64 ROMs (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0"; - openfilename.lpstrFile = FileName; - openfilename.lpstrInitialDir = Directory; - openfilename.nMaxFile = MAX_PATH; - openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + openfilename.lpstrFile = FileName; + openfilename.lpstrInitialDir = Directory; + openfilename.nMaxFile = MAX_PATH; + openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - if (GetOpenFileName (&openfilename)) - { + if (GetOpenFileName(&openfilename)) + { return stdstr(FileName); } return stdstr(""); @@ -512,7 +512,7 @@ stdstr CN64System::ChooseFileToOpen ( HWND hParent ) void CN64System::GameReset() { - m_SystemTimer.SetTimer(CSystemTimer::SoftResetTimer,0x3000000,false); + m_SystemTimer.SetTimer(CSystemTimer::SoftResetTimer, 0x3000000, false); m_Plugins->Gfx()->ShowCFB(); m_Reg.FAKE_CAUSE_REGISTER |= CAUSE_IP4; m_Plugins->Gfx()->SoftReset(); @@ -526,7 +526,7 @@ void CN64System::PluginReset() { if (!m_Plugins->ResetInUiThread(this)) { - g_Notify->DisplayMessage(5,MSG_PLUGIN_NOT_INIT); + g_Notify->DisplayMessage(5, MSG_PLUGIN_NOT_INIT); if (g_BaseSystem) { g_BaseSystem->m_EndEmulation = true; @@ -536,7 +536,7 @@ void CN64System::PluginReset() { if (!m_SyncCPU->m_Plugins->ResetInUiThread(m_SyncCPU)) { - g_Notify->DisplayMessage(5,MSG_PLUGIN_NOT_INIT); + g_Notify->DisplayMessage(5, MSG_PLUGIN_NOT_INIT); if (g_BaseSystem) { g_BaseSystem->m_EndEmulation = true; @@ -558,23 +558,23 @@ void CN64System::PluginReset() #endif } -void CN64System::Reset (bool bInitReg, bool ClearMenory) +void CN64System::Reset(bool bInitReg, bool ClearMenory) { - g_Settings->SaveBool(GameRunning_InReset,true); + g_Settings->SaveBool(GameRunning_InReset, true); RefreshGameSettings(); m_Audio.Reset(); m_MMU_VM.Reset(ClearMenory); Mempak::Close(); m_CyclesToSkip = 0; - m_AlistCount = 0; - m_DlistCount = 0; + m_AlistCount = 0; + m_DlistCount = 0; m_UnknownCount = 0; - m_DMAUsed = false; - m_RspBroke = true; - m_SyncCount = 0; + m_DMAUsed = false; + m_RspBroke = true; + m_SyncCount = 0; - for (int i = 0, n = (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])); i < n; i++) + for (int i = 0, n = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i < n; i++) { m_LastSuccessSyncPC[i] = 0; } @@ -582,20 +582,20 @@ void CN64System::Reset (bool bInitReg, bool ClearMenory) if (bInitReg) { bool PostPif = true; - - InitRegisters(PostPif,m_MMU_VM); - if (PostPif) + + InitRegisters(PostPif, m_MMU_VM); + if (PostPif) { - memcpy((m_MMU_VM.Dmem()+0x40), (g_Rom->GetRomAddress() + 0x040), 0xFBC); + memcpy((m_MMU_VM.Dmem() + 0x40), (g_Rom->GetRomAddress() + 0x040), 0xFBC); } } - else + else { m_Reg.Reset(); } m_SystemTimer.Reset(); - m_SystemTimer.SetTimer(CSystemTimer::CompareTimer,m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER,false); + m_SystemTimer.SetTimer(CSystemTimer::CompareTimer, m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER, false); if (m_Recomp) { @@ -604,12 +604,12 @@ void CN64System::Reset (bool bInitReg, bool ClearMenory) if (m_Plugins) { m_Plugins->GameReset(); } if (m_SyncCPU) { - m_SyncCPU->Reset(bInitReg,ClearMenory); + m_SyncCPU->Reset(bInitReg, ClearMenory); } - g_Settings->SaveBool(GameRunning_InReset,true); + g_Settings->SaveBool(GameRunning_InReset, true); } -bool CN64System::SetActiveSystem( bool bActive ) +bool CN64System::SetActiveSystem(bool bActive) { bool bInitPlugin = false; bool bReset = false; @@ -621,7 +621,7 @@ bool CN64System::SetActiveSystem( bool bActive ) } if (bActive) - { + { m_Reg.SetAsCurrentSystem(); if (g_System) @@ -631,21 +631,21 @@ bool CN64System::SetActiveSystem( bool bActive ) g_System->m_JumpToLocation = R4300iOp::m_JumpToLocation; } - g_System = this; + g_System = this; if (g_BaseSystem == this) { - g_SyncSystem = m_SyncCPU; + g_SyncSystem = m_SyncCPU; } - g_Recompiler = m_Recomp; - g_MMU = &m_MMU_VM; - g_TLB = &m_TLB; - g_Reg = &m_Reg; - g_Audio = &m_Audio; - g_SystemTimer = &m_SystemTimer; - g_TransVaddr = &m_MMU_VM; + g_Recompiler = m_Recomp; + g_MMU = &m_MMU_VM; + g_TLB = &m_TLB; + g_Reg = &m_Reg; + g_Audio = &m_Audio; + g_SystemTimer = &m_SystemTimer; + g_TransVaddr = &m_MMU_VM; g_SystemEvents = this; - g_NextTimer = &m_NextTimer; - g_Plugins = m_Plugins; + g_NextTimer = &m_NextTimer; + g_Plugins = m_Plugins; g_TLBLoadAddress = &m_TLBLoadAddress; g_TLBStoreAddress = &m_TLBStoreAddress; R4300iOp::m_TestTimer = m_TestTimer; @@ -667,27 +667,27 @@ bool CN64System::SetActiveSystem( bool bActive ) { if (this == g_BaseSystem) { - g_System = NULL; - g_SyncSystem = NULL; - g_Recompiler = NULL; - g_MMU = NULL; - g_TLB = NULL; - g_Reg = NULL; - g_Audio = NULL; - g_SystemTimer = NULL; - g_TransVaddr = NULL; - g_SystemEvents = NULL; - g_NextTimer = NULL; - g_Plugins = m_Plugins; - g_TLBLoadAddress = NULL; + g_System = NULL; + g_SyncSystem = NULL; + g_Recompiler = NULL; + g_MMU = NULL; + g_TLB = NULL; + g_Reg = NULL; + g_Audio = NULL; + g_SystemTimer = NULL; + g_TransVaddr = NULL; + g_SystemEvents = NULL; + g_NextTimer = NULL; + g_Plugins = m_Plugins; + g_TLBLoadAddress = NULL; g_TLBStoreAddress = NULL; } } if (bInitPlugin) { - WriteTrace(TraceDebug,__FUNCTION__ ": Reseting Plugins"); - g_Notify->DisplayMessage(5,MSG_PLUGIN_INIT); + WriteTrace(TraceDebug, __FUNCTION__ ": Reseting Plugins"); + g_Notify->DisplayMessage(5, MSG_PLUGIN_INIT); m_Plugins->CreatePlugins(); bRes = m_Plugins->Initiate(this); if (!bRes) @@ -698,53 +698,53 @@ bool CN64System::SetActiveSystem( bool bActive ) if (bReset) { - Reset(true,true); + Reset(true, true); } return bRes; } -void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU ) +void CN64System::InitRegisters(bool bPostPif, CMipsMemory & MMU) { m_Reg.Reset(); //COP0 Registers - m_Reg.RANDOM_REGISTER = 0x1F; - m_Reg.COUNT_REGISTER = 0x5000; - m_Reg.MI_VERSION_REG = 0x02020102; - m_Reg.SP_STATUS_REG = 0x00000001; - m_Reg.CAUSE_REGISTER = 0x0000005C; - m_Reg.CONTEXT_REGISTER = 0x007FFFF0; - m_Reg.EPC_REGISTER = 0xFFFFFFFF; - m_Reg.BAD_VADDR_REGISTER = 0xFFFFFFFF; - m_Reg.ERROREPC_REGISTER = 0xFFFFFFFF; - m_Reg.CONFIG_REGISTER = 0x0006E463; - m_Reg.STATUS_REGISTER = 0x34000000; + m_Reg.RANDOM_REGISTER = 0x1F; + m_Reg.COUNT_REGISTER = 0x5000; + m_Reg.MI_VERSION_REG = 0x02020102; + m_Reg.SP_STATUS_REG = 0x00000001; + m_Reg.CAUSE_REGISTER = 0x0000005C; + m_Reg.CONTEXT_REGISTER = 0x007FFFF0; + m_Reg.EPC_REGISTER = 0xFFFFFFFF; + m_Reg.BAD_VADDR_REGISTER = 0xFFFFFFFF; + m_Reg.ERROREPC_REGISTER = 0xFFFFFFFF; + m_Reg.CONFIG_REGISTER = 0x0006E463; + m_Reg.STATUS_REGISTER = 0x34000000; //m_Reg.REVISION_REGISTER = 0x00000511; m_Reg.FixFpuLocations(); - if (bPostPif) + if (bPostPif) { - m_Reg.m_PROGRAM_COUNTER = 0xA4000040; - - m_Reg.m_GPR[0].DW=0x0000000000000000; - m_Reg.m_GPR[6].DW=0xFFFFFFFFA4001F0C; - m_Reg.m_GPR[7].DW=0xFFFFFFFFA4001F08; - m_Reg.m_GPR[8].DW=0x00000000000000C0; - m_Reg.m_GPR[9].DW=0x0000000000000000; - m_Reg.m_GPR[10].DW=0x0000000000000040; - m_Reg.m_GPR[11].DW=0xFFFFFFFFA4000040; - m_Reg.m_GPR[16].DW=0x0000000000000000; - m_Reg.m_GPR[17].DW=0x0000000000000000; - m_Reg.m_GPR[18].DW=0x0000000000000000; - m_Reg.m_GPR[19].DW=0x0000000000000000; - m_Reg.m_GPR[21].DW=0x0000000000000000; - m_Reg.m_GPR[26].DW=0x0000000000000000; - m_Reg.m_GPR[27].DW=0x0000000000000000; - m_Reg.m_GPR[28].DW=0x0000000000000000; - m_Reg.m_GPR[29].DW=0xFFFFFFFFA4001FF0; - m_Reg.m_GPR[30].DW=0x0000000000000000; - + m_Reg.m_PROGRAM_COUNTER = 0xA4000040; + + m_Reg.m_GPR[0].DW = 0x0000000000000000; + m_Reg.m_GPR[6].DW = 0xFFFFFFFFA4001F0C; + m_Reg.m_GPR[7].DW = 0xFFFFFFFFA4001F08; + m_Reg.m_GPR[8].DW = 0x00000000000000C0; + m_Reg.m_GPR[9].DW = 0x0000000000000000; + m_Reg.m_GPR[10].DW = 0x0000000000000040; + m_Reg.m_GPR[11].DW = 0xFFFFFFFFA4000040; + m_Reg.m_GPR[16].DW = 0x0000000000000000; + m_Reg.m_GPR[17].DW = 0x0000000000000000; + m_Reg.m_GPR[18].DW = 0x0000000000000000; + m_Reg.m_GPR[19].DW = 0x0000000000000000; + m_Reg.m_GPR[21].DW = 0x0000000000000000; + m_Reg.m_GPR[26].DW = 0x0000000000000000; + m_Reg.m_GPR[27].DW = 0x0000000000000000; + m_Reg.m_GPR[28].DW = 0x0000000000000000; + m_Reg.m_GPR[29].DW = 0xFFFFFFFFA4001FF0; + m_Reg.m_GPR[30].DW = 0x0000000000000000; + switch (g_Rom->GetCountry()) { case Germany: case french: case Italian: @@ -754,145 +754,145 @@ void CN64System::InitRegisters( bool bPostPif, CMipsMemory & MMU ) { case CIC_UNKNOWN: case CIC_NUS_6102: - m_Reg.m_GPR[5].DW=0xFFFFFFFFC0F1D859; - m_Reg.m_GPR[14].DW=0x000000002DE108EA; - m_Reg.m_GPR[24].DW=0x0000000000000000; + m_Reg.m_GPR[5].DW = 0xFFFFFFFFC0F1D859; + m_Reg.m_GPR[14].DW = 0x000000002DE108EA; + m_Reg.m_GPR[24].DW = 0x0000000000000000; break; case CIC_NUS_6103: - m_Reg.m_GPR[5].DW=0xFFFFFFFFD4646273; - m_Reg.m_GPR[14].DW=0x000000001AF99984; - m_Reg.m_GPR[24].DW=0x0000000000000000; + m_Reg.m_GPR[5].DW = 0xFFFFFFFFD4646273; + m_Reg.m_GPR[14].DW = 0x000000001AF99984; + m_Reg.m_GPR[24].DW = 0x0000000000000000; break; case CIC_NUS_6105: - MMU.SW_VAddr(0xA4001004,0xBDA807FC); - m_Reg.m_GPR[5].DW=0xFFFFFFFFDECAAAD1; - m_Reg.m_GPR[14].DW=0x000000000CF85C13; - m_Reg.m_GPR[24].DW=0x0000000000000002; + MMU.SW_VAddr(0xA4001004, 0xBDA807FC); + m_Reg.m_GPR[5].DW = 0xFFFFFFFFDECAAAD1; + m_Reg.m_GPR[14].DW = 0x000000000CF85C13; + m_Reg.m_GPR[24].DW = 0x0000000000000002; break; case CIC_NUS_6106: - m_Reg.m_GPR[5].DW=0xFFFFFFFFB04DC903; - m_Reg.m_GPR[14].DW=0x000000001AF99984; - m_Reg.m_GPR[24].DW=0x0000000000000002; + m_Reg.m_GPR[5].DW = 0xFFFFFFFFB04DC903; + m_Reg.m_GPR[14].DW = 0x000000001AF99984; + m_Reg.m_GPR[24].DW = 0x0000000000000002; break; } - m_Reg.m_GPR[20].DW=0x0000000000000000; - m_Reg.m_GPR[23].DW=0x0000000000000006; - m_Reg.m_GPR[31].DW=0xFFFFFFFFA4001554; + m_Reg.m_GPR[20].DW = 0x0000000000000000; + m_Reg.m_GPR[23].DW = 0x0000000000000006; + m_Reg.m_GPR[31].DW = 0xFFFFFFFFA4001554; break; case NTSC_BETA: case X_NTSC: case USA: case Japan: default: - switch (g_Rom->CicChipID()) + switch (g_Rom->CicChipID()) { case CIC_UNKNOWN: case CIC_NUS_6102: - m_Reg.m_GPR[5].DW=0xFFFFFFFFC95973D5; - m_Reg.m_GPR[14].DW=0x000000002449A366; + m_Reg.m_GPR[5].DW = 0xFFFFFFFFC95973D5; + m_Reg.m_GPR[14].DW = 0x000000002449A366; break; case CIC_NUS_6103: - m_Reg.m_GPR[5].DW=0xFFFFFFFF95315A28; - m_Reg.m_GPR[14].DW=0x000000005BACA1DF; + m_Reg.m_GPR[5].DW = 0xFFFFFFFF95315A28; + m_Reg.m_GPR[14].DW = 0x000000005BACA1DF; break; case CIC_NUS_6105: - MMU.SW_VAddr(0xA4001004,0x8DA807FC); - m_Reg.m_GPR[5].DW=0x000000005493FB9A; - m_Reg.m_GPR[14].DW=0xFFFFFFFFC2C20384; + MMU.SW_VAddr(0xA4001004, 0x8DA807FC); + m_Reg.m_GPR[5].DW = 0x000000005493FB9A; + m_Reg.m_GPR[14].DW = 0xFFFFFFFFC2C20384; case CIC_NUS_6106: - m_Reg.m_GPR[5].DW=0xFFFFFFFFE067221F; - m_Reg.m_GPR[14].DW=0x000000005CD2B70F; + m_Reg.m_GPR[5].DW = 0xFFFFFFFFE067221F; + m_Reg.m_GPR[14].DW = 0x000000005CD2B70F; break; } - m_Reg.m_GPR[20].DW=0x0000000000000001; - m_Reg.m_GPR[23].DW=0x0000000000000000; - m_Reg.m_GPR[24].DW=0x0000000000000003; - m_Reg.m_GPR[31].DW=0xFFFFFFFFA4001550; + m_Reg.m_GPR[20].DW = 0x0000000000000001; + m_Reg.m_GPR[23].DW = 0x0000000000000000; + m_Reg.m_GPR[24].DW = 0x0000000000000003; + m_Reg.m_GPR[31].DW = 0xFFFFFFFFA4001550; } switch (g_Rom->CicChipID()) { - case CIC_NUS_6101: - m_Reg.m_GPR[22].DW=0x000000000000003F; + case CIC_NUS_6101: + m_Reg.m_GPR[22].DW = 0x000000000000003F; break; case CIC_NUS_8303: //64DD IPL CIC case CIC_NUS_5167: //64DD CONVERSION CIC - m_Reg.m_GPR[22].DW=0x00000000000000DD; + m_Reg.m_GPR[22].DW = 0x00000000000000DD; break; case CIC_UNKNOWN: - case CIC_NUS_6102: - m_Reg.m_GPR[1].DW=0x0000000000000001; - m_Reg.m_GPR[2].DW=0x000000000EBDA536; - m_Reg.m_GPR[3].DW=0x000000000EBDA536; - m_Reg.m_GPR[4].DW=0x000000000000A536; - m_Reg.m_GPR[12].DW=0xFFFFFFFFED10D0B3; - m_Reg.m_GPR[13].DW=0x000000001402A4CC; - m_Reg.m_GPR[15].DW=0x000000003103E121; - m_Reg.m_GPR[22].DW=0x000000000000003F; - m_Reg.m_GPR[25].DW=0xFFFFFFFF9DEBB54F; + case CIC_NUS_6102: + m_Reg.m_GPR[1].DW = 0x0000000000000001; + m_Reg.m_GPR[2].DW = 0x000000000EBDA536; + m_Reg.m_GPR[3].DW = 0x000000000EBDA536; + m_Reg.m_GPR[4].DW = 0x000000000000A536; + m_Reg.m_GPR[12].DW = 0xFFFFFFFFED10D0B3; + m_Reg.m_GPR[13].DW = 0x000000001402A4CC; + m_Reg.m_GPR[15].DW = 0x000000003103E121; + m_Reg.m_GPR[22].DW = 0x000000000000003F; + m_Reg.m_GPR[25].DW = 0xFFFFFFFF9DEBB54F; break; - case CIC_NUS_6103: - m_Reg.m_GPR[1].DW=0x0000000000000001; - m_Reg.m_GPR[2].DW=0x0000000049A5EE96; - m_Reg.m_GPR[3].DW=0x0000000049A5EE96; - m_Reg.m_GPR[4].DW=0x000000000000EE96; - m_Reg.m_GPR[12].DW=0xFFFFFFFFCE9DFBF7; - m_Reg.m_GPR[13].DW=0xFFFFFFFFCE9DFBF7; - m_Reg.m_GPR[15].DW=0x0000000018B63D28; - m_Reg.m_GPR[22].DW=0x0000000000000078; - m_Reg.m_GPR[25].DW=0xFFFFFFFF825B21C9; + case CIC_NUS_6103: + m_Reg.m_GPR[1].DW = 0x0000000000000001; + m_Reg.m_GPR[2].DW = 0x0000000049A5EE96; + m_Reg.m_GPR[3].DW = 0x0000000049A5EE96; + m_Reg.m_GPR[4].DW = 0x000000000000EE96; + m_Reg.m_GPR[12].DW = 0xFFFFFFFFCE9DFBF7; + m_Reg.m_GPR[13].DW = 0xFFFFFFFFCE9DFBF7; + m_Reg.m_GPR[15].DW = 0x0000000018B63D28; + m_Reg.m_GPR[22].DW = 0x0000000000000078; + m_Reg.m_GPR[25].DW = 0xFFFFFFFF825B21C9; break; - case CIC_NUS_6105: - MMU.SW_VAddr(0xA4001000,0x3C0DBFC0); - MMU.SW_VAddr(0xA4001008,0x25AD07C0); - MMU.SW_VAddr(0xA400100C,0x31080080); - MMU.SW_VAddr(0xA4001010,0x5500FFFC); - MMU.SW_VAddr(0xA4001014,0x3C0DBFC0); - MMU.SW_VAddr(0xA4001018,0x8DA80024); - MMU.SW_VAddr(0xA400101C,0x3C0BB000); - m_Reg.m_GPR[1].DW=0x0000000000000000; - m_Reg.m_GPR[2].DW=0xFFFFFFFFF58B0FBF; - m_Reg.m_GPR[3].DW=0xFFFFFFFFF58B0FBF; - m_Reg.m_GPR[4].DW=0x0000000000000FBF; - m_Reg.m_GPR[12].DW=0xFFFFFFFF9651F81E; - m_Reg.m_GPR[13].DW=0x000000002D42AAC5; - m_Reg.m_GPR[15].DW=0x0000000056584D60; - m_Reg.m_GPR[22].DW=0x0000000000000091; - m_Reg.m_GPR[25].DW=0xFFFFFFFFCDCE565F; + case CIC_NUS_6105: + MMU.SW_VAddr(0xA4001000, 0x3C0DBFC0); + MMU.SW_VAddr(0xA4001008, 0x25AD07C0); + MMU.SW_VAddr(0xA400100C, 0x31080080); + MMU.SW_VAddr(0xA4001010, 0x5500FFFC); + MMU.SW_VAddr(0xA4001014, 0x3C0DBFC0); + MMU.SW_VAddr(0xA4001018, 0x8DA80024); + MMU.SW_VAddr(0xA400101C, 0x3C0BB000); + m_Reg.m_GPR[1].DW = 0x0000000000000000; + m_Reg.m_GPR[2].DW = 0xFFFFFFFFF58B0FBF; + m_Reg.m_GPR[3].DW = 0xFFFFFFFFF58B0FBF; + m_Reg.m_GPR[4].DW = 0x0000000000000FBF; + m_Reg.m_GPR[12].DW = 0xFFFFFFFF9651F81E; + m_Reg.m_GPR[13].DW = 0x000000002D42AAC5; + m_Reg.m_GPR[15].DW = 0x0000000056584D60; + m_Reg.m_GPR[22].DW = 0x0000000000000091; + m_Reg.m_GPR[25].DW = 0xFFFFFFFFCDCE565F; break; - case CIC_NUS_6106: - m_Reg.m_GPR[1].DW=0x0000000000000000; - m_Reg.m_GPR[2].DW=0xFFFFFFFFA95930A4; - m_Reg.m_GPR[3].DW=0xFFFFFFFFA95930A4; - m_Reg.m_GPR[4].DW=0x00000000000030A4; - m_Reg.m_GPR[12].DW=0xFFFFFFFFBCB59510; - m_Reg.m_GPR[13].DW=0xFFFFFFFFBCB59510; - m_Reg.m_GPR[15].DW=0x000000007A3C07F4; - m_Reg.m_GPR[22].DW=0x0000000000000085; - m_Reg.m_GPR[25].DW=0x00000000465E3F72; + case CIC_NUS_6106: + m_Reg.m_GPR[1].DW = 0x0000000000000000; + m_Reg.m_GPR[2].DW = 0xFFFFFFFFA95930A4; + m_Reg.m_GPR[3].DW = 0xFFFFFFFFA95930A4; + m_Reg.m_GPR[4].DW = 0x00000000000030A4; + m_Reg.m_GPR[12].DW = 0xFFFFFFFFBCB59510; + m_Reg.m_GPR[13].DW = 0xFFFFFFFFBCB59510; + m_Reg.m_GPR[15].DW = 0x000000007A3C07F4; + m_Reg.m_GPR[22].DW = 0x0000000000000085; + m_Reg.m_GPR[25].DW = 0x00000000465E3F72; break; } } else { - m_Reg.m_PROGRAM_COUNTER = 0xBFC00000; -/* PIF_Ram[36] = 0x00; PIF_Ram[39] = 0x3F; //common pif ram start values + m_Reg.m_PROGRAM_COUNTER = 0xBFC00000; + /* PIF_Ram[36] = 0x00; PIF_Ram[39] = 0x3F; //common pif ram start values - switch (g_Rom->CicChipID()) { - case CIC_NUS_6101: PIF_Ram[37] = 0x06; PIF_Ram[38] = 0x3F; break; - case CIC_UNKNOWN: - case CIC_NUS_6102: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x3F; break; - case CIC_NUS_6103: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x78; break; - case CIC_NUS_6105: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x91; break; - case CIC_NUS_6106: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x85; break; - }*/ + switch (g_Rom->CicChipID()) { + case CIC_NUS_6101: PIF_Ram[37] = 0x06; PIF_Ram[38] = 0x3F; break; + case CIC_UNKNOWN: + case CIC_NUS_6102: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x3F; break; + case CIC_NUS_6103: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x78; break; + case CIC_NUS_6105: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x91; break; + case CIC_NUS_6106: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x85; break; + }*/ } } void CN64System::ExecuteCPU() { //reset code - g_Settings->SaveBool(GameRunning_CPU_Running,true); - g_Settings->SaveBool(GameRunning_CPU_Paused,false); - g_Notify->DisplayMessage(5,MSG_EMULATION_STARTED); - + g_Settings->SaveBool(GameRunning_CPU_Running, true); + g_Settings->SaveBool(GameRunning_CPU_Paused, false); + g_Notify->DisplayMessage(5, MSG_EMULATION_STARTED); + m_EndEmulation = false; Notify().RefreshMenu(); @@ -907,14 +907,14 @@ 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. + // 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); + g_Settings->SaveBool(GameRunning_CPU_Running, (DWORD)false); Notify().WindowMode(); m_Plugins->RomClosed(); if (m_SyncCPU) @@ -930,7 +930,7 @@ void CN64System::ExecuteInterpret() } void CN64System::ExecuteRecompiler() -{ +{ m_Recomp->Run(); } @@ -942,7 +942,7 @@ void CN64System::ExecuteSyncCPU() void CN64System::CpuStopped() { - g_Settings->SaveBool(GameRunning_CPU_Running,(DWORD)false); + g_Settings->SaveBool(GameRunning_CPU_Running, (DWORD)false); Notify().WindowMode(); if (!m_InReset) { @@ -954,11 +954,11 @@ void CN64System::CpuStopped() Notify().RefreshMenu(); Notify().MakeWindowOnTop(false); - g_Notify->DisplayMessage(5,MSG_EMULATION_ENDED); + g_Notify->DisplayMessage(5, MSG_EMULATION_ENDED); if (g_Settings->LoadDword(RomBrowser_Enabled)) { Notify().ShowRomBrowser(); - } + } } if (m_SyncCPU) { @@ -966,30 +966,30 @@ void CN64System::CpuStopped() } } -void CN64System::UpdateSyncCPU (CN64System * const SecondCPU, DWORD const Cycles) +void CN64System::UpdateSyncCPU(CN64System * const SecondCPU, DWORD const Cycles) { int CyclesToExecute = Cycles - m_CyclesToSkip; - + //Update the number of cycles to skip m_CyclesToSkip -= Cycles; if (m_CyclesToSkip < 0) { m_CyclesToSkip = 0; } //Run the other CPU For the same amount of cycles if (CyclesToExecute < 0) { return; } - + SecondCPU->SetActiveSystem(true); - + CInterpreterCPU::ExecuteOps(Cycles); SetActiveSystem(true); } -void CN64System::SyncCPUPC (CN64System * const SecondCPU) +void CN64System::SyncCPUPC(CN64System * const SecondCPU) { bool ErrorFound = false; g_SystemTimer->UpdateTimers(); - if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) + if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) { ErrorFound = true; } @@ -1000,33 +1000,33 @@ void CN64System::SyncCPUPC (CN64System * const SecondCPU) if (ErrorFound) { DumpSyncErrors(SecondCPU); } - for (int i = (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) + for (int i = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) { m_LastSuccessSyncPC[i] = m_LastSuccessSyncPC[i - 1]; } m_LastSuccessSyncPC[0] = m_Reg.m_PROGRAM_COUNTER; } -void CN64System::SyncCPU (CN64System * const SecondCPU) +void CN64System::SyncCPU(CN64System * const SecondCPU) { bool ErrorFound = false; m_SyncCount += 1; //WriteTraceF(TraceError,"SyncCPU PC = %08X",m_Reg.m_PROGRAM_COUNTER); g_SystemTimer->UpdateTimers(); - + #ifdef TEST_SP_TRACKING if (m_CurrentSP != GPR[29].UW[0]) { ErrorFound = true; } #endif - if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) + if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) { ErrorFound = true; } if (b32BitCore()) { - for (int count = 0; count < 32; count ++) + for (int count = 0; count < 32; count++) { if (m_Reg.m_GPR[count].W[0] != SecondCPU->m_Reg.m_GPR[count].W[0]) { @@ -1044,13 +1044,13 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) } else { - for (int count = 0; count < 32; count ++) + for (int count = 0; count < 32; count++) { if (m_Reg.m_GPR[count].DW != SecondCPU->m_Reg.m_GPR[count].DW) { ErrorFound = true; } - if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) + if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) { ErrorFound = true; } @@ -1060,7 +1060,7 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) } } } - + if (m_TLB != SecondCPU->m_TLB) { ErrorFound = true; } if (m_Reg.m_FPCR[0] != SecondCPU->m_Reg.m_FPCR[0]) { ErrorFound = true; } if (m_Reg.m_FPCR[31] != SecondCPU->m_Reg.m_FPCR[31]) { ErrorFound = true; } @@ -1068,30 +1068,30 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) { ErrorFound = true; } /*if (m_SyncCount > 4788000) { - if (memcmp(m_MMU_VM.Rdram(),SecondCPU->m_MMU_VM.Rdram(),RdramSize()) != 0) - { - ErrorFound = true; - } - } - if (memcmp(m_MMU_VM.Imem(),SecondCPU->m_MMU_VM.Imem(),0x1000) != 0) + if (memcmp(m_MMU_VM.Rdram(),SecondCPU->m_MMU_VM.Rdram(),RdramSize()) != 0) { - ErrorFound = true; + ErrorFound = true; } - if (memcmp(m_MMU_VM.Dmem(),SecondCPU->m_MMU_VM.Dmem(),0x1000) != 0) + } + if (memcmp(m_MMU_VM.Imem(),SecondCPU->m_MMU_VM.Imem(),0x1000) != 0) { - ErrorFound = true; + ErrorFound = true; + } + if (memcmp(m_MMU_VM.Dmem(),SecondCPU->m_MMU_VM.Dmem(),0x1000) != 0) + { + ErrorFound = true; }*/ /*for (int z = 0; z < 0x100; z++) - { - if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z]) - { - ErrorFound = true; - break; - } + { + if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z]) + { + ErrorFound = true; + break; + } }*/ - - if (bFastSP() && m_Recomp) + + if (bFastSP() && m_Recomp) { if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))) { @@ -1102,8 +1102,8 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) if (m_SystemTimer != SecondCPU->m_SystemTimer) { ErrorFound = true; } if (m_NextTimer != SecondCPU->m_NextTimer) { ErrorFound = true; } if (m_Reg.m_RoundingModel != SecondCPU->m_Reg.m_RoundingModel) { ErrorFound = true; } - - for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i ++) + + for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i++) { if (m_Reg.m_Mips_Interface[i] != SecondCPU->m_Reg.m_Mips_Interface[i]) { @@ -1111,7 +1111,7 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) } } - for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i ++) + for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i++) { if (m_Reg.m_SigProcessor_Interface[i] != SecondCPU->m_Reg.m_SigProcessor_Interface[i]) { @@ -1119,24 +1119,24 @@ void CN64System::SyncCPU (CN64System * const SecondCPU) } } - for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i ++) + for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i++) { if (m_Reg.m_Display_ControlReg[i] != SecondCPU->m_Reg.m_Display_ControlReg[i]) { ErrorFound = true; } } - + if (ErrorFound) { DumpSyncErrors(SecondCPU); } - for (int i = (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) + for (int i = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) { m_LastSuccessSyncPC[i] = m_LastSuccessSyncPC[i - 1]; } m_LastSuccessSyncPC[0] = m_Reg.m_PROGRAM_COUNTER; -// if (PROGRAM_COUNTER == 0x8009BBD8) { -// g_Notify->BreakPoint(__FILEW__,__LINE__); -// } + // if (PROGRAM_COUNTER == 0x8009BBD8) { + // g_Notify->BreakPoint(__FILEW__,__LINE__); + // } } void CN64System::SyncSystem() @@ -1149,12 +1149,12 @@ void CN64System::SyncSystemPC() SyncCPUPC(g_SyncSystem); } -void CN64System::DumpSyncErrors (CN64System * SecondCPU) +void CN64System::DumpSyncErrors(CN64System * SecondCPU) { int count; - + { - CPath ErrorFile (CPath::MODULE_DIRECTORY); + CPath ErrorFile(CPath::MODULE_DIRECTORY); ErrorFile.AppendDirectory("Logs"); ErrorFile.SetNameExtension("Sync Errors.txt"); @@ -1162,190 +1162,190 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU) Error.Open(ErrorFile); Error.Log("Errors:\r\n"); Error.Log("Register, Recompiler, Interpter\r\n"); - #ifdef TEST_SP_TRACKING +#ifdef TEST_SP_TRACKING if (m_CurrentSP != GPR[29].UW[0]) { Error.Log("m_CurrentSP,%X,%X\r\n",m_CurrentSP,GPR[29].UW[0]); } - #endif +#endif if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) { - Error.LogF("PROGRAM_COUNTER 0x%X, 0x%X\r\n",m_Reg.m_PROGRAM_COUNTER,SecondCPU->m_Reg.m_PROGRAM_COUNTER); + Error.LogF("PROGRAM_COUNTER 0x%X, 0x%X\r\n", m_Reg.m_PROGRAM_COUNTER, SecondCPU->m_Reg.m_PROGRAM_COUNTER); } if (b32BitCore()) { - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { if (m_Reg.m_GPR[count].UW[0] != SecondCPU->m_Reg.m_GPR[count].UW[0]) { - Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n",CRegName::GPR[count], - m_Reg.m_GPR[count].W[1],m_Reg.m_GPR[count].W[0], - SecondCPU->m_Reg.m_GPR[count].W[1],SecondCPU->m_Reg.m_GPR[count].W[0]); + Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], + m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], + SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); } } } - else + else { - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { if (m_Reg.m_GPR[count].DW != SecondCPU->m_Reg.m_GPR[count].DW) { - Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n",CRegName::GPR[count], - m_Reg.m_GPR[count].W[1],m_Reg.m_GPR[count].W[0], - SecondCPU->m_Reg.m_GPR[count].W[1],SecondCPU->m_Reg.m_GPR[count].W[0]); + Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], + m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], + SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); } } } - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) { - Error.LogF("FPR[%s] 0x%08X%08X, 0x%08X%08X\r\n",CRegName::FPR[count], - m_Reg.m_FPR[count].W[1],m_Reg.m_FPR[count].W[0], - SecondCPU->m_Reg.m_FPR[count].W[1],SecondCPU->m_Reg.m_FPR[count].W[0]); + Error.LogF("FPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::FPR[count], + m_Reg.m_FPR[count].W[1], m_Reg.m_FPR[count].W[0], + SecondCPU->m_Reg.m_FPR[count].W[1], SecondCPU->m_Reg.m_FPR[count].W[0]); } - } - for (count = 0; count < 32; count ++) + } + for (count = 0; count < 32; count++) { if (m_Reg.m_FPCR[count] != SecondCPU->m_Reg.m_FPCR[count]) { - Error.LogF("FPCR[%s] 0x%08X, 0x%08X\r\n",CRegName::FPR_Ctrl[count], + Error.LogF("FPCR[%s] 0x%08X, 0x%08X\r\n", CRegName::FPR_Ctrl[count], m_Reg.m_FPCR[count], SecondCPU->m_Reg.m_FPCR[count]); } - } - for (count = 0; count < 32; count ++) + } + for (count = 0; count < 32; count++) { if (m_Reg.m_CP0[count] != SecondCPU->m_Reg.m_CP0[count]) { - Error.LogF("CP0[%s] 0x%08X, 0x%08X\r\n",CRegName::Cop0[count], + Error.LogF("CP0[%s] 0x%08X, 0x%08X\r\n", CRegName::Cop0[count], m_Reg.m_CP0[count], SecondCPU->m_Reg.m_CP0[count]); } - } - if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) + } + if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) { - Error.LogF("HI Reg 0x%08X%08X, 0x%08X%08X\r\n",m_Reg.m_HI.UW[1],m_Reg.m_HI.UW[0],SecondCPU->m_Reg.m_HI.UW[1],SecondCPU->m_Reg.m_HI.UW[0]); + Error.LogF("HI Reg 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_HI.UW[1], m_Reg.m_HI.UW[0], SecondCPU->m_Reg.m_HI.UW[1], SecondCPU->m_Reg.m_HI.UW[0]); } if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) { - Error.LogF("LO Reg 0x%08X%08X, 0x%08X%08X\r\n",m_Reg.m_LO.UW[1],m_Reg.m_LO.UW[0], SecondCPU->m_Reg.m_LO.UW[1],SecondCPU->m_Reg.m_LO.UW[0]); + Error.LogF("LO Reg 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_LO.UW[1], m_Reg.m_LO.UW[0], SecondCPU->m_Reg.m_LO.UW[1], SecondCPU->m_Reg.m_LO.UW[0]); } - for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i ++) + for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i++) { if (m_Reg.m_Mips_Interface[i] != SecondCPU->m_Reg.m_Mips_Interface[i]) { - Error.LogF("Mips_Interface[%d] 0x%08X, 0x%08X\r\n",i, m_Reg.m_Mips_Interface[i], SecondCPU->m_Reg.m_Mips_Interface[i]); + Error.LogF("Mips_Interface[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_Mips_Interface[i], SecondCPU->m_Reg.m_Mips_Interface[i]); } } - for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i ++) + for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i++) { if (m_Reg.m_SigProcessor_Interface[i] != SecondCPU->m_Reg.m_SigProcessor_Interface[i]) { - Error.LogF("SigProcessor_Interface[%d] 0x%08X, 0x%08X\r\n",i, m_Reg.m_SigProcessor_Interface[i], SecondCPU->m_Reg.m_SigProcessor_Interface[i]); + Error.LogF("SigProcessor_Interface[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_SigProcessor_Interface[i], SecondCPU->m_Reg.m_SigProcessor_Interface[i]); } } - for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i ++) + for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i++) { if (m_Reg.m_Display_ControlReg[i] != SecondCPU->m_Reg.m_Display_ControlReg[i]) { - Error.LogF("Display_ControlReg[%d] 0x%08X, 0x%08X\r\n",i, m_Reg.m_Display_ControlReg[i], SecondCPU->m_Reg.m_Display_ControlReg[i]); + Error.LogF("Display_ControlReg[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_Display_ControlReg[i], SecondCPU->m_Reg.m_Display_ControlReg[i]); } } - if (m_NextTimer != SecondCPU->m_NextTimer) - { - Error.LogF("Current Time: %X %X\r\n",(DWORD)m_NextTimer,(DWORD)SecondCPU->m_NextTimer); + if (m_NextTimer != SecondCPU->m_NextTimer) + { + Error.LogF("Current Time: %X %X\r\n", (DWORD)m_NextTimer, (DWORD)SecondCPU->m_NextTimer); } - m_TLB.RecordDifference(Error,SecondCPU->m_TLB); - m_SystemTimer.RecordDifference(Error,SecondCPU->m_SystemTimer); - if (m_Reg.m_RoundingModel != SecondCPU->m_Reg.m_RoundingModel) - { - Error.LogF("RoundingModel: %X %X\r\n",m_Reg.m_RoundingModel,SecondCPU->m_Reg.m_RoundingModel); + m_TLB.RecordDifference(Error, SecondCPU->m_TLB); + m_SystemTimer.RecordDifference(Error, SecondCPU->m_SystemTimer); + if (m_Reg.m_RoundingModel != SecondCPU->m_Reg.m_RoundingModel) + { + Error.LogF("RoundingModel: %X %X\r\n", m_Reg.m_RoundingModel, SecondCPU->m_Reg.m_RoundingModel); } - if (bFastSP() && m_Recomp) + if (bFastSP() && m_Recomp) { if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))) { - Error.LogF("MemoryStack = %X should be: %X\r\n",m_Recomp->MemoryStackPos(), (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))); + Error.LogF("MemoryStack = %X should be: %X\r\n", m_Recomp->MemoryStackPos(), (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))); } } - DWORD * Rdram = (DWORD *)m_MMU_VM.Rdram(), * Rdram2 = (DWORD *)SecondCPU->m_MMU_VM.Rdram(); - for (int z = 0, n = (RdramSize() >> 2); z < n; z ++) - { - if (Rdram[z] != Rdram2[z]) + DWORD * Rdram = (DWORD *)m_MMU_VM.Rdram(), *Rdram2 = (DWORD *)SecondCPU->m_MMU_VM.Rdram(); + for (int z = 0, n = (RdramSize() >> 2); z < n; z++) + { + if (Rdram[z] != Rdram2[z]) { - Error.LogF("Rdram[%X]: %X %X\r\n",z << 2,Rdram[z],Rdram2[z]); + Error.LogF("Rdram[%X]: %X %X\r\n", z << 2, Rdram[z], Rdram2[z]); } } - DWORD * Imem = (DWORD *)m_MMU_VM.Imem(), * Imem2 = (DWORD *)SecondCPU->m_MMU_VM.Imem(); - for (int z = 0; z < (0x1000 >> 2); z ++) - { - if (Imem[z] != Imem2[z]) + DWORD * Imem = (DWORD *)m_MMU_VM.Imem(), *Imem2 = (DWORD *)SecondCPU->m_MMU_VM.Imem(); + for (int z = 0; z < (0x1000 >> 2); z++) + { + if (Imem[z] != Imem2[z]) { - Error.LogF("Imem[%X]: %X %X\r\n",z << 2,Imem[z],Imem2[z]); + Error.LogF("Imem[%X]: %X %X\r\n", z << 2, Imem[z], Imem2[z]); } } - DWORD * Dmem = (DWORD *)m_MMU_VM.Dmem(), * Dmem2 = (DWORD *)SecondCPU->m_MMU_VM.Dmem(); - for (int z = 0; z < (0x1000 >> 2); z ++) - { - if (Dmem[z] != Dmem2[z]) + DWORD * Dmem = (DWORD *)m_MMU_VM.Dmem(), *Dmem2 = (DWORD *)SecondCPU->m_MMU_VM.Dmem(); + for (int z = 0; z < (0x1000 >> 2); z++) + { + if (Dmem[z] != Dmem2[z]) { - Error.LogF("Dmem[%X]: %X %X\r\n",z << 2,Dmem[z],Dmem2[z]); + Error.LogF("Dmem[%X]: %X %X\r\n", z << 2, Dmem[z], Dmem2[z]); } } Error.Log("\r\n"); Error.Log("Information:\r\n"); Error.Log("\r\n"); - Error.LogF("PROGRAM_COUNTER,0x%X\r\n",m_Reg.m_PROGRAM_COUNTER); - Error.LogF("Current Timer,0x%X\r\n",m_NextTimer); - Error.LogF("Timer Type,0x%X\r\n",m_SystemTimer.CurrentType()); + Error.LogF("PROGRAM_COUNTER,0x%X\r\n", m_Reg.m_PROGRAM_COUNTER); + Error.LogF("Current Timer,0x%X\r\n", m_NextTimer); + Error.LogF("Timer Type,0x%X\r\n", m_SystemTimer.CurrentType()); Error.Log("\r\n"); - for (int i = 0; i < (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])); i++) + for (int i = 0; i < (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i++) { - Error.LogF("LastSuccessSyncPC[%d],0x%X\r\n",i,m_LastSuccessSyncPC[i]); + Error.LogF("LastSuccessSyncPC[%d],0x%X\r\n", i, m_LastSuccessSyncPC[i]); } Error.Log("\r\n"); - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { - Error.LogF("GPR[%s], 0x%08X%08X, 0x%08X%08X\r\n",CRegName::GPR[count], - m_Reg.m_GPR[count].W[1],m_Reg.m_GPR[count].W[0], - SecondCPU->m_Reg.m_GPR[count].W[1],SecondCPU->m_Reg.m_GPR[count].W[0]); - } + Error.LogF("GPR[%s], 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], + m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], + SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); + } Error.Log("\r\n"); - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { - Error.LogF("FPR[%s],%*s0x%08X%08X, 0x%08X%08X\r\n",CRegName::FPR[count], - count < 10 ? 9 : 8," ",m_Reg.m_FPR[count].W[1],m_Reg.m_FPR[count].W[0], - SecondCPU->m_Reg.m_FPR[count].W[1],SecondCPU->m_Reg.m_FPR[count].W[0]); - } + Error.LogF("FPR[%s],%*s0x%08X%08X, 0x%08X%08X\r\n", CRegName::FPR[count], + count < 10 ? 9 : 8, " ", m_Reg.m_FPR[count].W[1], m_Reg.m_FPR[count].W[0], + SecondCPU->m_Reg.m_FPR[count].W[1], SecondCPU->m_Reg.m_FPR[count].W[0]); + } Error.Log("\r\n"); - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { - Error.LogF("FPR_S[%s],%*s%f, %f\r\n",CRegName::FPR[count], - count < 10 ? 7 : 6," ",*(m_Reg.m_FPR_S[count]),*(SecondCPU->m_Reg.m_FPR_S[count])); - } + Error.LogF("FPR_S[%s],%*s%f, %f\r\n", CRegName::FPR[count], + count < 10 ? 7 : 6, " ", *(m_Reg.m_FPR_S[count]), *(SecondCPU->m_Reg.m_FPR_S[count])); + } Error.Log("\r\n"); - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { - Error.LogF("FPR_D[%s],%*s%f, %f\r\n",CRegName::FPR[count], - count < 10 ? 7 : 6," ",*(m_Reg.m_FPR_D[count]),*(SecondCPU->m_Reg.m_FPR_D[count])); - } + Error.LogF("FPR_D[%s],%*s%f, %f\r\n", CRegName::FPR[count], + count < 10 ? 7 : 6, " ", *(m_Reg.m_FPR_D[count]), *(SecondCPU->m_Reg.m_FPR_D[count])); + } Error.Log("\r\n"); - Error.LogF("Rounding Model, 0x%08X, 0x%08X\r\n",m_Reg.m_RoundingModel,SecondCPU->m_Reg.m_RoundingModel); + Error.LogF("Rounding Model, 0x%08X, 0x%08X\r\n", m_Reg.m_RoundingModel, SecondCPU->m_Reg.m_RoundingModel); Error.Log("\r\n"); - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { - Error.LogF("CP0[%s],%*s0x%08X, 0x%08X\r\n",CRegName::Cop0[count], - 12 - strlen(CRegName::Cop0[count]),"", - m_Reg.m_CP0[count],SecondCPU->m_Reg.m_CP0[count]); - } + Error.LogF("CP0[%s],%*s0x%08X, 0x%08X\r\n", CRegName::Cop0[count], + 12 - strlen(CRegName::Cop0[count]), "", + m_Reg.m_CP0[count], SecondCPU->m_Reg.m_CP0[count]); + } Error.Log("\r\n"); - Error.LogF("HI 0x%08X%08X, 0x%08X%08X\r\n",m_Reg.m_HI.UW[1],m_Reg.m_HI.UW[0], - SecondCPU->m_Reg.m_HI.UW[1],SecondCPU->m_Reg.m_HI.UW[0]); - Error.LogF("LO 0x%08X%08X, 0x%08X%08X\r\n",m_Reg.m_LO.UW[1],m_Reg.m_LO.UW[0], - SecondCPU->m_Reg.m_LO.UW[1],SecondCPU->m_Reg.m_LO.UW[0]); + Error.LogF("HI 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_HI.UW[1], m_Reg.m_HI.UW[0], + SecondCPU->m_Reg.m_HI.UW[1], SecondCPU->m_Reg.m_HI.UW[0]); + Error.LogF("LO 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_LO.UW[1], m_Reg.m_LO.UW[0], + SecondCPU->m_Reg.m_LO.UW[1], SecondCPU->m_Reg.m_LO.UW[0]); bool bHasTlb = false; - for (count = 0; count < 32; count ++) + for (count = 0; count < 32; count++) { if (!m_TLB.TlbEntry(count).EntryDefined) { continue; } if (!bHasTlb) @@ -1355,74 +1355,72 @@ void CN64System::DumpSyncErrors (CN64System * SecondCPU) bHasTlb = true; } Error.LogF("TLB[%2d], %08X, %08X, %08X, %08X\r\n", count, - m_TLB.TlbEntry(count).EntryHi.Value,m_TLB.TlbEntry(count).PageMask.Value, - SecondCPU->m_TLB.TlbEntry(count).EntryHi.Value,SecondCPU->m_TLB.TlbEntry(count).PageMask.Value - ); + m_TLB.TlbEntry(count).EntryHi.Value, m_TLB.TlbEntry(count).PageMask.Value, + SecondCPU->m_TLB.TlbEntry(count).EntryHi.Value, SecondCPU->m_TLB.TlbEntry(count).PageMask.Value + ); } Error.Log("\r\n"); Error.Log("Code at PC:\r\n"); for (count = -10; count < 10; count++) { DWORD OpcodeValue, Addr = m_Reg.m_PROGRAM_COUNTER + (count << 2); - if (g_MMU->LW_VAddr(Addr,(uint32_t &)OpcodeValue)) + if (g_MMU->LW_VAddr(Addr, (uint32_t &)OpcodeValue)) { - Error.LogF("%X: %s\r\n",Addr,R4300iOpcodeName(OpcodeValue,Addr)); + Error.LogF("%X: %s\r\n", Addr, R4300iOpcodeName(OpcodeValue, Addr)); } - } Error.Log("\r\n"); Error.Log("Code at Last Sync PC:\r\n"); for (count = 0; count < 50; count++) { DWORD OpcodeValue, Addr = m_LastSuccessSyncPC[0] + (count << 2); - if (g_MMU->LW_VAddr(Addr,(uint32_t &)OpcodeValue)) + if (g_MMU->LW_VAddr(Addr, (uint32_t &)OpcodeValue)) { - Error.LogF("%X: %s\r\n",Addr,R4300iOpcodeName(OpcodeValue,Addr)); + Error.LogF("%X: %s\r\n", Addr, R4300iOpcodeName(OpcodeValue, Addr)); } - } } g_Notify->DisplayError(L"Sync Error"); - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } bool CN64System::SaveState() { - WriteTrace(TraceDebug,__FUNCTION__ ": Start"); + WriteTrace(TraceDebug, __FUNCTION__ ": Start"); -// if (!m_SystemTimer.SaveAllowed()) { return false; } + // if (!m_SystemTimer.SaveAllowed()) { return false; } if ((m_Reg.STATUS_REGISTER & STATUS_EXL) != 0) { return false; } - + //Get the file Name stdstr FileName, ExtraInfoFileName, CurrentSaveName = g_Settings->LoadStringVal(GameRunning_InstantSaveFile); if (CurrentSaveName.empty()) { int Slot = g_Settings->LoadDword(Game_CurrentSaveState); - if (Slot != 0) - { - CurrentSaveName.Format("%s.pj%d",g_Settings->LoadStringVal(Game_GoodName).c_str(), Slot); - } - else + if (Slot != 0) { - CurrentSaveName.Format("%s.pj",g_Settings->LoadStringVal(Game_GoodName).c_str()); + CurrentSaveName.Format("%s.pj%d", g_Settings->LoadStringVal(Game_GoodName).c_str(), Slot); } - FileName.Format("%s%s",g_Settings->LoadStringVal(Directory_InstantSave).c_str(),CurrentSaveName.c_str()); - stdstr_f ZipFileName("%s.zip",FileName.c_str()); - //Make sure the target dir exists - CreateDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str(),NULL); + else + { + CurrentSaveName.Format("%s.pj", g_Settings->LoadStringVal(Game_GoodName).c_str()); + } + FileName.Format("%s%s", g_Settings->LoadStringVal(Directory_InstantSave).c_str(), CurrentSaveName.c_str()); + stdstr_f ZipFileName("%s.zip", FileName.c_str()); + //Make sure the target dir exists + CreateDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str(), NULL); //delete any old save DeleteFile(FileName.c_str()); DeleteFile(ZipFileName.c_str()); - ExtraInfoFileName.Format("%s.dat",CurrentSaveName.c_str()); - + ExtraInfoFileName.Format("%s.dat", CurrentSaveName.c_str()); + //If ziping save add .zip on the end if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) { FileName = ZipFileName; } - g_Settings->SaveDword(Game_LastSaveSlot,g_Settings->LoadDword(Game_CurrentSaveState)); - } + g_Settings->SaveDword(Game_LastSaveSlot, g_Settings->LoadDword(Game_CurrentSaveState)); + } else { char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; @@ -1442,63 +1440,63 @@ bool CN64System::SaveState() if (FileName.empty()) { return true; } //Open the file - if (g_Settings->LoadDword(Game_FuncLookupMode) == FuncFind_ChangeMemory) + if (g_Settings->LoadDword(Game_FuncLookupMode) == FuncFind_ChangeMemory) { if (m_Recomp) { - m_Recomp->ResetRecompCode(true); + m_Recomp->ResetRecompCode(true); } } DWORD dwWritten, SaveID_0 = 0x23D8A6C8, SaveID_1 = 0x56D2CD23; - DWORD RdramSize = g_Settings->LoadDword(Game_RDRamSize); - DWORD MiInterReg = g_Reg->MI_INTR_REG; + DWORD RdramSize = g_Settings->LoadDword(Game_RDRamSize); + DWORD MiInterReg = g_Reg->MI_INTR_REG; DWORD NextViTimer = m_SystemTimer.GetTimer(CSystemTimer::ViTimer); if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) { zipFile file; - file = zipOpen(FileName.c_str(),0); - zipOpenNewFileInZip(file,CurrentSaveName.c_str(),NULL,NULL,0,NULL,0,NULL,Z_DEFLATED,Z_DEFAULT_COMPRESSION); - zipWriteInFileInZip(file,&SaveID_0,sizeof(SaveID_0)); - zipWriteInFileInZip(file,&RdramSize,sizeof(DWORD)); - zipWriteInFileInZip(file,g_Rom->GetRomAddress(),0x40); - zipWriteInFileInZip(file,&NextViTimer,sizeof(DWORD)); - zipWriteInFileInZip(file,&m_Reg.m_PROGRAM_COUNTER,sizeof(m_Reg.m_PROGRAM_COUNTER)); - zipWriteInFileInZip(file,m_Reg.m_GPR,sizeof(__int64)*32); - zipWriteInFileInZip(file,m_Reg.m_FPR,sizeof(__int64)*32); - zipWriteInFileInZip(file,m_Reg.m_CP0,sizeof(DWORD)*32); - zipWriteInFileInZip(file,m_Reg.m_FPCR,sizeof(DWORD)*32); - zipWriteInFileInZip(file,&m_Reg.m_HI,sizeof(__int64)); - zipWriteInFileInZip(file,&m_Reg.m_LO,sizeof(__int64)); - zipWriteInFileInZip(file,m_Reg.m_RDRAM_Registers,sizeof(DWORD)*10); - zipWriteInFileInZip(file,m_Reg.m_SigProcessor_Interface,sizeof(DWORD)*10); - zipWriteInFileInZip(file,m_Reg.m_Display_ControlReg,sizeof(DWORD)*10); - zipWriteInFileInZip(file,m_Reg.m_Mips_Interface,sizeof(DWORD)*4); - zipWriteInFileInZip(file,m_Reg.m_Video_Interface,sizeof(DWORD)*14); - zipWriteInFileInZip(file,m_Reg.m_Audio_Interface,sizeof(DWORD)*6); - zipWriteInFileInZip(file,m_Reg.m_Peripheral_Interface,sizeof(DWORD)*13); - zipWriteInFileInZip(file,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8); - zipWriteInFileInZip(file,m_Reg.m_SerialInterface,sizeof(DWORD)*4); - zipWriteInFileInZip(file,(void *const)&m_TLB.TlbEntry(0),sizeof(CTLB::TLB_ENTRY)*32); - zipWriteInFileInZip(file,m_MMU_VM.PifRam(),0x40); - zipWriteInFileInZip(file,m_MMU_VM.Rdram(),RdramSize); - zipWriteInFileInZip(file,m_MMU_VM.Dmem(),0x1000); - zipWriteInFileInZip(file,m_MMU_VM.Imem(),0x1000); + file = zipOpen(FileName.c_str(), 0); + zipOpenNewFileInZip(file, CurrentSaveName.c_str(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); + zipWriteInFileInZip(file, &SaveID_0, sizeof(SaveID_0)); + zipWriteInFileInZip(file, &RdramSize, sizeof(DWORD)); + zipWriteInFileInZip(file, g_Rom->GetRomAddress(), 0x40); + zipWriteInFileInZip(file, &NextViTimer, sizeof(DWORD)); + zipWriteInFileInZip(file, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER)); + zipWriteInFileInZip(file, m_Reg.m_GPR, sizeof(__int64) * 32); + zipWriteInFileInZip(file, m_Reg.m_FPR, sizeof(__int64) * 32); + zipWriteInFileInZip(file, m_Reg.m_CP0, sizeof(DWORD) * 32); + zipWriteInFileInZip(file, m_Reg.m_FPCR, sizeof(DWORD) * 32); + zipWriteInFileInZip(file, &m_Reg.m_HI, sizeof(__int64)); + zipWriteInFileInZip(file, &m_Reg.m_LO, sizeof(__int64)); + zipWriteInFileInZip(file, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10); + zipWriteInFileInZip(file, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10); + zipWriteInFileInZip(file, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10); + zipWriteInFileInZip(file, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4); + zipWriteInFileInZip(file, m_Reg.m_Video_Interface, sizeof(DWORD) * 14); + zipWriteInFileInZip(file, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6); + zipWriteInFileInZip(file, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13); + zipWriteInFileInZip(file, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8); + zipWriteInFileInZip(file, m_Reg.m_SerialInterface, sizeof(DWORD) * 4); + zipWriteInFileInZip(file, (void *const)&m_TLB.TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32); + zipWriteInFileInZip(file, m_MMU_VM.PifRam(), 0x40); + zipWriteInFileInZip(file, m_MMU_VM.Rdram(), RdramSize); + zipWriteInFileInZip(file, m_MMU_VM.Dmem(), 0x1000); + zipWriteInFileInZip(file, m_MMU_VM.Imem(), 0x1000); zipCloseFileInZip(file); - - zipOpenNewFileInZip(file,ExtraInfoFileName.c_str(),NULL,NULL,0,NULL,0,NULL,Z_DEFLATED,Z_DEFAULT_COMPRESSION); - zipWriteInFileInZip(file,&SaveID_1,sizeof(SaveID_1)); + + zipOpenNewFileInZip(file, ExtraInfoFileName.c_str(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); + zipWriteInFileInZip(file, &SaveID_1, sizeof(SaveID_1)); m_SystemTimer.SaveData(file); zipCloseFileInZip(file); - zipClose(file,""); - } + zipClose(file, ""); + } else { - HANDLE hSaveFile = CreateFile(FileName.c_str(),GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, - NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); - if (hSaveFile == INVALID_HANDLE_VALUE) + HANDLE hSaveFile = CreateFile(FileName.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); + if (hSaveFile == INVALID_HANDLE_VALUE) { g_Notify->DisplayError(GS(MSG_FAIL_OPEN_SAVE)); m_Reg.MI_INTR_REG = MiInterReg; @@ -1506,44 +1504,44 @@ bool CN64System::SaveState() } //Write info to file - SetFilePointer(hSaveFile,0,NULL,FILE_BEGIN); - WriteFile( hSaveFile,&SaveID_0,sizeof(DWORD),&dwWritten,NULL); - WriteFile( hSaveFile,&RdramSize,sizeof(DWORD),&dwWritten,NULL); - WriteFile( hSaveFile,g_Rom->GetRomAddress(),0x40,&dwWritten,NULL); - WriteFile( hSaveFile,&NextViTimer,sizeof(DWORD),&dwWritten,NULL); - WriteFile( hSaveFile,&m_Reg.m_PROGRAM_COUNTER,sizeof(m_Reg.m_PROGRAM_COUNTER),&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_GPR,sizeof(__int64)*32,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_FPR,sizeof(__int64)*32,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_CP0,sizeof(DWORD)*32,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_FPCR,sizeof(DWORD)*32,&dwWritten,NULL); - WriteFile( hSaveFile,&m_Reg.m_HI,sizeof(__int64),&dwWritten,NULL); - WriteFile( hSaveFile,&m_Reg.m_LO,sizeof(__int64),&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_RDRAM_Registers,sizeof(DWORD)*10,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_SigProcessor_Interface,sizeof(DWORD)*10,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_Display_ControlReg,sizeof(DWORD)*10,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_Mips_Interface,sizeof(DWORD)*4,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_Video_Interface,sizeof(DWORD)*14,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_Audio_Interface,sizeof(DWORD)*6,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_Peripheral_Interface,sizeof(DWORD)*13,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8,&dwWritten,NULL); - WriteFile( hSaveFile,m_Reg.m_SerialInterface,sizeof(DWORD)*4,&dwWritten,NULL); - WriteFile( hSaveFile,&g_TLB->TlbEntry(0),sizeof(CTLB::TLB_ENTRY)*32,&dwWritten,NULL); - WriteFile( hSaveFile,g_MMU->PifRam(),0x40,&dwWritten,NULL); - WriteFile( hSaveFile,g_MMU->Rdram(),RdramSize,&dwWritten,NULL); - WriteFile( hSaveFile,g_MMU->Dmem(),0x1000,&dwWritten,NULL); - WriteFile( hSaveFile,g_MMU->Imem(),0x1000,&dwWritten,NULL); + SetFilePointer(hSaveFile, 0, NULL, FILE_BEGIN); + WriteFile(hSaveFile, &SaveID_0, sizeof(DWORD), &dwWritten, NULL); + WriteFile(hSaveFile, &RdramSize, sizeof(DWORD), &dwWritten, NULL); + WriteFile(hSaveFile, g_Rom->GetRomAddress(), 0x40, &dwWritten, NULL); + WriteFile(hSaveFile, &NextViTimer, sizeof(DWORD), &dwWritten, NULL); + WriteFile(hSaveFile, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER), &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_GPR, sizeof(__int64) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_FPR, sizeof(__int64) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_CP0, sizeof(DWORD) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_FPCR, sizeof(DWORD) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, &m_Reg.m_HI, sizeof(__int64), &dwWritten, NULL); + WriteFile(hSaveFile, &m_Reg.m_LO, sizeof(__int64), &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Video_Interface, sizeof(DWORD) * 14, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_SerialInterface, sizeof(DWORD) * 4, &dwWritten, NULL); + WriteFile(hSaveFile, &g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->PifRam(), 0x40, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->Rdram(), RdramSize, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->Dmem(), 0x1000, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->Imem(), 0x1000, &dwWritten, NULL); CloseHandle(hSaveFile); } m_Reg.MI_INTR_REG = MiInterReg; - g_Settings->SaveString(GameRunning_InstantSaveFile,""); + g_Settings->SaveString(GameRunning_InstantSaveFile, ""); std::wstring SaveMessage = g_Lang->GetString(MSG_SAVED_STATE); CPath SavedFileName(FileName); - - g_Notify->DisplayMessage(5,stdstr_f("%s %s",SaveMessage.c_str(),SavedFileName.GetNameExtension()).ToUTF16().c_str()); + + g_Notify->DisplayMessage(5, stdstr_f("%s %s", SaveMessage.c_str(), SavedFileName.GetNameExtension()).ToUTF16().c_str()); Notify().RefreshMenu(); - WriteTrace(TraceDebug,__FUNCTION__ ": Done"); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); return true; } @@ -1553,19 +1551,19 @@ bool CN64System::LoadState() if (!InstantFileName.empty()) { bool Result = LoadState(InstantFileName.c_str()); - g_Settings->SaveString(GameRunning_InstantSaveFile,""); + g_Settings->SaveString(GameRunning_InstantSaveFile, ""); return Result; } CPath FileName; FileName.SetDriveDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str()); - if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) + if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) { - FileName.SetNameExtension(stdstr_f("%s.pj%d",g_Settings->LoadStringVal(Game_GoodName).c_str(),g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); - } - else + FileName.SetNameExtension(stdstr_f("%s.pj%d", g_Settings->LoadStringVal(Game_GoodName).c_str(), g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); + } + else { - FileName.SetNameExtension(stdstr_f("%s.pj",g_Settings->LoadStringVal(Game_GoodName).c_str()).c_str()); + FileName.SetNameExtension(stdstr_f("%s.pj", g_Settings->LoadStringVal(Game_GoodName).c_str()).c_str()); } CPath ZipFileName; @@ -1580,119 +1578,119 @@ bool CN64System::LoadState() } //Use old file Name - if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) - { - FileName.SetNameExtension(stdstr_f("%s.pj%d",g_Settings->LoadStringVal(Game_GameName).c_str(),g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); + if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) + { + FileName.SetNameExtension(stdstr_f("%s.pj%d", g_Settings->LoadStringVal(Game_GameName).c_str(), g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); } else { - FileName.SetNameExtension(stdstr_f("%s.pj",g_Settings->LoadStringVal(Game_GameName).c_str()).c_str()); + FileName.SetNameExtension(stdstr_f("%s.pj", g_Settings->LoadStringVal(Game_GameName).c_str()).c_str()); } return LoadState(FileName); } -bool CN64System::LoadState(LPCSTR FileName) +bool CN64System::LoadState(LPCSTR FileName) { - DWORD dwRead, Value,SaveRDRAMSize, NextVITimer = 0, old_status, old_width, old_dacrate; + 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); - char drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT]; + WriteTraceF((TraceType)(TraceDebug | TraceRecompiler), __FUNCTION__ "(%s): Start", FileName); + + char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; _splitpath(FileName, drive, dir, fname, ext); stdstr FileNameStr(FileName); - if (g_Settings->LoadDword(Setting_AutoZipInstantSave) || _stricmp(ext,".zip") == 0) + if (g_Settings->LoadDword(Setting_AutoZipInstantSave) || _stricmp(ext, ".zip") == 0) { //If ziping save add .zip on the end - if (_stricmp(ext,".zip") != 0) + if (_stricmp(ext, ".zip") != 0) { FileNameStr += ".zip"; } unzFile file = unzOpen(FileNameStr.c_str()); int port = -1; - if (file != NULL) + if (file != NULL) { port = unzGoToFirstFile(file); } DWORD Value; - while (port == UNZ_OK) + while (port == UNZ_OK) { unz_file_info info; char zname[132]; - unzGetCurrentFileInfo(file, &info, zname, 128, NULL,0, NULL,0); - if (unzLocateFile(file, zname, 1) != UNZ_OK ) + unzGetCurrentFileInfo(file, &info, zname, 128, NULL, 0, NULL, 0); + if (unzLocateFile(file, zname, 1) != UNZ_OK) { unzClose(file); port = -1; continue; } - if( unzOpenCurrentFile(file) != UNZ_OK ) + if (unzOpenCurrentFile(file) != UNZ_OK) { unzClose(file); port = -1; continue; } - unzReadCurrentFile(file,&Value,4); - if (Value != 0x23D8A6C8 && Value != 0x56D2CD23) + unzReadCurrentFile(file, &Value, 4); + if (Value != 0x23D8A6C8 && Value != 0x56D2CD23) { unzCloseCurrentFile(file); port = unzGoToNextFile(file); continue; } - if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK) + if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK) { - unzReadCurrentFile(file,&SaveRDRAMSize,sizeof(SaveRDRAMSize)); + unzReadCurrentFile(file, &SaveRDRAMSize, sizeof(SaveRDRAMSize)); //Check header BYTE LoadHeader[64]; - unzReadCurrentFile(file,LoadHeader,0x40); - if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0) + unzReadCurrentFile(file, LoadHeader, 0x40); + if (memcmp(LoadHeader, g_Rom->GetRomAddress(), 0x40) != 0) { //if (inFullScreen) { return false; } - int result = MessageBoxW(NULL,GS(MSG_SAVE_STATE_HEADER),GS(MSG_MSGBOX_TITLE), - MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2); + int result = MessageBoxW(NULL, GS(MSG_SAVE_STATE_HEADER), GS(MSG_MSGBOX_TITLE), + MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2); if (result == IDNO) return false; } - Reset(false,true); + Reset(false, true); - g_MMU->UnProtectMemory(0x80000000,0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); - g_MMU->UnProtectMemory(0xA4000000,0xA4001FFC); - g_Settings->SaveDword(Game_RDRamSize,SaveRDRAMSize); - unzReadCurrentFile(file,&NextVITimer,sizeof(NextVITimer)); - unzReadCurrentFile(file,&m_Reg.m_PROGRAM_COUNTER,sizeof(m_Reg.m_PROGRAM_COUNTER)); - unzReadCurrentFile(file,m_Reg.m_GPR,sizeof(__int64)*32); - unzReadCurrentFile(file,m_Reg.m_FPR,sizeof(__int64)*32); - unzReadCurrentFile(file,m_Reg.m_CP0,sizeof(DWORD)*32); - unzReadCurrentFile(file,m_Reg.m_FPCR,sizeof(DWORD)*32); - unzReadCurrentFile(file,&m_Reg.m_HI,sizeof(__int64)); - unzReadCurrentFile(file,&m_Reg.m_LO,sizeof(__int64)); - unzReadCurrentFile(file,m_Reg.m_RDRAM_Registers,sizeof(DWORD)*10); - unzReadCurrentFile(file,m_Reg.m_SigProcessor_Interface,sizeof(DWORD)*10); - unzReadCurrentFile(file,m_Reg.m_Display_ControlReg,sizeof(DWORD)*10); - unzReadCurrentFile(file,m_Reg.m_Mips_Interface,sizeof(DWORD)*4); - unzReadCurrentFile(file,m_Reg.m_Video_Interface,sizeof(DWORD)*14); - unzReadCurrentFile(file,m_Reg.m_Audio_Interface,sizeof(DWORD)*6); - unzReadCurrentFile(file,m_Reg.m_Peripheral_Interface,sizeof(DWORD)*13); - unzReadCurrentFile(file,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8); - unzReadCurrentFile(file,m_Reg.m_SerialInterface,sizeof(DWORD)*4); - unzReadCurrentFile(file,(void *const)&g_TLB->TlbEntry(0),sizeof(CTLB::TLB_ENTRY)*32); - unzReadCurrentFile(file,m_MMU_VM.PifRam(),0x40); - unzReadCurrentFile(file,m_MMU_VM.Rdram(),SaveRDRAMSize); - unzReadCurrentFile(file,m_MMU_VM.Dmem(),0x1000); - unzReadCurrentFile(file,m_MMU_VM.Imem(),0x1000); + g_MMU->UnProtectMemory(0x80000000, 0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); + g_MMU->UnProtectMemory(0xA4000000, 0xA4001FFC); + g_Settings->SaveDword(Game_RDRamSize, SaveRDRAMSize); + unzReadCurrentFile(file, &NextVITimer, sizeof(NextVITimer)); + unzReadCurrentFile(file, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER)); + unzReadCurrentFile(file, m_Reg.m_GPR, sizeof(__int64) * 32); + unzReadCurrentFile(file, m_Reg.m_FPR, sizeof(__int64) * 32); + unzReadCurrentFile(file, m_Reg.m_CP0, sizeof(DWORD) * 32); + unzReadCurrentFile(file, m_Reg.m_FPCR, sizeof(DWORD) * 32); + unzReadCurrentFile(file, &m_Reg.m_HI, sizeof(__int64)); + unzReadCurrentFile(file, &m_Reg.m_LO, sizeof(__int64)); + unzReadCurrentFile(file, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10); + unzReadCurrentFile(file, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10); + unzReadCurrentFile(file, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10); + unzReadCurrentFile(file, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4); + unzReadCurrentFile(file, m_Reg.m_Video_Interface, sizeof(DWORD) * 14); + unzReadCurrentFile(file, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6); + unzReadCurrentFile(file, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13); + unzReadCurrentFile(file, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8); + unzReadCurrentFile(file, m_Reg.m_SerialInterface, sizeof(DWORD) * 4); + unzReadCurrentFile(file, (void *const)&g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32); + unzReadCurrentFile(file, m_MMU_VM.PifRam(), 0x40); + unzReadCurrentFile(file, m_MMU_VM.Rdram(), SaveRDRAMSize); + unzReadCurrentFile(file, m_MMU_VM.Dmem(), 0x1000); + unzReadCurrentFile(file, m_MMU_VM.Imem(), 0x1000); unzCloseCurrentFile(file); port = unzGoToFirstFile(file); LoadedZipFile = true; continue; } - if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK) + if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK) { m_SystemTimer.LoadData(file); } @@ -1701,64 +1699,64 @@ bool CN64System::LoadState(LPCSTR FileName) } unzClose(file); } - if (!LoadedZipFile) + if (!LoadedZipFile) { - HANDLE hSaveFile = CreateFile(FileNameStr.c_str(),GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ,NULL, - OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); - if (hSaveFile == INVALID_HANDLE_VALUE) + HANDLE hSaveFile = CreateFile(FileNameStr.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); + if (hSaveFile == INVALID_HANDLE_VALUE) { - g_Notify->DisplayMessage(5,stdstr_f("%s %s",GS(MSG_UNABLED_LOAD_STATE),FileNameStr).ToUTF16().c_str()); + g_Notify->DisplayMessage(5, stdstr_f("%s %s", GS(MSG_UNABLED_LOAD_STATE), FileNameStr).ToUTF16().c_str()); return false; } - SetFilePointer(hSaveFile,0,NULL,FILE_BEGIN); - ReadFile( hSaveFile,&Value,sizeof(Value),&dwRead,NULL); + SetFilePointer(hSaveFile, 0, NULL, FILE_BEGIN); + ReadFile(hSaveFile, &Value, sizeof(Value), &dwRead, NULL); if (Value != 0x23D8A6C8) return false; - ReadFile( hSaveFile,&SaveRDRAMSize,sizeof(SaveRDRAMSize),&dwRead,NULL); + ReadFile(hSaveFile, &SaveRDRAMSize, sizeof(SaveRDRAMSize), &dwRead, NULL); //Check header BYTE LoadHeader[64]; - ReadFile( hSaveFile,LoadHeader,0x40,&dwRead,NULL); - if (memcmp(LoadHeader,g_Rom->GetRomAddress(),0x40) != 0) + ReadFile(hSaveFile, LoadHeader, 0x40, &dwRead, NULL); + if (memcmp(LoadHeader, g_Rom->GetRomAddress(), 0x40) != 0) { //if (inFullScreen) { return false; } - int result = MessageBoxW(NULL,GS(MSG_SAVE_STATE_HEADER),GS(MSG_MSGBOX_TITLE), - MB_YESNO|MB_ICONQUESTION|MB_DEFBUTTON2); + int result = MessageBoxW(NULL, GS(MSG_SAVE_STATE_HEADER), GS(MSG_MSGBOX_TITLE), + MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2); if (result == IDNO) return false; } - Reset(false,true); - m_MMU_VM.UnProtectMemory(0x80000000,0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); - m_MMU_VM.UnProtectMemory(0xA4000000,0xA4001FFC); - g_Settings->SaveDword(Game_RDRamSize,SaveRDRAMSize); + Reset(false, true); + m_MMU_VM.UnProtectMemory(0x80000000, 0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); + m_MMU_VM.UnProtectMemory(0xA4000000, 0xA4001FFC); + g_Settings->SaveDword(Game_RDRamSize, SaveRDRAMSize); - ReadFile( hSaveFile,&NextVITimer,sizeof(NextVITimer),&dwRead,NULL); - ReadFile( hSaveFile,&m_Reg.m_PROGRAM_COUNTER,sizeof(m_Reg.m_PROGRAM_COUNTER),&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_GPR,sizeof(__int64)*32,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_FPR,sizeof(__int64)*32,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_CP0,sizeof(DWORD)*32,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_FPCR,sizeof(DWORD)*32,&dwRead,NULL); - ReadFile( hSaveFile,&m_Reg.m_HI,sizeof(__int64),&dwRead,NULL); - ReadFile( hSaveFile,&m_Reg.m_LO,sizeof(__int64),&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_RDRAM_Registers,sizeof(DWORD)*10,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_SigProcessor_Interface,sizeof(DWORD)*10,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_Display_ControlReg,sizeof(DWORD)*10,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_Mips_Interface,sizeof(DWORD)*4,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_Video_Interface,sizeof(DWORD)*14,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_Audio_Interface,sizeof(DWORD)*6,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_Peripheral_Interface,sizeof(DWORD)*13,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_RDRAM_Interface,sizeof(DWORD)*8,&dwRead,NULL); - ReadFile( hSaveFile,m_Reg.m_SerialInterface,sizeof(DWORD)*4,&dwRead,NULL); - ReadFile( hSaveFile,(void *const)&g_TLB->TlbEntry(0),sizeof(CTLB::TLB_ENTRY)*32,&dwRead,NULL); - ReadFile( hSaveFile,m_MMU_VM.PifRam(),0x40,&dwRead,NULL); - ReadFile( hSaveFile,m_MMU_VM.Rdram(),SaveRDRAMSize,&dwRead,NULL); - ReadFile( hSaveFile,m_MMU_VM.Dmem(),0x1000,&dwRead,NULL); - ReadFile( hSaveFile,m_MMU_VM.Imem(),0x1000,&dwRead,NULL); + ReadFile(hSaveFile, &NextVITimer, sizeof(NextVITimer), &dwRead, NULL); + ReadFile(hSaveFile, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER), &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_GPR, sizeof(__int64) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_FPR, sizeof(__int64) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_CP0, sizeof(DWORD) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_FPCR, sizeof(DWORD) * 32, &dwRead, NULL); + ReadFile(hSaveFile, &m_Reg.m_HI, sizeof(__int64), &dwRead, NULL); + ReadFile(hSaveFile, &m_Reg.m_LO, sizeof(__int64), &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Video_Interface, sizeof(DWORD) * 14, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_SerialInterface, sizeof(DWORD) * 4, &dwRead, NULL); + ReadFile(hSaveFile, (void *const)&g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.PifRam(), 0x40, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.Rdram(), SaveRDRAMSize, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.Dmem(), 0x1000, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.Imem(), 0x1000, &dwRead, NULL); CloseHandle(hSaveFile); } - + //Fix losing audio in certain games with certain plugins AudioResetOnLoad = g_Settings->LoadBool(Game_AudioResetOnLoad); if (AudioResetOnLoad) @@ -1767,63 +1765,63 @@ bool CN64System::LoadState(LPCSTR FileName) m_Reg.AI_STATUS_REG &= ~AI_STATUS_FIFO_FULL; g_Reg->MI_INTR_REG |= MI_INTR_AI; } - + if (bFixedAudio()) { m_Audio.SetFrequency(m_Reg.AI_DACRATE_REG, g_System->SystemType()); } - + if (old_status != g_Reg->VI_STATUS_REG) { g_Plugins->Gfx()->ViStatusChanged(); } - + if (old_width != g_Reg->VI_WIDTH_REG) { 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) { m_Reg.RANDOM_REGISTER += 32 - m_Reg.WIRED_REGISTER; } //Fix up timer - WriteTrace(TraceDebug,__FUNCTION__ ": 2"); - m_SystemTimer.SetTimer(CSystemTimer::CompareTimer,m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER,false); - m_SystemTimer.SetTimer(CSystemTimer::ViTimer,NextVITimer,false); + WriteTrace(TraceDebug, __FUNCTION__ ": 2"); + m_SystemTimer.SetTimer(CSystemTimer::CompareTimer, m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER, false); + m_SystemTimer.SetTimer(CSystemTimer::ViTimer, NextVITimer, false); m_Reg.FixFpuLocations(); - WriteTrace(TraceDebug,__FUNCTION__ ": 5"); + WriteTrace(TraceDebug, __FUNCTION__ ": 5"); m_TLB.Reset(false); - WriteTrace(TraceDebug,__FUNCTION__ ": 6"); + WriteTrace(TraceDebug, __FUNCTION__ ": 6"); m_CPU_Usage.ResetCounters(); - WriteTrace(TraceDebug,__FUNCTION__ ": 7"); + WriteTrace(TraceDebug, __FUNCTION__ ": 7"); m_Profile.ResetCounters(); - WriteTrace(TraceDebug,__FUNCTION__ ": 8"); + WriteTrace(TraceDebug, __FUNCTION__ ": 8"); m_FPS.Reset(true); - WriteTrace(TraceDebug,__FUNCTION__ ": 9"); + WriteTrace(TraceDebug, __FUNCTION__ ": 9"); if (bLogX86Code()) { Stop_x86_Log(); Start_x86_Log(); } - WriteTrace(TraceDebug,__FUNCTION__ ": Done"); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); #ifdef TEST_SP_TRACKING m_CurrentSP = GPR[29].UW[0]; #endif if (bFastSP() && m_Recomp) { m_Recomp->ResetMemoryStackPos(); } - if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) + if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) { if (m_SyncCPU) { - for (int i = 0; i < (sizeof(m_LastSuccessSyncPC)/sizeof(m_LastSuccessSyncPC[0])); i++) + for (int i = 0; i < (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i++) { m_LastSuccessSyncPC[i] = 0; } @@ -1833,10 +1831,10 @@ bool CN64System::LoadState(LPCSTR FileName) SyncCPU(m_SyncCPU); } } - WriteTrace(TraceDebug,__FUNCTION__ ": 13"); + WriteTrace(TraceDebug, __FUNCTION__ ": 13"); std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE); - g_Notify->DisplayMessage(5,stdstr_f("%s %s",LoadMsg.c_str(),CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str()); - WriteTrace(TraceDebug,__FUNCTION__ ": Done"); + g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str()); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); return true; } @@ -1847,18 +1845,18 @@ void CN64System::DisplayRSPListCount() void CN64System::RunRSP() { - WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)",m_Reg.SP_STATUS_REG); - if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_HALT ) == 0) - { - if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_BROKE ) == 0 ) - { + WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)", m_Reg.SP_STATUS_REG); + if ((m_Reg.SP_STATUS_REG & SP_STATUS_HALT) == 0) + { + if ((m_Reg.SP_STATUS_REG & SP_STATUS_BROKE) == 0) + { SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfileAddr = Timer_None*/; - + DWORD Task = 0; if (m_RspBroke) { - g_MMU->LW_VAddr(0xA4000FC0,(uint32_t &)Task); - if (Task == 1 && (m_Reg.DPC_STATUS_REG & DPC_STATUS_FREEZE) != 0) + g_MMU->LW_VAddr(0xA4000FC0, (uint32_t &)Task); + if (Task == 1 && (m_Reg.DPC_STATUS_REG & DPC_STATUS_FREEZE) != 0) { WriteTrace(TraceRSP, __FUNCTION__ ": Dlist that is frozen"); return; @@ -1866,18 +1864,18 @@ void CN64System::RunRSP() switch (Task) { - case 1: + case 1: WriteTrace(TraceRSP, __FUNCTION__ ": *** Display list ***"); - m_DlistCount += 1; + m_DlistCount += 1; m_FPS.UpdateDlCounter(); break; - case 2: + case 2: WriteTrace(TraceRSP, __FUNCTION__ ": *** Audio list ***"); - m_AlistCount += 1; + m_AlistCount += 1; break; - default: + default: WriteTrace(TraceRSP, __FUNCTION__ ": *** Unknown list ***"); - m_UnknownCount += 1; + m_UnknownCount += 1; break; } @@ -1885,9 +1883,9 @@ void CN64System::RunRSP() { DisplayRSPListCount(); } - if (bShowCPUPer()) + if (bShowCPUPer()) { - switch (Task) + switch (Task) { case 1: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Dlist); break; case 2: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Alist); break; @@ -1895,15 +1893,14 @@ void CN64System::RunRSP() } } } - - __try + __try { WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - starting"); g_Plugins->RSP()->DoRspCycles(100); WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - Done"); } - __except( g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation()) ) + __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) { WriteTrace(TraceError, __FUNCTION__ ": exception generated"); g_Notify->FatalError(__FUNCTIONW__ L"\nUnknown memory action\n\nEmulation stop"); @@ -1911,17 +1908,17 @@ void CN64System::RunRSP() if (Task == 1 && bDelayDP() && ((m_Reg.m_GfxIntrReg & MI_INTR_DP) != 0)) { - g_SystemTimer->SetTimer(CSystemTimer::RSPTimerDlist,0x1000,false); + g_SystemTimer->SetTimer(CSystemTimer::RSPTimerDlist, 0x1000, false); m_Reg.m_GfxIntrReg &= ~MI_INTR_DP; } if (bShowCPUPer()) { m_CPU_Usage.StartTimer(CPU_UsageAddr); } //if (bProfiling) { m_Profile.StartTimer(ProfileAddr); } - if ( ( m_Reg.SP_STATUS_REG & SP_STATUS_HALT ) == 0 && - ( m_Reg.SP_STATUS_REG & SP_STATUS_BROKE ) == 0 && - m_Reg.m_RspIntrReg == 0) + if ((m_Reg.SP_STATUS_REG & SP_STATUS_HALT) == 0 && + (m_Reg.SP_STATUS_REG & SP_STATUS_BROKE) == 0 && + m_Reg.m_RspIntrReg == 0) { - g_SystemTimer->SetTimer(CSystemTimer::RspTimer,0x200,false); + g_SystemTimer->SetTimer(CSystemTimer::RspTimer, 0x200, false); m_RspBroke = false; } else @@ -1932,7 +1929,7 @@ void CN64System::RunRSP() g_Reg->CheckInterrupts(); } } - WriteTraceF(TraceRSP, __FUNCTION__ ": Done (SP Status %X)",m_Reg.SP_STATUS_REG); + WriteTraceF(TraceRSP, __FUNCTION__ ": Done (SP Status %X)", m_Reg.SP_STATUS_REG); } void CN64System::SyncToAudio() @@ -1944,19 +1941,19 @@ void CN64System::SyncToAudio() SPECIAL_TIMERS CPU_UsageAddr = Timer_None; if (bShowCPUPer()) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_Idel); } - + for (int i = 0; i < 50; i++) { if (g_Reg->m_AudioIntrReg != 0) { - WriteTraceF(TraceAudio, __FUNCTION__ ": Audio Interrupt done (%d)",i); + WriteTraceF(TraceAudio, __FUNCTION__ ": Audio Interrupt done (%d)", i); break; } Sleep(1); } - if (bShowCPUPer()) + if (bShowCPUPer()) { - m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300 ); + m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300); } } @@ -1964,53 +1961,53 @@ void CN64System::RefreshScreen() { SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfilingAddr = Timer_None*/; DWORD VI_INTR_TIME = 500000; - + if (bShowCPUPer()) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RefreshScreen); } //if (bProfiling) { ProfilingAddr = m_Profile.StartTimer(Timer_RefreshScreen); } //Calculate how many cycles to next refresh - if (m_Reg.VI_V_SYNC_REG == 0) + if (m_Reg.VI_V_SYNC_REG == 0) { VI_INTR_TIME = 500000; } else { VI_INTR_TIME = (m_Reg.VI_V_SYNC_REG + 1) * ViRefreshRate(); - if ((m_Reg.VI_V_SYNC_REG % 1) != 0) + if ((m_Reg.VI_V_SYNC_REG % 1) != 0) { VI_INTR_TIME -= 38; } } - g_SystemTimer->SetTimer(CSystemTimer::ViTimer,VI_INTR_TIME,true); + g_SystemTimer->SetTimer(CSystemTimer::ViTimer, VI_INTR_TIME, true); if (bFixedAudio()) { - g_Audio->SetViIntr (VI_INTR_TIME); + g_Audio->SetViIntr(VI_INTR_TIME); } - if (g_Plugins->Control()->GetKeys) + if (g_Plugins->Control()->GetKeys) { BUTTONS Keys; - memset(&Keys,0,sizeof(Keys)); + memset(&Keys, 0, sizeof(Keys)); for (int Control = 0; Control < 4; Control++) - { - g_Plugins->Control()->GetKeys(Control,&Keys); + { + g_Plugins->Control()->GetKeys(Control, &Keys); m_Buttons[Control] = Keys.Value; } } if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_UpdateScreen); } -// if (bProfiling) { m_Profile.StartTimer(Timer_UpdateScreen); } - + // if (bProfiling) { m_Profile.StartTimer(Timer_UpdateScreen); } + __try { - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": Starting"); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Starting"); g_Plugins->Gfx()->UpdateScreen(); - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": Done"); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Done"); } - __except (g_MMU->MemoryFilter( GetExceptionCode(), GetExceptionInformation())) + __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) { - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": Exception caught"); - WriteTrace(TraceError,__FUNCTION__ ": Exception caught"); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Exception caught"); + WriteTrace(TraceError, __FUNCTION__ ": Exception caught"); } g_MMU->UpdateFieldSerration((m_Reg.VI_STATUS_REG & 0x40) != 0); @@ -2031,18 +2028,18 @@ void CN64System::RefreshScreen() m_FPS.UpdateViCounter(); m_bCleanFrameBox = true; } - + if (m_bCleanFrameBox && !bDisplayFrameRate()) { - m_FPS.Reset (true); + m_FPS.Reset(true); m_bCleanFrameBox = false; } - if (bShowCPUPer()) + if (bShowCPUPer()) { m_CPU_Usage.StopTimer(); m_CPU_Usage.ShowCPU_Usage(); - m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300 ); + m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300); } if ((m_Reg.STATUS_REGISTER & STATUS_IE) != 0) { @@ -2060,12 +2057,12 @@ void CN64System::RefreshScreen() // if (bProfiling) { m_Profile.StartTimer(ProfilingAddr != Timer_None ? ProfilingAddr : Timer_R4300); } } -bool CN64System::WriteToProtectedMemory (uint32_t Address, int length) +bool CN64System::WriteToProtectedMemory(uint32_t Address, int length) { - WriteTraceF(TraceDebug,__FUNCTION__ ": Address: %X Len: %d",Address,length); + WriteTraceF(TraceDebug, __FUNCTION__ ": Address: %X Len: %d", Address, length); if (m_Recomp) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); #ifdef tofix return m_Recomp->ClearRecompCode_Phys(Address,length,CRecompiler::Remove_ProtectedMem); #endif @@ -2073,17 +2070,17 @@ bool CN64System::WriteToProtectedMemory (uint32_t Address, int length) return false; } -void CN64System::TLB_Mapped ( uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly ) +void CN64System::TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly) { - m_MMU_VM.TLB_Mapped(VAddr,Len,PAddr,bReadOnly); + m_MMU_VM.TLB_Mapped(VAddr, Len, PAddr, bReadOnly); } -void CN64System::TLB_Unmaped ( uint32_t VAddr, uint32_t Len ) +void CN64System::TLB_Unmaped(uint32_t VAddr, uint32_t Len) { - m_MMU_VM.TLB_Unmaped(VAddr,Len); + m_MMU_VM.TLB_Unmaped(VAddr, Len); if (m_Recomp && bSMM_TLB()) { - m_Recomp->ClearRecompCode_Virt(VAddr,Len,CRecompiler::Remove_TLB); + m_Recomp->ClearRecompCode_Virt(VAddr, Len, CRecompiler::Remove_TLB); } } @@ -2093,4 +2090,4 @@ void CN64System::TLB_Changed() { g_Debugger->TLBChanged(); } -} +} \ No newline at end of file diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index 79971522a..27292a815 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -21,53 +21,53 @@ class CRecompiler; //#define TEST_SP_TRACKING //track the SP to make sure all ops pick it up fine class CN64System : - public CMipsMemory_CallBack, - public CTLB_CB, - private CSystemEvents, - protected CN64SystemSettings, - public CGameSettings, - protected CDebugSettings + public CMipsMemory_CallBack, + public CTLB_CB, + private CSystemEvents, + protected CN64SystemSettings, + public CGameSettings, + protected CDebugSettings { public: - CN64System(CPlugins * Plugins, bool SavesReadOnly); - virtual ~CN64System(void); + CN64System(CPlugins * Plugins, bool SavesReadOnly); + virtual ~CN64System(void); struct ThreadInfo { HANDLE * ThreadHandle; DWORD ThreadID; }; - CProfiling m_Profile; - CCheats m_Cheats; - bool m_EndEmulation; - SAVE_CHIP_TYPE m_SaveUsing; + CProfiling m_Profile; + CCheats m_Cheats; + bool m_EndEmulation; + SAVE_CHIP_TYPE m_SaveUsing; - //Methods - static bool RunFileImage(const char * FileLoc); - static void CloseSystem(void); + //Methods + static bool RunFileImage(const char * FileLoc); + static void CloseSystem(void); - void CloseCpu (); - void ExternalEvent ( SystemEvent action ); //covers gui interacting and timers etc.. - stdstr ChooseFileToOpen ( HWND hParent ); - void DisplayRomInfo ( HWND hParent ); - void StartEmulation ( bool NewThread ); - void SyncToAudio (); - void IncreaseSpeed () { m_Limitor.IncreaseSpeed(); } - void DecreaseSpeed () { m_Limitor.DecreaseSpeed(); } - void Reset ( bool bInitReg, bool ClearMenory ); - void GameReset (); - void PluginReset (); + void CloseCpu(); + void ExternalEvent(SystemEvent action); //covers gui interacting and timers etc.. + stdstr ChooseFileToOpen(HWND hParent); + void DisplayRomInfo(HWND hParent); + void StartEmulation(bool NewThread); + void SyncToAudio(); + void IncreaseSpeed() { m_Limitor.IncreaseSpeed(); } + void DecreaseSpeed() { m_Limitor.DecreaseSpeed(); } + void Reset(bool bInitReg, bool ClearMenory); + void GameReset(); + void PluginReset(); - void Pause (); - void RunRSP (); - bool SaveState (); - bool LoadState ( LPCSTR FileName ); - bool LoadState (); + void Pause(); + void RunRSP(); + bool SaveState(); + bool LoadState(LPCSTR FileName); + bool LoadState(); bool DmaUsed() const { return m_DMAUsed; } void SetDmaUsed(bool DMAUsed) { m_DMAUsed = DMAUsed; } - void SetCheatsSlectionChanged(bool changed) { m_CheatsSlectionChanged = changed; } - bool HasCheatsSlectionChanged(void) const { return m_CheatsSlectionChanged; } + void SetCheatsSlectionChanged(bool changed) { m_CheatsSlectionChanged = changed; } + bool HasCheatsSlectionChanged(void) const { return m_CheatsSlectionChanged; } DWORD GetButtons(int Control) const { return m_Buttons[Control]; } //Variable used to track that the SP is being handled and stays the same as the real SP in sync core @@ -75,31 +75,31 @@ public: DWORD m_CurrentSP; #endif //For Sync CPU - void UpdateSyncCPU ( CN64System * const SecondCPU, DWORD const Cycles ); - void SyncCPU ( CN64System * const SecondCPU ); - void SyncCPUPC ( CN64System * const SecondCPU ); - void SyncSystem (); - void SyncSystemPC (); + void UpdateSyncCPU(CN64System * const SecondCPU, DWORD const Cycles); + void SyncCPU(CN64System * const SecondCPU); + void SyncCPUPC(CN64System * const SecondCPU); + void SyncSystem(); + void SyncSystemPC(); private: //Make sure plugins can directly access this information friend CGfxPlugin; friend CAudioPlugin; friend CRSP_Plugin; friend CControl_Plugin; - + //Recompiler has access to manipulate and call functions friend CSystemTimer; //Used for loading and potentially executing the CPU in its own thread. - static void StartEmulationThread ( ThreadInfo * Info ); - static bool EmulationStarting ( HANDLE hThread, DWORD ThreadId ); + static void StartEmulationThread(ThreadInfo * Info); + static bool EmulationStarting(HANDLE hThread, DWORD ThreadId); - void ExecuteCPU (); - void RefreshScreen (); - void DumpSyncErrors ( CN64System * SecondCPU ); - void StartEmulation2 ( bool NewThread ); - bool SetActiveSystem ( bool bActive = true ); - void InitRegisters ( bool bPostPif, CMipsMemory & MMU ); + void ExecuteCPU(); + void RefreshScreen(); + void DumpSyncErrors(CN64System * SecondCPU); + void StartEmulation2(bool NewThread); + bool SetActiveSystem(bool bActive = true); + void InitRegisters(bool bPostPif, CMipsMemory & MMU); void DisplayRSPListCount(); //CPU Methods @@ -118,11 +118,11 @@ private: void TLB_Unmaped(uint32_t VAddr, uint32_t Len); void TLB_Changed(); - CPlugins * const m_Plugins; //The plugin container + CPlugins * const m_Plugins; //The plugin container CN64System * m_SyncCPU; CPlugins * m_SyncPlugins; CMainGui * m_SyncWindow; - CMipsMemoryVM m_MMU_VM; //Memory of the n64 + CMipsMemoryVM m_MMU_VM; //Memory of the n64 CTLB m_TLB; CRegisters m_Reg; CFramePerSecond m_FPS; @@ -141,10 +141,10 @@ private: bool m_TestTimer; DWORD m_NextInstruction; DWORD m_JumpToLocation; - uint32_t m_TLBLoadAddress; - uint32_t m_TLBStoreAddress; + uint32_t m_TLBLoadAddress; + uint32_t m_TLBStoreAddress; DWORD m_SyncCount; - bool m_CheatsSlectionChanged; + bool m_CheatsSlectionChanged; //When Syncing cores this is the PC where it last Sync'ed correctly DWORD m_LastSuccessSyncPC[10]; @@ -153,7 +153,7 @@ private: //Handle to the cpu thread HANDLE m_CPU_Handle; DWORD m_CPU_ThreadID; - + //Handle to pause mutex void * m_hPauseEvent; From 66b6be4bd7e3f0b6cb1c8eebbbadc7c2533d1a96 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 17:52:27 +1100 Subject: [PATCH 032/102] [Project64] N64 Class.cpp tabs to spaces --- Source/Project64/N64 System/N64 Class.cpp | 3458 ++++++++++----------- Source/Project64/N64 System/N64 Class.h | 232 +- 2 files changed, 1845 insertions(+), 1845 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 54f149ba1..fb49d3464 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -44,2050 +44,2050 @@ m_CPU_Handle(NULL), m_CPU_ThreadID(0), m_CheatsSlectionChanged(false) { - DWORD gameHertz = g_Settings->LoadDword(Game_ScreenHertz); - if (gameHertz == 0) - { - gameHertz = (SystemType() == SYSTEM_PAL) ? 50 : 60; - } - m_hPauseEvent = CreateEvent(NULL, true, false, NULL); - m_Limitor.SetHertz(gameHertz); - g_Settings->SaveDword(GameRunning_ScreenHertz, gameHertz); - m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats), Plugins); + DWORD gameHertz = g_Settings->LoadDword(Game_ScreenHertz); + if (gameHertz == 0) + { + gameHertz = (SystemType() == SYSTEM_PAL) ? 50 : 60; + } + m_hPauseEvent = CreateEvent(NULL, true, false, NULL); + m_Limitor.SetHertz(gameHertz); + g_Settings->SaveDword(GameRunning_ScreenHertz, gameHertz); + m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats), Plugins); } CN64System::~CN64System() { - SetActiveSystem(false); - Mempak::Close(); - if (m_SyncCPU) - { - m_SyncCPU->CpuStopped(); - delete m_SyncCPU; - m_SyncCPU = NULL; - } - if (m_Recomp) - { - delete m_Recomp; - m_Recomp = NULL; - } - if (m_SyncPlugins) - { - delete m_SyncPlugins; - m_SyncPlugins = NULL; - } - if (m_SyncWindow) - { - delete m_SyncWindow; - m_SyncWindow = NULL; - } + SetActiveSystem(false); + Mempak::Close(); + if (m_SyncCPU) + { + m_SyncCPU->CpuStopped(); + delete m_SyncCPU; + m_SyncCPU = NULL; + } + if (m_Recomp) + { + delete m_Recomp; + m_Recomp = NULL; + } + if (m_SyncPlugins) + { + delete m_SyncPlugins; + m_SyncPlugins = NULL; + } + if (m_SyncWindow) + { + delete m_SyncWindow; + m_SyncWindow = NULL; + } } void CN64System::ExternalEvent(SystemEvent action) { - switch (action) - { - case SysEvent_Profile_GenerateLogs: - case SysEvent_Profile_StartStop: - case SysEvent_Profile_ResetLogs: - case SysEvent_ExecuteInterrupt: - case SysEvent_SaveMachineState: - case SysEvent_LoadMachineState: - case SysEvent_ChangingFullScreen: - case SysEvent_GSButtonPressed: - case SysEvent_ResetCPU_SoftDone: - case SysEvent_Interrupt_SP: - case SysEvent_Interrupt_SI: - case SysEvent_Interrupt_AI: - case SysEvent_Interrupt_VI: - case SysEvent_Interrupt_PI: - case SysEvent_Interrupt_DP: - case SysEvent_ResetCPU_Hard: - case SysEvent_ResetCPU_Soft: - case SysEvent_CloseCPU: - case SysEvent_ChangePlugins: - QueueEvent(action); - break; - case SysEvent_PauseCPU_FromMenu: - case SysEvent_PauseCPU_AppLostFocus: - case SysEvent_PauseCPU_AppLostActive: - case SysEvent_PauseCPU_SaveGame: - case SysEvent_PauseCPU_LoadGame: - case SysEvent_PauseCPU_DumpMemory: - case SysEvent_PauseCPU_SearchMemory: - case SysEvent_PauseCPU_Settings: - case SysEvent_PauseCPU_Cheats: - if (!g_Settings->LoadBool(GameRunning_CPU_Paused)) - { - QueueEvent(action); - } - break; - case SysEvent_ResumeCPU_FromMenu: - // always resume if from menu - SetEvent(m_hPauseEvent); - break; - case SysEvent_ResumeCPU_AppGainedFocus: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostFocus) - { - SetEvent(m_hPauseEvent); - } - break; - case SysEvent_ResumeCPU_AppGainedActive: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostActive) - { - SetEvent(m_hPauseEvent); - } - break; - case SysEvent_ResumeCPU_SaveGame: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SaveGame) - { - SetEvent(m_hPauseEvent); - } - break; - case SysEvent_ResumeCPU_LoadGame: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_LoadGame) - { - SetEvent(m_hPauseEvent); - } - break; - case SysEvent_ResumeCPU_DumpMemory: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_DumpMemory) - { - SetEvent(m_hPauseEvent); - } - break; - case SysEvent_ResumeCPU_SearchMemory: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SearchMemory) - { - SetEvent(m_hPauseEvent); - } - break; - case SysEvent_ResumeCPU_Settings: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Settings) - { - SetEvent(m_hPauseEvent); - } - break; - case SysEvent_ResumeCPU_Cheats: - if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Cheats) - { - SetEvent(m_hPauseEvent); - } - break; - default: - WriteTraceF(TraceError, __FUNCTION__ ": Unknown event %d", action); - g_Notify->BreakPoint(__FILEW__, __LINE__); - } + switch (action) + { + case SysEvent_Profile_GenerateLogs: + case SysEvent_Profile_StartStop: + case SysEvent_Profile_ResetLogs: + case SysEvent_ExecuteInterrupt: + case SysEvent_SaveMachineState: + case SysEvent_LoadMachineState: + case SysEvent_ChangingFullScreen: + case SysEvent_GSButtonPressed: + case SysEvent_ResetCPU_SoftDone: + case SysEvent_Interrupt_SP: + case SysEvent_Interrupt_SI: + case SysEvent_Interrupt_AI: + case SysEvent_Interrupt_VI: + case SysEvent_Interrupt_PI: + case SysEvent_Interrupt_DP: + case SysEvent_ResetCPU_Hard: + case SysEvent_ResetCPU_Soft: + case SysEvent_CloseCPU: + case SysEvent_ChangePlugins: + QueueEvent(action); + break; + case SysEvent_PauseCPU_FromMenu: + case SysEvent_PauseCPU_AppLostFocus: + case SysEvent_PauseCPU_AppLostActive: + case SysEvent_PauseCPU_SaveGame: + case SysEvent_PauseCPU_LoadGame: + case SysEvent_PauseCPU_DumpMemory: + case SysEvent_PauseCPU_SearchMemory: + case SysEvent_PauseCPU_Settings: + case SysEvent_PauseCPU_Cheats: + if (!g_Settings->LoadBool(GameRunning_CPU_Paused)) + { + QueueEvent(action); + } + break; + case SysEvent_ResumeCPU_FromMenu: + // always resume if from menu + SetEvent(m_hPauseEvent); + break; + case SysEvent_ResumeCPU_AppGainedFocus: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostFocus) + { + SetEvent(m_hPauseEvent); + } + break; + case SysEvent_ResumeCPU_AppGainedActive: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostActive) + { + SetEvent(m_hPauseEvent); + } + break; + case SysEvent_ResumeCPU_SaveGame: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SaveGame) + { + SetEvent(m_hPauseEvent); + } + break; + case SysEvent_ResumeCPU_LoadGame: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_LoadGame) + { + SetEvent(m_hPauseEvent); + } + break; + case SysEvent_ResumeCPU_DumpMemory: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_DumpMemory) + { + SetEvent(m_hPauseEvent); + } + break; + case SysEvent_ResumeCPU_SearchMemory: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SearchMemory) + { + SetEvent(m_hPauseEvent); + } + break; + case SysEvent_ResumeCPU_Settings: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Settings) + { + SetEvent(m_hPauseEvent); + } + break; + case SysEvent_ResumeCPU_Cheats: + if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Cheats) + { + SetEvent(m_hPauseEvent); + } + break; + default: + WriteTraceF(TraceError, __FUNCTION__ ": Unknown event %d", action); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } } bool CN64System::RunFileImage(const char * FileLoc) { - CloseSystem(); - if (g_Settings->LoadBool(GameRunning_LoadingInProgress)) - { - return false; - } - g_Settings->SaveBool(GameRunning_LoadingInProgress, true); + CloseSystem(); + if (g_Settings->LoadBool(GameRunning_LoadingInProgress)) + { + return false; + } + g_Settings->SaveBool(GameRunning_LoadingInProgress, true); - WriteTrace(TraceDebug, __FUNCTION__ ": Mark Rom as loading"); + WriteTrace(TraceDebug, __FUNCTION__ ": Mark Rom as loading"); - //Mark the rom as loading - g_Settings->SaveBool(GameRunning_LoadingInProgress, true); - Notify().RefreshMenu(); + //Mark the rom as loading + g_Settings->SaveBool(GameRunning_LoadingInProgress, true); + Notify().RefreshMenu(); - //Try to load the passed N64 rom - if (g_Rom == NULL) - { - WriteTrace(TraceDebug, __FUNCTION__ ": Allocating global rom object"); - g_Rom = new CN64Rom(); - } - else - { - WriteTrace(TraceDebug, __FUNCTION__ ": Use existing global rom object"); - } + //Try to load the passed N64 rom + if (g_Rom == NULL) + { + WriteTrace(TraceDebug, __FUNCTION__ ": Allocating global rom object"); + g_Rom = new CN64Rom(); + } + else + { + WriteTrace(TraceDebug, __FUNCTION__ ": Use existing global rom object"); + } - WriteTraceF(TraceDebug, __FUNCTION__ ": Loading \"%s\"", FileLoc); - if (g_Rom->LoadN64Image(FileLoc)) - { - g_System->RefreshGameSettings(); + WriteTraceF(TraceDebug, __FUNCTION__ ": Loading \"%s\"", FileLoc); + if (g_Rom->LoadN64Image(FileLoc)) + { + g_System->RefreshGameSettings(); - WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); - Notify().AddRecentRom(FileLoc); - Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); + WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); + Notify().AddRecentRom(FileLoc); + Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); - g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); + Notify().RefreshMenu(); - if (g_Settings->LoadDword(Setting_AutoStart) != 0) - { - g_BaseSystem = new CN64System(g_Plugins, false); - if (g_BaseSystem) - { - g_BaseSystem->StartEmulation(true); - } - } - } - else - { - WriteTraceF(TraceError, __FUNCTION__ ": LoadN64Image failed (\"%s\")", FileLoc); - g_Notify->DisplayError(g_Rom->GetError()); - delete g_Rom; - g_Rom = NULL; - g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); - return false; - } - return true; + if (g_Settings->LoadDword(Setting_AutoStart) != 0) + { + g_BaseSystem = new CN64System(g_Plugins, false); + if (g_BaseSystem) + { + g_BaseSystem->StartEmulation(true); + } + } + } + else + { + WriteTraceF(TraceError, __FUNCTION__ ": LoadN64Image failed (\"%s\")", FileLoc); + g_Notify->DisplayError(g_Rom->GetError()); + delete g_Rom; + g_Rom = NULL; + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); + Notify().RefreshMenu(); + return false; + } + return true; } void CN64System::CloseSystem() { - if (g_BaseSystem) - { - g_BaseSystem->CloseCpu(); - delete g_BaseSystem; - g_BaseSystem = NULL; - } + if (g_BaseSystem) + { + g_BaseSystem->CloseCpu(); + delete g_BaseSystem; + g_BaseSystem = NULL; + } } bool CN64System::EmulationStarting(HANDLE hThread, DWORD ThreadId) { - bool bRes = true; + bool bRes = true; - WriteTrace(TraceDebug, __FUNCTION__ ": Setting N64 system as active"); - if (g_BaseSystem->SetActiveSystem(true)) - { - g_BaseSystem->m_CPU_Handle = hThread; - g_BaseSystem->m_CPU_ThreadID = ThreadId; - WriteTrace(TraceDebug, __FUNCTION__ ": Setting up N64 system done"); - g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); - try - { - WriteTrace(TraceDebug, __FUNCTION__ ": Game set to auto start, starting"); - g_BaseSystem->StartEmulation2(false); - WriteTrace(TraceDebug, __FUNCTION__ ": Game Done"); - } - catch (...) - { - WriteTraceF(TraceError, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); - char Message[600]; - sprintf(Message, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); - MessageBox(NULL, Message, "Exception", MB_OK); - } - } - else - { - WriteTrace(TraceError, __FUNCTION__ ": SetActiveSystem failed"); - g_Notify->DisplayError(__FUNCTIONW__ L": Failed to Initialize N64 System"); - g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); - bRes = false; - } - return bRes; + WriteTrace(TraceDebug, __FUNCTION__ ": Setting N64 system as active"); + if (g_BaseSystem->SetActiveSystem(true)) + { + g_BaseSystem->m_CPU_Handle = hThread; + g_BaseSystem->m_CPU_ThreadID = ThreadId; + WriteTrace(TraceDebug, __FUNCTION__ ": Setting up N64 system done"); + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); + Notify().RefreshMenu(); + try + { + WriteTrace(TraceDebug, __FUNCTION__ ": Game set to auto start, starting"); + g_BaseSystem->StartEmulation2(false); + WriteTrace(TraceDebug, __FUNCTION__ ": Game Done"); + } + catch (...) + { + WriteTraceF(TraceError, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); + char Message[600]; + sprintf(Message, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); + MessageBox(NULL, Message, "Exception", MB_OK); + } + } + else + { + WriteTrace(TraceError, __FUNCTION__ ": SetActiveSystem failed"); + g_Notify->DisplayError(__FUNCTIONW__ L": Failed to Initialize N64 System"); + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); + Notify().RefreshMenu(); + bRes = false; + } + return bRes; } void CN64System::StartEmulation2(bool NewThread) { - if (NewThread) - { - WriteTrace(TraceDebug, __FUNCTION__ ": Starting"); + if (NewThread) + { + WriteTrace(TraceDebug, __FUNCTION__ ": Starting"); - Notify().HideRomBrowser(); + Notify().HideRomBrowser(); - if (bHaveDebugger()) - { - g_LogOptions.GenerateLog = g_Settings->LoadBool(Debugger_GenerateDebugLog); - LoadLogOptions(&g_LogOptions, FALSE); - StartLog(); - } + if (bHaveDebugger()) + { + g_LogOptions.GenerateLog = g_Settings->LoadBool(Debugger_GenerateDebugLog); + LoadLogOptions(&g_LogOptions, FALSE); + StartLog(); + } - CInterpreterCPU::BuildCPU(); + CInterpreterCPU::BuildCPU(); - DWORD CpuType = g_Settings->LoadDword(Game_CpuType); + DWORD CpuType = g_Settings->LoadDword(Game_CpuType); - if (CpuType == CPU_SyncCores && !g_Settings->LoadBool(Debugger_Enabled)) - { - g_Settings->SaveDword(Game_CpuType, CPU_Recompiler); - CpuType = CPU_Recompiler; - } + if (CpuType == CPU_SyncCores && !g_Settings->LoadBool(Debugger_Enabled)) + { + g_Settings->SaveDword(Game_CpuType, CPU_Recompiler); + CpuType = CPU_Recompiler; + } - if (CpuType == CPU_SyncCores) - { - g_Notify->DisplayMessage(5, L"Copy Plugins"); - g_Plugins->CopyPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); + if (CpuType == CPU_SyncCores) + { + g_Notify->DisplayMessage(5, L"Copy Plugins"); + g_Plugins->CopyPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); #if defined(WINDOWS_UI) - m_SyncWindow = new CMainGui(false); - m_SyncPlugins = new CPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); - m_SyncPlugins->SetRenderWindows(m_SyncWindow, m_SyncWindow); + m_SyncWindow = new CMainGui(false); + m_SyncPlugins = new CPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); + m_SyncPlugins->SetRenderWindows(m_SyncWindow, m_SyncWindow); - m_SyncCPU = new CN64System(m_SyncPlugins, true); + m_SyncCPU = new CN64System(m_SyncPlugins, true); #else - g_Notify -> BreakPoint(__FILEW__, __LINE__); + g_Notify -> BreakPoint(__FILEW__, __LINE__); #endif - } + } - if (CpuType == CPU_Recompiler || CpuType == CPU_SyncCores) - { - m_Recomp = new CRecompiler(m_Reg, m_Profile, m_EndEmulation); - } + if (CpuType == CPU_Recompiler || CpuType == CPU_SyncCores) + { + m_Recomp = new CRecompiler(m_Reg, m_Profile, m_EndEmulation); + } - bool bSetActive = true; - if (m_SyncCPU) - { - bSetActive = m_SyncCPU->SetActiveSystem(); - } + bool bSetActive = true; + if (m_SyncCPU) + { + bSetActive = m_SyncCPU->SetActiveSystem(); + } - if (bSetActive) - { - bSetActive = SetActiveSystem(); - } + if (bSetActive) + { + bSetActive = SetActiveSystem(); + } - if (!bSetActive) - { - g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - g_Notify->DisplayError(MSG_PLUGIN_NOT_INIT); + if (!bSetActive) + { + g_Settings->SaveBool(GameRunning_LoadingInProgress, false); + g_Notify->DisplayError(MSG_PLUGIN_NOT_INIT); - Notify().RefreshMenu(); - Notify().ShowRomBrowser(); - } + Notify().RefreshMenu(); + Notify().ShowRomBrowser(); + } - Notify().MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); + Notify().MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); - ThreadInfo * Info = new ThreadInfo; - HANDLE * hThread = new HANDLE; - *hThread = NULL; + ThreadInfo * Info = new ThreadInfo; + HANDLE * hThread = new HANDLE; + *hThread = NULL; - //create the needed info into a structure to pass as one parameter - //for creating a thread - Info->ThreadHandle = hThread; + //create the needed info into a structure to pass as one parameter + //for creating a thread + Info->ThreadHandle = hThread; - *hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)StartEmulationThread, Info, 0, &Info->ThreadID); - } - else - { - //mark the emulation as starting and fix up menus - g_Notify->DisplayMessage(5, MSG_EMULATION_STARTED); + *hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)StartEmulationThread, Info, 0, &Info->ThreadID); + } + else + { + //mark the emulation as starting and fix up menus + g_Notify->DisplayMessage(5, MSG_EMULATION_STARTED); - if (g_Settings->LoadBool(Setting_AutoFullscreen)) - { - WriteTrace(TraceDebug, __FUNCTION__ " 15"); - CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str()); - stdstr Status = g_Settings->LoadStringVal(Rdb_Status); + if (g_Settings->LoadBool(Setting_AutoFullscreen)) + { + WriteTrace(TraceDebug, __FUNCTION__ " 15"); + CIniFile RomIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str()); + stdstr Status = g_Settings->LoadStringVal(Rdb_Status); - char String[100]; - RomIniFile.GetString("Rom Status", stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(), "true", String, sizeof(String)); - if (_stricmp(String, "true") == 0) - { - Notify().ChangeFullScreen(); - } - } - ExecuteCPU(); - } + char String[100]; + RomIniFile.GetString("Rom Status", stdstr_f("%s.AutoFullScreen", Status.c_str()).c_str(), "true", String, sizeof(String)); + if (_stricmp(String, "true") == 0) + { + Notify().ChangeFullScreen(); + } + } + ExecuteCPU(); + } } void CN64System::StartEmulation(bool NewThread) { - __try - { - StartEmulation2(NewThread); - } - __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) - { - char Message[600]; - sprintf(Message, "Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); - MessageBox(NULL, Message, "Exception", MB_OK); - } + __try + { + StartEmulation2(NewThread); + } + __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) + { + char Message[600]; + sprintf(Message, "Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); + MessageBox(NULL, Message, "Exception", MB_OK); + } } void CN64System::StartEmulationThread(ThreadInfo * Info) { - CoInitialize(NULL); + CoInitialize(NULL); - EmulationStarting(*Info->ThreadHandle, Info->ThreadID); - delete Info->ThreadHandle; - delete Info; + EmulationStarting(*Info->ThreadHandle, Info->ThreadID); + delete Info->ThreadHandle; + delete Info; - CoUninitialize(); + CoUninitialize(); } void CN64System::CloseCpu() { - if (m_CPU_Handle == NULL) - { - return; - } + if (m_CPU_Handle == NULL) + { + return; + } - m_EndEmulation = true; - if (g_Settings->LoadBool(GameRunning_CPU_Paused)) - { - SetEvent(m_hPauseEvent); - } + m_EndEmulation = true; + if (g_Settings->LoadBool(GameRunning_CPU_Paused)) + { + SetEvent(m_hPauseEvent); + } - if (GetCurrentThreadId() == m_CPU_ThreadID) - { - ExternalEvent(SysEvent_CloseCPU); - return; - } + if (GetCurrentThreadId() == m_CPU_ThreadID) + { + ExternalEvent(SysEvent_CloseCPU); + return; + } - HANDLE hThread = m_CPU_Handle; - for (int count = 0; count < 200; count++) - { - Sleep(100); - if (Notify().ProcessGuiMessages()) - { - return; - } + HANDLE hThread = m_CPU_Handle; + for (int count = 0; count < 200; count++) + { + Sleep(100); + if (Notify().ProcessGuiMessages()) + { + return; + } - DWORD ExitCode; - if (GetExitCodeThread(hThread, &ExitCode)) - { - if (ExitCode != STILL_ACTIVE) - { - break; - } - } - } + DWORD ExitCode; + if (GetExitCodeThread(hThread, &ExitCode)) + { + if (ExitCode != STILL_ACTIVE) + { + break; + } + } + } - if (hThread) - { - DWORD ExitCode; - GetExitCodeThread(hThread, &ExitCode); - if (ExitCode == STILL_ACTIVE) - { - TerminateThread(hThread, 0); - } - } - CpuStopped(); + if (hThread) + { + DWORD ExitCode; + GetExitCodeThread(hThread, &ExitCode); + if (ExitCode == STILL_ACTIVE) + { + TerminateThread(hThread, 0); + } + } + CpuStopped(); } void CN64System::DisplayRomInfo(HWND hParent) { - if (!g_Rom) { return; } + if (!g_Rom) { return; } - RomInformation Info(g_Rom); - Info.DisplayInformation(hParent); + RomInformation Info(g_Rom); + Info.DisplayInformation(hParent); } void CN64System::Pause() { - if (m_EndEmulation) - { - return; - } - ResetEvent(m_hPauseEvent); - g_Settings->SaveBool(GameRunning_CPU_Paused, true); - Notify().RefreshMenu(); - g_Notify->DisplayMessage(5, MSG_CPU_PAUSED); - WaitForSingleObject(m_hPauseEvent, INFINITE); - ResetEvent(m_hPauseEvent); - g_Settings->SaveBool(GameRunning_CPU_Paused, (DWORD)false); - Notify().RefreshMenu(); - Notify().DisplayMessage(5, MSG_CPU_RESUMED); + if (m_EndEmulation) + { + return; + } + ResetEvent(m_hPauseEvent); + g_Settings->SaveBool(GameRunning_CPU_Paused, true); + Notify().RefreshMenu(); + g_Notify->DisplayMessage(5, MSG_CPU_PAUSED); + WaitForSingleObject(m_hPauseEvent, INFINITE); + ResetEvent(m_hPauseEvent); + g_Settings->SaveBool(GameRunning_CPU_Paused, (DWORD)false); + Notify().RefreshMenu(); + Notify().DisplayMessage(5, MSG_CPU_RESUMED); } stdstr CN64System::ChooseFileToOpen(HWND hParent) { - OPENFILENAME openfilename; - char FileName[_MAX_PATH], Directory[_MAX_PATH]; + OPENFILENAME openfilename; + char FileName[_MAX_PATH], Directory[_MAX_PATH]; - memset(&FileName, 0, sizeof(FileName)); - memset(&openfilename, 0, sizeof(openfilename)); + memset(&FileName, 0, sizeof(FileName)); + memset(&openfilename, 0, sizeof(openfilename)); - strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str()); + strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str()); - openfilename.lStructSize = sizeof(openfilename); - openfilename.hwndOwner = (HWND)hParent; - openfilename.lpstrFilter = "N64 ROMs (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0"; - openfilename.lpstrFile = FileName; - openfilename.lpstrInitialDir = Directory; - openfilename.nMaxFile = MAX_PATH; - openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + openfilename.lStructSize = sizeof(openfilename); + openfilename.hwndOwner = (HWND)hParent; + openfilename.lpstrFilter = "N64 ROMs (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0"; + openfilename.lpstrFile = FileName; + openfilename.lpstrInitialDir = Directory; + openfilename.nMaxFile = MAX_PATH; + openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - if (GetOpenFileName(&openfilename)) - { - return stdstr(FileName); - } - return stdstr(""); + if (GetOpenFileName(&openfilename)) + { + return stdstr(FileName); + } + return stdstr(""); } void CN64System::GameReset() { - m_SystemTimer.SetTimer(CSystemTimer::SoftResetTimer, 0x3000000, false); - m_Plugins->Gfx()->ShowCFB(); - m_Reg.FAKE_CAUSE_REGISTER |= CAUSE_IP4; - m_Plugins->Gfx()->SoftReset(); - if (m_SyncCPU) - { - m_SyncCPU->GameReset(); - } + m_SystemTimer.SetTimer(CSystemTimer::SoftResetTimer, 0x3000000, false); + m_Plugins->Gfx()->ShowCFB(); + m_Reg.FAKE_CAUSE_REGISTER |= CAUSE_IP4; + m_Plugins->Gfx()->SoftReset(); + if (m_SyncCPU) + { + m_SyncCPU->GameReset(); + } } void CN64System::PluginReset() { - if (!m_Plugins->ResetInUiThread(this)) - { - g_Notify->DisplayMessage(5, MSG_PLUGIN_NOT_INIT); - if (g_BaseSystem) - { - g_BaseSystem->m_EndEmulation = true; - } - } - if (m_SyncCPU) - { - if (!m_SyncCPU->m_Plugins->ResetInUiThread(m_SyncCPU)) - { - g_Notify->DisplayMessage(5, MSG_PLUGIN_NOT_INIT); - if (g_BaseSystem) - { - g_BaseSystem->m_EndEmulation = true; - } - } - } - Notify().RefreshMenu(); - if (m_Recomp) - { - m_Recomp->Reset(); - } - m_Plugins->RomOpened(); - if (m_SyncCPU) - { - m_SyncCPU->m_Plugins->RomOpened(); - } + if (!m_Plugins->ResetInUiThread(this)) + { + g_Notify->DisplayMessage(5, MSG_PLUGIN_NOT_INIT); + if (g_BaseSystem) + { + g_BaseSystem->m_EndEmulation = true; + } + } + if (m_SyncCPU) + { + if (!m_SyncCPU->m_Plugins->ResetInUiThread(m_SyncCPU)) + { + g_Notify->DisplayMessage(5, MSG_PLUGIN_NOT_INIT); + if (g_BaseSystem) + { + g_BaseSystem->m_EndEmulation = true; + } + } + } + Notify().RefreshMenu(); + if (m_Recomp) + { + m_Recomp->Reset(); + } + m_Plugins->RomOpened(); + if (m_SyncCPU) + { + m_SyncCPU->m_Plugins->RomOpened(); + } #ifndef _WIN64 - _controlfp(_PC_53, _MCW_PC); + _controlfp(_PC_53, _MCW_PC); #endif } void CN64System::Reset(bool bInitReg, bool ClearMenory) { - g_Settings->SaveBool(GameRunning_InReset, true); - RefreshGameSettings(); - m_Audio.Reset(); - m_MMU_VM.Reset(ClearMenory); - Mempak::Close(); + g_Settings->SaveBool(GameRunning_InReset, true); + RefreshGameSettings(); + m_Audio.Reset(); + m_MMU_VM.Reset(ClearMenory); + Mempak::Close(); - m_CyclesToSkip = 0; - m_AlistCount = 0; - m_DlistCount = 0; - m_UnknownCount = 0; - m_DMAUsed = false; - m_RspBroke = true; - m_SyncCount = 0; + m_CyclesToSkip = 0; + m_AlistCount = 0; + m_DlistCount = 0; + m_UnknownCount = 0; + m_DMAUsed = false; + m_RspBroke = true; + m_SyncCount = 0; - for (int i = 0, n = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i < n; i++) - { - m_LastSuccessSyncPC[i] = 0; - } + for (int i = 0, n = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i < n; i++) + { + m_LastSuccessSyncPC[i] = 0; + } - if (bInitReg) - { - bool PostPif = true; + if (bInitReg) + { + bool PostPif = true; - InitRegisters(PostPif, m_MMU_VM); - if (PostPif) - { - memcpy((m_MMU_VM.Dmem() + 0x40), (g_Rom->GetRomAddress() + 0x040), 0xFBC); - } - } - else - { - m_Reg.Reset(); - } + InitRegisters(PostPif, m_MMU_VM); + if (PostPif) + { + memcpy((m_MMU_VM.Dmem() + 0x40), (g_Rom->GetRomAddress() + 0x040), 0xFBC); + } + } + else + { + m_Reg.Reset(); + } - m_SystemTimer.Reset(); - m_SystemTimer.SetTimer(CSystemTimer::CompareTimer, m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER, false); + m_SystemTimer.Reset(); + m_SystemTimer.SetTimer(CSystemTimer::CompareTimer, m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER, false); - if (m_Recomp) - { - m_Recomp->Reset(); - } - if (m_Plugins) { m_Plugins->GameReset(); } - if (m_SyncCPU) - { - m_SyncCPU->Reset(bInitReg, ClearMenory); - } - g_Settings->SaveBool(GameRunning_InReset, true); + if (m_Recomp) + { + m_Recomp->Reset(); + } + if (m_Plugins) { m_Plugins->GameReset(); } + if (m_SyncCPU) + { + m_SyncCPU->Reset(bInitReg, ClearMenory); + } + g_Settings->SaveBool(GameRunning_InReset, true); } bool CN64System::SetActiveSystem(bool bActive) { - bool bInitPlugin = false; - bool bReset = false; - bool bRes = true; + bool bInitPlugin = false; + bool bReset = false; + bool bRes = true; - if (bActive && g_System == this) - { - return true; - } + if (bActive && g_System == this) + { + return true; + } - if (bActive) - { - m_Reg.SetAsCurrentSystem(); + if (bActive) + { + m_Reg.SetAsCurrentSystem(); - if (g_System) - { - g_System->m_TestTimer = R4300iOp::m_TestTimer; - g_System->m_NextInstruction = R4300iOp::m_NextInstruction; - g_System->m_JumpToLocation = R4300iOp::m_JumpToLocation; - } + if (g_System) + { + g_System->m_TestTimer = R4300iOp::m_TestTimer; + g_System->m_NextInstruction = R4300iOp::m_NextInstruction; + g_System->m_JumpToLocation = R4300iOp::m_JumpToLocation; + } - g_System = this; - if (g_BaseSystem == this) - { - g_SyncSystem = m_SyncCPU; - } - g_Recompiler = m_Recomp; - g_MMU = &m_MMU_VM; - g_TLB = &m_TLB; - g_Reg = &m_Reg; - g_Audio = &m_Audio; - g_SystemTimer = &m_SystemTimer; - g_TransVaddr = &m_MMU_VM; - g_SystemEvents = this; - g_NextTimer = &m_NextTimer; - g_Plugins = m_Plugins; - g_TLBLoadAddress = &m_TLBLoadAddress; - g_TLBStoreAddress = &m_TLBStoreAddress; - R4300iOp::m_TestTimer = m_TestTimer; - R4300iOp::m_NextInstruction = m_NextInstruction; - R4300iOp::m_JumpToLocation = m_JumpToLocation; + g_System = this; + if (g_BaseSystem == this) + { + g_SyncSystem = m_SyncCPU; + } + g_Recompiler = m_Recomp; + g_MMU = &m_MMU_VM; + g_TLB = &m_TLB; + g_Reg = &m_Reg; + g_Audio = &m_Audio; + g_SystemTimer = &m_SystemTimer; + g_TransVaddr = &m_MMU_VM; + g_SystemEvents = this; + g_NextTimer = &m_NextTimer; + g_Plugins = m_Plugins; + g_TLBLoadAddress = &m_TLBLoadAddress; + g_TLBStoreAddress = &m_TLBStoreAddress; + R4300iOp::m_TestTimer = m_TestTimer; + R4300iOp::m_NextInstruction = m_NextInstruction; + R4300iOp::m_JumpToLocation = m_JumpToLocation; - if (!m_bInitialized) - { - if (!m_MMU_VM.Initialize()) - { - return false; - } - bReset = true; - m_bInitialized = true; - bInitPlugin = true; - } - } - else - { - if (this == g_BaseSystem) - { - g_System = NULL; - g_SyncSystem = NULL; - g_Recompiler = NULL; - g_MMU = NULL; - g_TLB = NULL; - g_Reg = NULL; - g_Audio = NULL; - g_SystemTimer = NULL; - g_TransVaddr = NULL; - g_SystemEvents = NULL; - g_NextTimer = NULL; - g_Plugins = m_Plugins; - g_TLBLoadAddress = NULL; - g_TLBStoreAddress = NULL; - } - } + if (!m_bInitialized) + { + if (!m_MMU_VM.Initialize()) + { + return false; + } + bReset = true; + m_bInitialized = true; + bInitPlugin = true; + } + } + else + { + if (this == g_BaseSystem) + { + g_System = NULL; + g_SyncSystem = NULL; + g_Recompiler = NULL; + g_MMU = NULL; + g_TLB = NULL; + g_Reg = NULL; + g_Audio = NULL; + g_SystemTimer = NULL; + g_TransVaddr = NULL; + g_SystemEvents = NULL; + g_NextTimer = NULL; + g_Plugins = m_Plugins; + g_TLBLoadAddress = NULL; + g_TLBStoreAddress = NULL; + } + } - if (bInitPlugin) - { - WriteTrace(TraceDebug, __FUNCTION__ ": Reseting Plugins"); - g_Notify->DisplayMessage(5, MSG_PLUGIN_INIT); - m_Plugins->CreatePlugins(); - bRes = m_Plugins->Initiate(this); - if (!bRes) - { - WriteTrace(TraceError, __FUNCTION__ ": g_Plugins->Initiate Failed"); - } - } + if (bInitPlugin) + { + WriteTrace(TraceDebug, __FUNCTION__ ": Reseting Plugins"); + g_Notify->DisplayMessage(5, MSG_PLUGIN_INIT); + m_Plugins->CreatePlugins(); + bRes = m_Plugins->Initiate(this); + if (!bRes) + { + WriteTrace(TraceError, __FUNCTION__ ": g_Plugins->Initiate Failed"); + } + } - if (bReset) - { - Reset(true, true); - } - return bRes; + if (bReset) + { + Reset(true, true); + } + return bRes; } void CN64System::InitRegisters(bool bPostPif, CMipsMemory & MMU) { - m_Reg.Reset(); + m_Reg.Reset(); - //COP0 Registers - m_Reg.RANDOM_REGISTER = 0x1F; - m_Reg.COUNT_REGISTER = 0x5000; - m_Reg.MI_VERSION_REG = 0x02020102; - m_Reg.SP_STATUS_REG = 0x00000001; - m_Reg.CAUSE_REGISTER = 0x0000005C; - m_Reg.CONTEXT_REGISTER = 0x007FFFF0; - m_Reg.EPC_REGISTER = 0xFFFFFFFF; - m_Reg.BAD_VADDR_REGISTER = 0xFFFFFFFF; - m_Reg.ERROREPC_REGISTER = 0xFFFFFFFF; - m_Reg.CONFIG_REGISTER = 0x0006E463; - m_Reg.STATUS_REGISTER = 0x34000000; + //COP0 Registers + m_Reg.RANDOM_REGISTER = 0x1F; + m_Reg.COUNT_REGISTER = 0x5000; + m_Reg.MI_VERSION_REG = 0x02020102; + m_Reg.SP_STATUS_REG = 0x00000001; + m_Reg.CAUSE_REGISTER = 0x0000005C; + m_Reg.CONTEXT_REGISTER = 0x007FFFF0; + m_Reg.EPC_REGISTER = 0xFFFFFFFF; + m_Reg.BAD_VADDR_REGISTER = 0xFFFFFFFF; + m_Reg.ERROREPC_REGISTER = 0xFFFFFFFF; + m_Reg.CONFIG_REGISTER = 0x0006E463; + m_Reg.STATUS_REGISTER = 0x34000000; - //m_Reg.REVISION_REGISTER = 0x00000511; - m_Reg.FixFpuLocations(); + //m_Reg.REVISION_REGISTER = 0x00000511; + m_Reg.FixFpuLocations(); - if (bPostPif) - { - m_Reg.m_PROGRAM_COUNTER = 0xA4000040; + if (bPostPif) + { + m_Reg.m_PROGRAM_COUNTER = 0xA4000040; - m_Reg.m_GPR[0].DW = 0x0000000000000000; - m_Reg.m_GPR[6].DW = 0xFFFFFFFFA4001F0C; - m_Reg.m_GPR[7].DW = 0xFFFFFFFFA4001F08; - m_Reg.m_GPR[8].DW = 0x00000000000000C0; - m_Reg.m_GPR[9].DW = 0x0000000000000000; - m_Reg.m_GPR[10].DW = 0x0000000000000040; - m_Reg.m_GPR[11].DW = 0xFFFFFFFFA4000040; - m_Reg.m_GPR[16].DW = 0x0000000000000000; - m_Reg.m_GPR[17].DW = 0x0000000000000000; - m_Reg.m_GPR[18].DW = 0x0000000000000000; - m_Reg.m_GPR[19].DW = 0x0000000000000000; - m_Reg.m_GPR[21].DW = 0x0000000000000000; - m_Reg.m_GPR[26].DW = 0x0000000000000000; - m_Reg.m_GPR[27].DW = 0x0000000000000000; - m_Reg.m_GPR[28].DW = 0x0000000000000000; - m_Reg.m_GPR[29].DW = 0xFFFFFFFFA4001FF0; - m_Reg.m_GPR[30].DW = 0x0000000000000000; + m_Reg.m_GPR[0].DW = 0x0000000000000000; + m_Reg.m_GPR[6].DW = 0xFFFFFFFFA4001F0C; + m_Reg.m_GPR[7].DW = 0xFFFFFFFFA4001F08; + m_Reg.m_GPR[8].DW = 0x00000000000000C0; + m_Reg.m_GPR[9].DW = 0x0000000000000000; + m_Reg.m_GPR[10].DW = 0x0000000000000040; + m_Reg.m_GPR[11].DW = 0xFFFFFFFFA4000040; + m_Reg.m_GPR[16].DW = 0x0000000000000000; + m_Reg.m_GPR[17].DW = 0x0000000000000000; + m_Reg.m_GPR[18].DW = 0x0000000000000000; + m_Reg.m_GPR[19].DW = 0x0000000000000000; + m_Reg.m_GPR[21].DW = 0x0000000000000000; + m_Reg.m_GPR[26].DW = 0x0000000000000000; + m_Reg.m_GPR[27].DW = 0x0000000000000000; + m_Reg.m_GPR[28].DW = 0x0000000000000000; + m_Reg.m_GPR[29].DW = 0xFFFFFFFFA4001FF0; + m_Reg.m_GPR[30].DW = 0x0000000000000000; - switch (g_Rom->GetCountry()) - { - case Germany: case french: case Italian: - case Europe: case Spanish: case Australia: - case X_PAL: case Y_PAL: - switch (g_Rom->CicChipID()) - { - case CIC_UNKNOWN: - case CIC_NUS_6102: - m_Reg.m_GPR[5].DW = 0xFFFFFFFFC0F1D859; - m_Reg.m_GPR[14].DW = 0x000000002DE108EA; - m_Reg.m_GPR[24].DW = 0x0000000000000000; - break; - case CIC_NUS_6103: - m_Reg.m_GPR[5].DW = 0xFFFFFFFFD4646273; - m_Reg.m_GPR[14].DW = 0x000000001AF99984; - m_Reg.m_GPR[24].DW = 0x0000000000000000; - break; - case CIC_NUS_6105: - MMU.SW_VAddr(0xA4001004, 0xBDA807FC); - m_Reg.m_GPR[5].DW = 0xFFFFFFFFDECAAAD1; - m_Reg.m_GPR[14].DW = 0x000000000CF85C13; - m_Reg.m_GPR[24].DW = 0x0000000000000002; - break; - case CIC_NUS_6106: - m_Reg.m_GPR[5].DW = 0xFFFFFFFFB04DC903; - m_Reg.m_GPR[14].DW = 0x000000001AF99984; - m_Reg.m_GPR[24].DW = 0x0000000000000002; - break; - } - m_Reg.m_GPR[20].DW = 0x0000000000000000; - m_Reg.m_GPR[23].DW = 0x0000000000000006; - m_Reg.m_GPR[31].DW = 0xFFFFFFFFA4001554; - break; - case NTSC_BETA: case X_NTSC: case USA: case Japan: - default: - switch (g_Rom->CicChipID()) - { - case CIC_UNKNOWN: - case CIC_NUS_6102: - m_Reg.m_GPR[5].DW = 0xFFFFFFFFC95973D5; - m_Reg.m_GPR[14].DW = 0x000000002449A366; - break; - case CIC_NUS_6103: - m_Reg.m_GPR[5].DW = 0xFFFFFFFF95315A28; - m_Reg.m_GPR[14].DW = 0x000000005BACA1DF; - break; - case CIC_NUS_6105: - MMU.SW_VAddr(0xA4001004, 0x8DA807FC); - m_Reg.m_GPR[5].DW = 0x000000005493FB9A; - m_Reg.m_GPR[14].DW = 0xFFFFFFFFC2C20384; - case CIC_NUS_6106: - m_Reg.m_GPR[5].DW = 0xFFFFFFFFE067221F; - m_Reg.m_GPR[14].DW = 0x000000005CD2B70F; - break; - } - m_Reg.m_GPR[20].DW = 0x0000000000000001; - m_Reg.m_GPR[23].DW = 0x0000000000000000; - m_Reg.m_GPR[24].DW = 0x0000000000000003; - m_Reg.m_GPR[31].DW = 0xFFFFFFFFA4001550; - } + switch (g_Rom->GetCountry()) + { + case Germany: case french: case Italian: + case Europe: case Spanish: case Australia: + case X_PAL: case Y_PAL: + switch (g_Rom->CicChipID()) + { + case CIC_UNKNOWN: + case CIC_NUS_6102: + m_Reg.m_GPR[5].DW = 0xFFFFFFFFC0F1D859; + m_Reg.m_GPR[14].DW = 0x000000002DE108EA; + m_Reg.m_GPR[24].DW = 0x0000000000000000; + break; + case CIC_NUS_6103: + m_Reg.m_GPR[5].DW = 0xFFFFFFFFD4646273; + m_Reg.m_GPR[14].DW = 0x000000001AF99984; + m_Reg.m_GPR[24].DW = 0x0000000000000000; + break; + case CIC_NUS_6105: + MMU.SW_VAddr(0xA4001004, 0xBDA807FC); + m_Reg.m_GPR[5].DW = 0xFFFFFFFFDECAAAD1; + m_Reg.m_GPR[14].DW = 0x000000000CF85C13; + m_Reg.m_GPR[24].DW = 0x0000000000000002; + break; + case CIC_NUS_6106: + m_Reg.m_GPR[5].DW = 0xFFFFFFFFB04DC903; + m_Reg.m_GPR[14].DW = 0x000000001AF99984; + m_Reg.m_GPR[24].DW = 0x0000000000000002; + break; + } + m_Reg.m_GPR[20].DW = 0x0000000000000000; + m_Reg.m_GPR[23].DW = 0x0000000000000006; + m_Reg.m_GPR[31].DW = 0xFFFFFFFFA4001554; + break; + case NTSC_BETA: case X_NTSC: case USA: case Japan: + default: + switch (g_Rom->CicChipID()) + { + case CIC_UNKNOWN: + case CIC_NUS_6102: + m_Reg.m_GPR[5].DW = 0xFFFFFFFFC95973D5; + m_Reg.m_GPR[14].DW = 0x000000002449A366; + break; + case CIC_NUS_6103: + m_Reg.m_GPR[5].DW = 0xFFFFFFFF95315A28; + m_Reg.m_GPR[14].DW = 0x000000005BACA1DF; + break; + case CIC_NUS_6105: + MMU.SW_VAddr(0xA4001004, 0x8DA807FC); + m_Reg.m_GPR[5].DW = 0x000000005493FB9A; + m_Reg.m_GPR[14].DW = 0xFFFFFFFFC2C20384; + case CIC_NUS_6106: + m_Reg.m_GPR[5].DW = 0xFFFFFFFFE067221F; + m_Reg.m_GPR[14].DW = 0x000000005CD2B70F; + break; + } + m_Reg.m_GPR[20].DW = 0x0000000000000001; + m_Reg.m_GPR[23].DW = 0x0000000000000000; + m_Reg.m_GPR[24].DW = 0x0000000000000003; + m_Reg.m_GPR[31].DW = 0xFFFFFFFFA4001550; + } - switch (g_Rom->CicChipID()) - { - case CIC_NUS_6101: - m_Reg.m_GPR[22].DW = 0x000000000000003F; - break; - 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: - case CIC_NUS_6102: - m_Reg.m_GPR[1].DW = 0x0000000000000001; - m_Reg.m_GPR[2].DW = 0x000000000EBDA536; - m_Reg.m_GPR[3].DW = 0x000000000EBDA536; - m_Reg.m_GPR[4].DW = 0x000000000000A536; - m_Reg.m_GPR[12].DW = 0xFFFFFFFFED10D0B3; - m_Reg.m_GPR[13].DW = 0x000000001402A4CC; - m_Reg.m_GPR[15].DW = 0x000000003103E121; - m_Reg.m_GPR[22].DW = 0x000000000000003F; - m_Reg.m_GPR[25].DW = 0xFFFFFFFF9DEBB54F; - break; - case CIC_NUS_6103: - m_Reg.m_GPR[1].DW = 0x0000000000000001; - m_Reg.m_GPR[2].DW = 0x0000000049A5EE96; - m_Reg.m_GPR[3].DW = 0x0000000049A5EE96; - m_Reg.m_GPR[4].DW = 0x000000000000EE96; - m_Reg.m_GPR[12].DW = 0xFFFFFFFFCE9DFBF7; - m_Reg.m_GPR[13].DW = 0xFFFFFFFFCE9DFBF7; - m_Reg.m_GPR[15].DW = 0x0000000018B63D28; - m_Reg.m_GPR[22].DW = 0x0000000000000078; - m_Reg.m_GPR[25].DW = 0xFFFFFFFF825B21C9; - break; - case CIC_NUS_6105: - MMU.SW_VAddr(0xA4001000, 0x3C0DBFC0); - MMU.SW_VAddr(0xA4001008, 0x25AD07C0); - MMU.SW_VAddr(0xA400100C, 0x31080080); - MMU.SW_VAddr(0xA4001010, 0x5500FFFC); - MMU.SW_VAddr(0xA4001014, 0x3C0DBFC0); - MMU.SW_VAddr(0xA4001018, 0x8DA80024); - MMU.SW_VAddr(0xA400101C, 0x3C0BB000); - m_Reg.m_GPR[1].DW = 0x0000000000000000; - m_Reg.m_GPR[2].DW = 0xFFFFFFFFF58B0FBF; - m_Reg.m_GPR[3].DW = 0xFFFFFFFFF58B0FBF; - m_Reg.m_GPR[4].DW = 0x0000000000000FBF; - m_Reg.m_GPR[12].DW = 0xFFFFFFFF9651F81E; - m_Reg.m_GPR[13].DW = 0x000000002D42AAC5; - m_Reg.m_GPR[15].DW = 0x0000000056584D60; - m_Reg.m_GPR[22].DW = 0x0000000000000091; - m_Reg.m_GPR[25].DW = 0xFFFFFFFFCDCE565F; - break; - case CIC_NUS_6106: - m_Reg.m_GPR[1].DW = 0x0000000000000000; - m_Reg.m_GPR[2].DW = 0xFFFFFFFFA95930A4; - m_Reg.m_GPR[3].DW = 0xFFFFFFFFA95930A4; - m_Reg.m_GPR[4].DW = 0x00000000000030A4; - m_Reg.m_GPR[12].DW = 0xFFFFFFFFBCB59510; - m_Reg.m_GPR[13].DW = 0xFFFFFFFFBCB59510; - m_Reg.m_GPR[15].DW = 0x000000007A3C07F4; - m_Reg.m_GPR[22].DW = 0x0000000000000085; - m_Reg.m_GPR[25].DW = 0x00000000465E3F72; - break; - } - } - else - { - m_Reg.m_PROGRAM_COUNTER = 0xBFC00000; - /* PIF_Ram[36] = 0x00; PIF_Ram[39] = 0x3F; //common pif ram start values + switch (g_Rom->CicChipID()) + { + case CIC_NUS_6101: + m_Reg.m_GPR[22].DW = 0x000000000000003F; + break; + 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: + case CIC_NUS_6102: + m_Reg.m_GPR[1].DW = 0x0000000000000001; + m_Reg.m_GPR[2].DW = 0x000000000EBDA536; + m_Reg.m_GPR[3].DW = 0x000000000EBDA536; + m_Reg.m_GPR[4].DW = 0x000000000000A536; + m_Reg.m_GPR[12].DW = 0xFFFFFFFFED10D0B3; + m_Reg.m_GPR[13].DW = 0x000000001402A4CC; + m_Reg.m_GPR[15].DW = 0x000000003103E121; + m_Reg.m_GPR[22].DW = 0x000000000000003F; + m_Reg.m_GPR[25].DW = 0xFFFFFFFF9DEBB54F; + break; + case CIC_NUS_6103: + m_Reg.m_GPR[1].DW = 0x0000000000000001; + m_Reg.m_GPR[2].DW = 0x0000000049A5EE96; + m_Reg.m_GPR[3].DW = 0x0000000049A5EE96; + m_Reg.m_GPR[4].DW = 0x000000000000EE96; + m_Reg.m_GPR[12].DW = 0xFFFFFFFFCE9DFBF7; + m_Reg.m_GPR[13].DW = 0xFFFFFFFFCE9DFBF7; + m_Reg.m_GPR[15].DW = 0x0000000018B63D28; + m_Reg.m_GPR[22].DW = 0x0000000000000078; + m_Reg.m_GPR[25].DW = 0xFFFFFFFF825B21C9; + break; + case CIC_NUS_6105: + MMU.SW_VAddr(0xA4001000, 0x3C0DBFC0); + MMU.SW_VAddr(0xA4001008, 0x25AD07C0); + MMU.SW_VAddr(0xA400100C, 0x31080080); + MMU.SW_VAddr(0xA4001010, 0x5500FFFC); + MMU.SW_VAddr(0xA4001014, 0x3C0DBFC0); + MMU.SW_VAddr(0xA4001018, 0x8DA80024); + MMU.SW_VAddr(0xA400101C, 0x3C0BB000); + m_Reg.m_GPR[1].DW = 0x0000000000000000; + m_Reg.m_GPR[2].DW = 0xFFFFFFFFF58B0FBF; + m_Reg.m_GPR[3].DW = 0xFFFFFFFFF58B0FBF; + m_Reg.m_GPR[4].DW = 0x0000000000000FBF; + m_Reg.m_GPR[12].DW = 0xFFFFFFFF9651F81E; + m_Reg.m_GPR[13].DW = 0x000000002D42AAC5; + m_Reg.m_GPR[15].DW = 0x0000000056584D60; + m_Reg.m_GPR[22].DW = 0x0000000000000091; + m_Reg.m_GPR[25].DW = 0xFFFFFFFFCDCE565F; + break; + case CIC_NUS_6106: + m_Reg.m_GPR[1].DW = 0x0000000000000000; + m_Reg.m_GPR[2].DW = 0xFFFFFFFFA95930A4; + m_Reg.m_GPR[3].DW = 0xFFFFFFFFA95930A4; + m_Reg.m_GPR[4].DW = 0x00000000000030A4; + m_Reg.m_GPR[12].DW = 0xFFFFFFFFBCB59510; + m_Reg.m_GPR[13].DW = 0xFFFFFFFFBCB59510; + m_Reg.m_GPR[15].DW = 0x000000007A3C07F4; + m_Reg.m_GPR[22].DW = 0x0000000000000085; + m_Reg.m_GPR[25].DW = 0x00000000465E3F72; + break; + } + } + else + { + m_Reg.m_PROGRAM_COUNTER = 0xBFC00000; + /* PIF_Ram[36] = 0x00; PIF_Ram[39] = 0x3F; //common pif ram start values - switch (g_Rom->CicChipID()) { - case CIC_NUS_6101: PIF_Ram[37] = 0x06; PIF_Ram[38] = 0x3F; break; - case CIC_UNKNOWN: - case CIC_NUS_6102: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x3F; break; - case CIC_NUS_6103: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x78; break; - case CIC_NUS_6105: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x91; break; - case CIC_NUS_6106: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x85; break; - }*/ - } + switch (g_Rom->CicChipID()) { + case CIC_NUS_6101: PIF_Ram[37] = 0x06; PIF_Ram[38] = 0x3F; break; + case CIC_UNKNOWN: + case CIC_NUS_6102: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x3F; break; + case CIC_NUS_6103: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x78; break; + case CIC_NUS_6105: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x91; break; + case CIC_NUS_6106: PIF_Ram[37] = 0x02; PIF_Ram[38] = 0x85; break; + }*/ + } } void CN64System::ExecuteCPU() { - //reset code - g_Settings->SaveBool(GameRunning_CPU_Running, true); - g_Settings->SaveBool(GameRunning_CPU_Paused, false); - g_Notify->DisplayMessage(5, MSG_EMULATION_STARTED); + //reset code + g_Settings->SaveBool(GameRunning_CPU_Running, true); + g_Settings->SaveBool(GameRunning_CPU_Paused, false); + g_Notify->DisplayMessage(5, MSG_EMULATION_STARTED); - m_EndEmulation = false; - Notify().RefreshMenu(); + m_EndEmulation = false; + Notify().RefreshMenu(); - m_Plugins->RomOpened(); - if (m_SyncCPU) - { - m_SyncCPU->m_Plugins->RomOpened(); - } + m_Plugins->RomOpened(); + if (m_SyncCPU) + { + m_SyncCPU->m_Plugins->RomOpened(); + } #ifndef _WIN64 - _controlfp(_PC_53, _MCW_PC); + _controlfp(_PC_53, _MCW_PC); #endif - 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. + 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; + case CPU_Recompiler: ExecuteRecompiler(); break; + case CPU_SyncCores: ExecuteSyncCPU(); break; #endif - default: ExecuteInterpret(); break; - } - g_Settings->SaveBool(GameRunning_CPU_Running, (DWORD)false); - Notify().WindowMode(); - m_Plugins->RomClosed(); - if (m_SyncCPU) - { - m_SyncCPU->m_Plugins->RomClosed(); - } + default: ExecuteInterpret(); break; + } + g_Settings->SaveBool(GameRunning_CPU_Running, (DWORD)false); + Notify().WindowMode(); + m_Plugins->RomClosed(); + if (m_SyncCPU) + { + m_SyncCPU->m_Plugins->RomClosed(); + } } void CN64System::ExecuteInterpret() { - SetActiveSystem(); - CInterpreterCPU::ExecuteCPU(); + SetActiveSystem(); + CInterpreterCPU::ExecuteCPU(); } void CN64System::ExecuteRecompiler() { - m_Recomp->Run(); + m_Recomp->Run(); } void CN64System::ExecuteSyncCPU() { - Notify().BringToTop(); - m_Recomp->Run(); + Notify().BringToTop(); + m_Recomp->Run(); } void CN64System::CpuStopped() { - g_Settings->SaveBool(GameRunning_CPU_Running, (DWORD)false); - Notify().WindowMode(); - if (!m_InReset) - { - if (m_hPauseEvent) - { - CloseHandle(m_hPauseEvent); - m_hPauseEvent = NULL; - } + g_Settings->SaveBool(GameRunning_CPU_Running, (DWORD)false); + Notify().WindowMode(); + if (!m_InReset) + { + if (m_hPauseEvent) + { + CloseHandle(m_hPauseEvent); + m_hPauseEvent = NULL; + } - Notify().RefreshMenu(); - Notify().MakeWindowOnTop(false); - g_Notify->DisplayMessage(5, MSG_EMULATION_ENDED); - if (g_Settings->LoadDword(RomBrowser_Enabled)) - { - Notify().ShowRomBrowser(); - } - } - if (m_SyncCPU) - { - m_SyncCPU->CpuStopped(); - } + Notify().RefreshMenu(); + Notify().MakeWindowOnTop(false); + g_Notify->DisplayMessage(5, MSG_EMULATION_ENDED); + if (g_Settings->LoadDword(RomBrowser_Enabled)) + { + Notify().ShowRomBrowser(); + } + } + if (m_SyncCPU) + { + m_SyncCPU->CpuStopped(); + } } void CN64System::UpdateSyncCPU(CN64System * const SecondCPU, DWORD const Cycles) { - int CyclesToExecute = Cycles - m_CyclesToSkip; + int CyclesToExecute = Cycles - m_CyclesToSkip; - //Update the number of cycles to skip - m_CyclesToSkip -= Cycles; - if (m_CyclesToSkip < 0) { m_CyclesToSkip = 0; } + //Update the number of cycles to skip + m_CyclesToSkip -= Cycles; + if (m_CyclesToSkip < 0) { m_CyclesToSkip = 0; } - //Run the other CPU For the same amount of cycles - if (CyclesToExecute < 0) { return; } + //Run the other CPU For the same amount of cycles + if (CyclesToExecute < 0) { return; } - SecondCPU->SetActiveSystem(true); + SecondCPU->SetActiveSystem(true); - CInterpreterCPU::ExecuteOps(Cycles); + CInterpreterCPU::ExecuteOps(Cycles); - SetActiveSystem(true); + SetActiveSystem(true); } void CN64System::SyncCPUPC(CN64System * const SecondCPU) { - bool ErrorFound = false; + bool ErrorFound = false; - g_SystemTimer->UpdateTimers(); - if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) - { - ErrorFound = true; - } + g_SystemTimer->UpdateTimers(); + if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) + { + ErrorFound = true; + } - if (m_TLB != SecondCPU->m_TLB) { ErrorFound = true; } - if (m_SystemTimer != SecondCPU->m_SystemTimer) { ErrorFound = true; } - if (m_NextTimer != SecondCPU->m_NextTimer) { ErrorFound = true; } + if (m_TLB != SecondCPU->m_TLB) { ErrorFound = true; } + if (m_SystemTimer != SecondCPU->m_SystemTimer) { ErrorFound = true; } + if (m_NextTimer != SecondCPU->m_NextTimer) { ErrorFound = true; } - if (ErrorFound) { DumpSyncErrors(SecondCPU); } + if (ErrorFound) { DumpSyncErrors(SecondCPU); } - for (int i = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) - { - m_LastSuccessSyncPC[i] = m_LastSuccessSyncPC[i - 1]; - } - m_LastSuccessSyncPC[0] = m_Reg.m_PROGRAM_COUNTER; + for (int i = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) + { + m_LastSuccessSyncPC[i] = m_LastSuccessSyncPC[i - 1]; + } + m_LastSuccessSyncPC[0] = m_Reg.m_PROGRAM_COUNTER; } void CN64System::SyncCPU(CN64System * const SecondCPU) { - bool ErrorFound = false; + bool ErrorFound = false; - m_SyncCount += 1; - //WriteTraceF(TraceError,"SyncCPU PC = %08X",m_Reg.m_PROGRAM_COUNTER); - g_SystemTimer->UpdateTimers(); + m_SyncCount += 1; + //WriteTraceF(TraceError,"SyncCPU PC = %08X",m_Reg.m_PROGRAM_COUNTER); + g_SystemTimer->UpdateTimers(); #ifdef TEST_SP_TRACKING - if (m_CurrentSP != GPR[29].UW[0]) { - ErrorFound = true; - } + if (m_CurrentSP != GPR[29].UW[0]) { + ErrorFound = true; + } #endif - if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) - { - ErrorFound = true; - } - if (b32BitCore()) - { - for (int count = 0; count < 32; count++) - { - if (m_Reg.m_GPR[count].W[0] != SecondCPU->m_Reg.m_GPR[count].W[0]) - { - ErrorFound = true; - } - if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) - { - ErrorFound = true; - } - if (m_Reg.m_CP0[count] != SecondCPU->m_Reg.m_CP0[count]) - { - ErrorFound = true; - } - } - } - else - { - for (int count = 0; count < 32; count++) - { - if (m_Reg.m_GPR[count].DW != SecondCPU->m_Reg.m_GPR[count].DW) - { - ErrorFound = true; - } - if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) - { - ErrorFound = true; - } - if (m_Reg.m_CP0[count] != SecondCPU->m_Reg.m_CP0[count]) - { - ErrorFound = true; - } - } - } + if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) + { + ErrorFound = true; + } + if (b32BitCore()) + { + for (int count = 0; count < 32; count++) + { + if (m_Reg.m_GPR[count].W[0] != SecondCPU->m_Reg.m_GPR[count].W[0]) + { + ErrorFound = true; + } + if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) + { + ErrorFound = true; + } + if (m_Reg.m_CP0[count] != SecondCPU->m_Reg.m_CP0[count]) + { + ErrorFound = true; + } + } + } + else + { + for (int count = 0; count < 32; count++) + { + if (m_Reg.m_GPR[count].DW != SecondCPU->m_Reg.m_GPR[count].DW) + { + ErrorFound = true; + } + if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) + { + ErrorFound = true; + } + if (m_Reg.m_CP0[count] != SecondCPU->m_Reg.m_CP0[count]) + { + ErrorFound = true; + } + } + } - if (m_TLB != SecondCPU->m_TLB) { ErrorFound = true; } - if (m_Reg.m_FPCR[0] != SecondCPU->m_Reg.m_FPCR[0]) { ErrorFound = true; } - if (m_Reg.m_FPCR[31] != SecondCPU->m_Reg.m_FPCR[31]) { ErrorFound = true; } - if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) { ErrorFound = true; } - if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) { ErrorFound = true; } - /*if (m_SyncCount > 4788000) - { - if (memcmp(m_MMU_VM.Rdram(),SecondCPU->m_MMU_VM.Rdram(),RdramSize()) != 0) - { - ErrorFound = true; - } - } - if (memcmp(m_MMU_VM.Imem(),SecondCPU->m_MMU_VM.Imem(),0x1000) != 0) - { - ErrorFound = true; - } - if (memcmp(m_MMU_VM.Dmem(),SecondCPU->m_MMU_VM.Dmem(),0x1000) != 0) - { - ErrorFound = true; - }*/ + if (m_TLB != SecondCPU->m_TLB) { ErrorFound = true; } + if (m_Reg.m_FPCR[0] != SecondCPU->m_Reg.m_FPCR[0]) { ErrorFound = true; } + if (m_Reg.m_FPCR[31] != SecondCPU->m_Reg.m_FPCR[31]) { ErrorFound = true; } + if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) { ErrorFound = true; } + if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) { ErrorFound = true; } + /*if (m_SyncCount > 4788000) + { + if (memcmp(m_MMU_VM.Rdram(),SecondCPU->m_MMU_VM.Rdram(),RdramSize()) != 0) + { + ErrorFound = true; + } + } + if (memcmp(m_MMU_VM.Imem(),SecondCPU->m_MMU_VM.Imem(),0x1000) != 0) + { + ErrorFound = true; + } + if (memcmp(m_MMU_VM.Dmem(),SecondCPU->m_MMU_VM.Dmem(),0x1000) != 0) + { + ErrorFound = true; + }*/ - /*for (int z = 0; z < 0x100; z++) - { - if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z]) - { - ErrorFound = true; - break; - } - }*/ + /*for (int z = 0; z < 0x100; z++) + { + if (m_MMU_VM.Rdram()[0x00206970 + z] != SecondCPU->m_MMU_VM.Rdram()[0x00206970 + z]) + { + ErrorFound = true; + break; + } + }*/ - if (bFastSP() && m_Recomp) - { - if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))) - { - ErrorFound = true; - } - } + if (bFastSP() && m_Recomp) + { + if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))) + { + ErrorFound = true; + } + } - if (m_SystemTimer != SecondCPU->m_SystemTimer) { ErrorFound = true; } - if (m_NextTimer != SecondCPU->m_NextTimer) { ErrorFound = true; } - if (m_Reg.m_RoundingModel != SecondCPU->m_Reg.m_RoundingModel) { ErrorFound = true; } + if (m_SystemTimer != SecondCPU->m_SystemTimer) { ErrorFound = true; } + if (m_NextTimer != SecondCPU->m_NextTimer) { ErrorFound = true; } + if (m_Reg.m_RoundingModel != SecondCPU->m_Reg.m_RoundingModel) { ErrorFound = true; } - for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i++) - { - if (m_Reg.m_Mips_Interface[i] != SecondCPU->m_Reg.m_Mips_Interface[i]) - { - ErrorFound = true; - } - } + for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i++) + { + if (m_Reg.m_Mips_Interface[i] != SecondCPU->m_Reg.m_Mips_Interface[i]) + { + ErrorFound = true; + } + } - for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i++) - { - if (m_Reg.m_SigProcessor_Interface[i] != SecondCPU->m_Reg.m_SigProcessor_Interface[i]) - { - ErrorFound = true; - } - } + for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i++) + { + if (m_Reg.m_SigProcessor_Interface[i] != SecondCPU->m_Reg.m_SigProcessor_Interface[i]) + { + ErrorFound = true; + } + } - for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i++) - { - if (m_Reg.m_Display_ControlReg[i] != SecondCPU->m_Reg.m_Display_ControlReg[i]) - { - ErrorFound = true; - } - } + for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i++) + { + if (m_Reg.m_Display_ControlReg[i] != SecondCPU->m_Reg.m_Display_ControlReg[i]) + { + ErrorFound = true; + } + } - if (ErrorFound) { DumpSyncErrors(SecondCPU); } + if (ErrorFound) { DumpSyncErrors(SecondCPU); } - for (int i = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) - { - m_LastSuccessSyncPC[i] = m_LastSuccessSyncPC[i - 1]; - } - m_LastSuccessSyncPC[0] = m_Reg.m_PROGRAM_COUNTER; - // if (PROGRAM_COUNTER == 0x8009BBD8) { - // g_Notify->BreakPoint(__FILEW__,__LINE__); - // } + for (int i = (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])) - 1; i > 0; i--) + { + m_LastSuccessSyncPC[i] = m_LastSuccessSyncPC[i - 1]; + } + m_LastSuccessSyncPC[0] = m_Reg.m_PROGRAM_COUNTER; + // if (PROGRAM_COUNTER == 0x8009BBD8) { + // g_Notify->BreakPoint(__FILEW__,__LINE__); + // } } void CN64System::SyncSystem() { - SyncCPU(g_SyncSystem); + SyncCPU(g_SyncSystem); } void CN64System::SyncSystemPC() { - SyncCPUPC(g_SyncSystem); + SyncCPUPC(g_SyncSystem); } void CN64System::DumpSyncErrors(CN64System * SecondCPU) { - int count; + int count; - { - CPath ErrorFile(CPath::MODULE_DIRECTORY); - ErrorFile.AppendDirectory("Logs"); - ErrorFile.SetNameExtension("Sync Errors.txt"); + { + CPath ErrorFile(CPath::MODULE_DIRECTORY); + ErrorFile.AppendDirectory("Logs"); + ErrorFile.SetNameExtension("Sync Errors.txt"); - CLog Error; - Error.Open(ErrorFile); - Error.Log("Errors:\r\n"); - Error.Log("Register, Recompiler, Interpter\r\n"); + CLog Error; + Error.Open(ErrorFile); + Error.Log("Errors:\r\n"); + Error.Log("Register, Recompiler, Interpter\r\n"); #ifdef TEST_SP_TRACKING - if (m_CurrentSP != GPR[29].UW[0]) { - Error.Log("m_CurrentSP,%X,%X\r\n",m_CurrentSP,GPR[29].UW[0]); - } + if (m_CurrentSP != GPR[29].UW[0]) { + Error.Log("m_CurrentSP,%X,%X\r\n",m_CurrentSP,GPR[29].UW[0]); + } #endif - if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) { - Error.LogF("PROGRAM_COUNTER 0x%X, 0x%X\r\n", m_Reg.m_PROGRAM_COUNTER, SecondCPU->m_Reg.m_PROGRAM_COUNTER); - } - if (b32BitCore()) - { - for (count = 0; count < 32; count++) - { - if (m_Reg.m_GPR[count].UW[0] != SecondCPU->m_Reg.m_GPR[count].UW[0]) - { - Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], - m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], - SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); - } - } - } - else - { - for (count = 0; count < 32; count++) - { - if (m_Reg.m_GPR[count].DW != SecondCPU->m_Reg.m_GPR[count].DW) - { - Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], - m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], - SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); - } - } - } - for (count = 0; count < 32; count++) - { - if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) - { - Error.LogF("FPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::FPR[count], - m_Reg.m_FPR[count].W[1], m_Reg.m_FPR[count].W[0], - SecondCPU->m_Reg.m_FPR[count].W[1], SecondCPU->m_Reg.m_FPR[count].W[0]); - } - } - for (count = 0; count < 32; count++) - { - if (m_Reg.m_FPCR[count] != SecondCPU->m_Reg.m_FPCR[count]) - { - Error.LogF("FPCR[%s] 0x%08X, 0x%08X\r\n", CRegName::FPR_Ctrl[count], - m_Reg.m_FPCR[count], SecondCPU->m_Reg.m_FPCR[count]); - } - } - for (count = 0; count < 32; count++) - { - if (m_Reg.m_CP0[count] != SecondCPU->m_Reg.m_CP0[count]) - { - Error.LogF("CP0[%s] 0x%08X, 0x%08X\r\n", CRegName::Cop0[count], - m_Reg.m_CP0[count], SecondCPU->m_Reg.m_CP0[count]); - } - } - if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) - { - Error.LogF("HI Reg 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_HI.UW[1], m_Reg.m_HI.UW[0], SecondCPU->m_Reg.m_HI.UW[1], SecondCPU->m_Reg.m_HI.UW[0]); - } - if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) - { - Error.LogF("LO Reg 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_LO.UW[1], m_Reg.m_LO.UW[0], SecondCPU->m_Reg.m_LO.UW[1], SecondCPU->m_Reg.m_LO.UW[0]); - } - for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i++) - { - if (m_Reg.m_Mips_Interface[i] != SecondCPU->m_Reg.m_Mips_Interface[i]) - { - Error.LogF("Mips_Interface[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_Mips_Interface[i], SecondCPU->m_Reg.m_Mips_Interface[i]); - } - } + if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) { + Error.LogF("PROGRAM_COUNTER 0x%X, 0x%X\r\n", m_Reg.m_PROGRAM_COUNTER, SecondCPU->m_Reg.m_PROGRAM_COUNTER); + } + if (b32BitCore()) + { + for (count = 0; count < 32; count++) + { + if (m_Reg.m_GPR[count].UW[0] != SecondCPU->m_Reg.m_GPR[count].UW[0]) + { + Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], + m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], + SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); + } + } + } + else + { + for (count = 0; count < 32; count++) + { + if (m_Reg.m_GPR[count].DW != SecondCPU->m_Reg.m_GPR[count].DW) + { + Error.LogF("GPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], + m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], + SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); + } + } + } + for (count = 0; count < 32; count++) + { + if (m_Reg.m_FPR[count].DW != SecondCPU->m_Reg.m_FPR[count].DW) + { + Error.LogF("FPR[%s] 0x%08X%08X, 0x%08X%08X\r\n", CRegName::FPR[count], + m_Reg.m_FPR[count].W[1], m_Reg.m_FPR[count].W[0], + SecondCPU->m_Reg.m_FPR[count].W[1], SecondCPU->m_Reg.m_FPR[count].W[0]); + } + } + for (count = 0; count < 32; count++) + { + if (m_Reg.m_FPCR[count] != SecondCPU->m_Reg.m_FPCR[count]) + { + Error.LogF("FPCR[%s] 0x%08X, 0x%08X\r\n", CRegName::FPR_Ctrl[count], + m_Reg.m_FPCR[count], SecondCPU->m_Reg.m_FPCR[count]); + } + } + for (count = 0; count < 32; count++) + { + if (m_Reg.m_CP0[count] != SecondCPU->m_Reg.m_CP0[count]) + { + Error.LogF("CP0[%s] 0x%08X, 0x%08X\r\n", CRegName::Cop0[count], + m_Reg.m_CP0[count], SecondCPU->m_Reg.m_CP0[count]); + } + } + if (m_Reg.m_HI.DW != SecondCPU->m_Reg.m_HI.DW) + { + Error.LogF("HI Reg 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_HI.UW[1], m_Reg.m_HI.UW[0], SecondCPU->m_Reg.m_HI.UW[1], SecondCPU->m_Reg.m_HI.UW[0]); + } + if (m_Reg.m_LO.DW != SecondCPU->m_Reg.m_LO.DW) + { + Error.LogF("LO Reg 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_LO.UW[1], m_Reg.m_LO.UW[0], SecondCPU->m_Reg.m_LO.UW[1], SecondCPU->m_Reg.m_LO.UW[0]); + } + for (int i = 0, n = sizeof(m_Reg.m_Mips_Interface) / sizeof(m_Reg.m_Mips_Interface[0]); i < n; i++) + { + if (m_Reg.m_Mips_Interface[i] != SecondCPU->m_Reg.m_Mips_Interface[i]) + { + Error.LogF("Mips_Interface[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_Mips_Interface[i], SecondCPU->m_Reg.m_Mips_Interface[i]); + } + } - for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i++) - { - if (m_Reg.m_SigProcessor_Interface[i] != SecondCPU->m_Reg.m_SigProcessor_Interface[i]) - { - Error.LogF("SigProcessor_Interface[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_SigProcessor_Interface[i], SecondCPU->m_Reg.m_SigProcessor_Interface[i]); - } - } - for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i++) - { - if (m_Reg.m_Display_ControlReg[i] != SecondCPU->m_Reg.m_Display_ControlReg[i]) - { - Error.LogF("Display_ControlReg[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_Display_ControlReg[i], SecondCPU->m_Reg.m_Display_ControlReg[i]); - } - } + for (int i = 0, n = sizeof(m_Reg.m_SigProcessor_Interface) / sizeof(m_Reg.m_SigProcessor_Interface[0]); i < n; i++) + { + if (m_Reg.m_SigProcessor_Interface[i] != SecondCPU->m_Reg.m_SigProcessor_Interface[i]) + { + Error.LogF("SigProcessor_Interface[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_SigProcessor_Interface[i], SecondCPU->m_Reg.m_SigProcessor_Interface[i]); + } + } + for (int i = 0, n = sizeof(m_Reg.m_Display_ControlReg) / sizeof(m_Reg.m_Display_ControlReg[0]); i < n; i++) + { + if (m_Reg.m_Display_ControlReg[i] != SecondCPU->m_Reg.m_Display_ControlReg[i]) + { + Error.LogF("Display_ControlReg[%d] 0x%08X, 0x%08X\r\n", i, m_Reg.m_Display_ControlReg[i], SecondCPU->m_Reg.m_Display_ControlReg[i]); + } + } - if (m_NextTimer != SecondCPU->m_NextTimer) - { - Error.LogF("Current Time: %X %X\r\n", (DWORD)m_NextTimer, (DWORD)SecondCPU->m_NextTimer); - } - m_TLB.RecordDifference(Error, SecondCPU->m_TLB); - m_SystemTimer.RecordDifference(Error, SecondCPU->m_SystemTimer); - if (m_Reg.m_RoundingModel != SecondCPU->m_Reg.m_RoundingModel) - { - Error.LogF("RoundingModel: %X %X\r\n", m_Reg.m_RoundingModel, SecondCPU->m_Reg.m_RoundingModel); - } - if (bFastSP() && m_Recomp) - { - if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))) - { - Error.LogF("MemoryStack = %X should be: %X\r\n", m_Recomp->MemoryStackPos(), (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))); - } - } + if (m_NextTimer != SecondCPU->m_NextTimer) + { + Error.LogF("Current Time: %X %X\r\n", (DWORD)m_NextTimer, (DWORD)SecondCPU->m_NextTimer); + } + m_TLB.RecordDifference(Error, SecondCPU->m_TLB); + m_SystemTimer.RecordDifference(Error, SecondCPU->m_SystemTimer); + if (m_Reg.m_RoundingModel != SecondCPU->m_Reg.m_RoundingModel) + { + Error.LogF("RoundingModel: %X %X\r\n", m_Reg.m_RoundingModel, SecondCPU->m_Reg.m_RoundingModel); + } + if (bFastSP() && m_Recomp) + { + if (m_Recomp->MemoryStackPos() != (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))) + { + Error.LogF("MemoryStack = %X should be: %X\r\n", m_Recomp->MemoryStackPos(), (DWORD)(m_MMU_VM.Rdram() + (m_Reg.m_GPR[29].W[0] & 0x1FFFFFFF))); + } + } - DWORD * Rdram = (DWORD *)m_MMU_VM.Rdram(), *Rdram2 = (DWORD *)SecondCPU->m_MMU_VM.Rdram(); - for (int z = 0, n = (RdramSize() >> 2); z < n; z++) - { - if (Rdram[z] != Rdram2[z]) - { - Error.LogF("Rdram[%X]: %X %X\r\n", z << 2, Rdram[z], Rdram2[z]); - } - } + DWORD * Rdram = (DWORD *)m_MMU_VM.Rdram(), *Rdram2 = (DWORD *)SecondCPU->m_MMU_VM.Rdram(); + for (int z = 0, n = (RdramSize() >> 2); z < n; z++) + { + if (Rdram[z] != Rdram2[z]) + { + Error.LogF("Rdram[%X]: %X %X\r\n", z << 2, Rdram[z], Rdram2[z]); + } + } - DWORD * Imem = (DWORD *)m_MMU_VM.Imem(), *Imem2 = (DWORD *)SecondCPU->m_MMU_VM.Imem(); - for (int z = 0; z < (0x1000 >> 2); z++) - { - if (Imem[z] != Imem2[z]) - { - Error.LogF("Imem[%X]: %X %X\r\n", z << 2, Imem[z], Imem2[z]); - } - } - DWORD * Dmem = (DWORD *)m_MMU_VM.Dmem(), *Dmem2 = (DWORD *)SecondCPU->m_MMU_VM.Dmem(); - for (int z = 0; z < (0x1000 >> 2); z++) - { - if (Dmem[z] != Dmem2[z]) - { - Error.LogF("Dmem[%X]: %X %X\r\n", z << 2, Dmem[z], Dmem2[z]); - } - } - Error.Log("\r\n"); - Error.Log("Information:\r\n"); - Error.Log("\r\n"); - Error.LogF("PROGRAM_COUNTER,0x%X\r\n", m_Reg.m_PROGRAM_COUNTER); - Error.LogF("Current Timer,0x%X\r\n", m_NextTimer); - Error.LogF("Timer Type,0x%X\r\n", m_SystemTimer.CurrentType()); - Error.Log("\r\n"); - for (int i = 0; i < (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i++) - { - Error.LogF("LastSuccessSyncPC[%d],0x%X\r\n", i, m_LastSuccessSyncPC[i]); - } - Error.Log("\r\n"); - for (count = 0; count < 32; count++) - { - Error.LogF("GPR[%s], 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], - m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], - SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); - } - Error.Log("\r\n"); - for (count = 0; count < 32; count++) - { - Error.LogF("FPR[%s],%*s0x%08X%08X, 0x%08X%08X\r\n", CRegName::FPR[count], - count < 10 ? 9 : 8, " ", m_Reg.m_FPR[count].W[1], m_Reg.m_FPR[count].W[0], - SecondCPU->m_Reg.m_FPR[count].W[1], SecondCPU->m_Reg.m_FPR[count].W[0]); - } - Error.Log("\r\n"); - for (count = 0; count < 32; count++) - { - Error.LogF("FPR_S[%s],%*s%f, %f\r\n", CRegName::FPR[count], - count < 10 ? 7 : 6, " ", *(m_Reg.m_FPR_S[count]), *(SecondCPU->m_Reg.m_FPR_S[count])); - } - Error.Log("\r\n"); - for (count = 0; count < 32; count++) - { - Error.LogF("FPR_D[%s],%*s%f, %f\r\n", CRegName::FPR[count], - count < 10 ? 7 : 6, " ", *(m_Reg.m_FPR_D[count]), *(SecondCPU->m_Reg.m_FPR_D[count])); - } - Error.Log("\r\n"); - Error.LogF("Rounding Model, 0x%08X, 0x%08X\r\n", m_Reg.m_RoundingModel, SecondCPU->m_Reg.m_RoundingModel); - Error.Log("\r\n"); - for (count = 0; count < 32; count++) - { - Error.LogF("CP0[%s],%*s0x%08X, 0x%08X\r\n", CRegName::Cop0[count], - 12 - strlen(CRegName::Cop0[count]), "", - m_Reg.m_CP0[count], SecondCPU->m_Reg.m_CP0[count]); - } - Error.Log("\r\n"); - Error.LogF("HI 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_HI.UW[1], m_Reg.m_HI.UW[0], - SecondCPU->m_Reg.m_HI.UW[1], SecondCPU->m_Reg.m_HI.UW[0]); - Error.LogF("LO 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_LO.UW[1], m_Reg.m_LO.UW[0], - SecondCPU->m_Reg.m_LO.UW[1], SecondCPU->m_Reg.m_LO.UW[0]); - bool bHasTlb = false; - for (count = 0; count < 32; count++) - { - if (!m_TLB.TlbEntry(count).EntryDefined) { continue; } - if (!bHasTlb) - { - Error.Log("\r\n"); - Error.Log(" Hi Recomp, PageMask, Hi Interp, PageMask\r\n"); - bHasTlb = true; - } - Error.LogF("TLB[%2d], %08X, %08X, %08X, %08X\r\n", count, - m_TLB.TlbEntry(count).EntryHi.Value, m_TLB.TlbEntry(count).PageMask.Value, - SecondCPU->m_TLB.TlbEntry(count).EntryHi.Value, SecondCPU->m_TLB.TlbEntry(count).PageMask.Value - ); - } - Error.Log("\r\n"); - Error.Log("Code at PC:\r\n"); - for (count = -10; count < 10; count++) - { - DWORD OpcodeValue, Addr = m_Reg.m_PROGRAM_COUNTER + (count << 2); - if (g_MMU->LW_VAddr(Addr, (uint32_t &)OpcodeValue)) - { - Error.LogF("%X: %s\r\n", Addr, R4300iOpcodeName(OpcodeValue, Addr)); - } - } - Error.Log("\r\n"); - Error.Log("Code at Last Sync PC:\r\n"); - for (count = 0; count < 50; count++) - { - DWORD OpcodeValue, Addr = m_LastSuccessSyncPC[0] + (count << 2); - if (g_MMU->LW_VAddr(Addr, (uint32_t &)OpcodeValue)) - { - Error.LogF("%X: %s\r\n", Addr, R4300iOpcodeName(OpcodeValue, Addr)); - } - } - } + DWORD * Imem = (DWORD *)m_MMU_VM.Imem(), *Imem2 = (DWORD *)SecondCPU->m_MMU_VM.Imem(); + for (int z = 0; z < (0x1000 >> 2); z++) + { + if (Imem[z] != Imem2[z]) + { + Error.LogF("Imem[%X]: %X %X\r\n", z << 2, Imem[z], Imem2[z]); + } + } + DWORD * Dmem = (DWORD *)m_MMU_VM.Dmem(), *Dmem2 = (DWORD *)SecondCPU->m_MMU_VM.Dmem(); + for (int z = 0; z < (0x1000 >> 2); z++) + { + if (Dmem[z] != Dmem2[z]) + { + Error.LogF("Dmem[%X]: %X %X\r\n", z << 2, Dmem[z], Dmem2[z]); + } + } + Error.Log("\r\n"); + Error.Log("Information:\r\n"); + Error.Log("\r\n"); + Error.LogF("PROGRAM_COUNTER,0x%X\r\n", m_Reg.m_PROGRAM_COUNTER); + Error.LogF("Current Timer,0x%X\r\n", m_NextTimer); + Error.LogF("Timer Type,0x%X\r\n", m_SystemTimer.CurrentType()); + Error.Log("\r\n"); + for (int i = 0; i < (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i++) + { + Error.LogF("LastSuccessSyncPC[%d],0x%X\r\n", i, m_LastSuccessSyncPC[i]); + } + Error.Log("\r\n"); + for (count = 0; count < 32; count++) + { + Error.LogF("GPR[%s], 0x%08X%08X, 0x%08X%08X\r\n", CRegName::GPR[count], + m_Reg.m_GPR[count].W[1], m_Reg.m_GPR[count].W[0], + SecondCPU->m_Reg.m_GPR[count].W[1], SecondCPU->m_Reg.m_GPR[count].W[0]); + } + Error.Log("\r\n"); + for (count = 0; count < 32; count++) + { + Error.LogF("FPR[%s],%*s0x%08X%08X, 0x%08X%08X\r\n", CRegName::FPR[count], + count < 10 ? 9 : 8, " ", m_Reg.m_FPR[count].W[1], m_Reg.m_FPR[count].W[0], + SecondCPU->m_Reg.m_FPR[count].W[1], SecondCPU->m_Reg.m_FPR[count].W[0]); + } + Error.Log("\r\n"); + for (count = 0; count < 32; count++) + { + Error.LogF("FPR_S[%s],%*s%f, %f\r\n", CRegName::FPR[count], + count < 10 ? 7 : 6, " ", *(m_Reg.m_FPR_S[count]), *(SecondCPU->m_Reg.m_FPR_S[count])); + } + Error.Log("\r\n"); + for (count = 0; count < 32; count++) + { + Error.LogF("FPR_D[%s],%*s%f, %f\r\n", CRegName::FPR[count], + count < 10 ? 7 : 6, " ", *(m_Reg.m_FPR_D[count]), *(SecondCPU->m_Reg.m_FPR_D[count])); + } + Error.Log("\r\n"); + Error.LogF("Rounding Model, 0x%08X, 0x%08X\r\n", m_Reg.m_RoundingModel, SecondCPU->m_Reg.m_RoundingModel); + Error.Log("\r\n"); + for (count = 0; count < 32; count++) + { + Error.LogF("CP0[%s],%*s0x%08X, 0x%08X\r\n", CRegName::Cop0[count], + 12 - strlen(CRegName::Cop0[count]), "", + m_Reg.m_CP0[count], SecondCPU->m_Reg.m_CP0[count]); + } + Error.Log("\r\n"); + Error.LogF("HI 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_HI.UW[1], m_Reg.m_HI.UW[0], + SecondCPU->m_Reg.m_HI.UW[1], SecondCPU->m_Reg.m_HI.UW[0]); + Error.LogF("LO 0x%08X%08X, 0x%08X%08X\r\n", m_Reg.m_LO.UW[1], m_Reg.m_LO.UW[0], + SecondCPU->m_Reg.m_LO.UW[1], SecondCPU->m_Reg.m_LO.UW[0]); + bool bHasTlb = false; + for (count = 0; count < 32; count++) + { + if (!m_TLB.TlbEntry(count).EntryDefined) { continue; } + if (!bHasTlb) + { + Error.Log("\r\n"); + Error.Log(" Hi Recomp, PageMask, Hi Interp, PageMask\r\n"); + bHasTlb = true; + } + Error.LogF("TLB[%2d], %08X, %08X, %08X, %08X\r\n", count, + m_TLB.TlbEntry(count).EntryHi.Value, m_TLB.TlbEntry(count).PageMask.Value, + SecondCPU->m_TLB.TlbEntry(count).EntryHi.Value, SecondCPU->m_TLB.TlbEntry(count).PageMask.Value + ); + } + Error.Log("\r\n"); + Error.Log("Code at PC:\r\n"); + for (count = -10; count < 10; count++) + { + DWORD OpcodeValue, Addr = m_Reg.m_PROGRAM_COUNTER + (count << 2); + if (g_MMU->LW_VAddr(Addr, (uint32_t &)OpcodeValue)) + { + Error.LogF("%X: %s\r\n", Addr, R4300iOpcodeName(OpcodeValue, Addr)); + } + } + Error.Log("\r\n"); + Error.Log("Code at Last Sync PC:\r\n"); + for (count = 0; count < 50; count++) + { + DWORD OpcodeValue, Addr = m_LastSuccessSyncPC[0] + (count << 2); + if (g_MMU->LW_VAddr(Addr, (uint32_t &)OpcodeValue)) + { + Error.LogF("%X: %s\r\n", Addr, R4300iOpcodeName(OpcodeValue, Addr)); + } + } + } - g_Notify->DisplayError(L"Sync Error"); - g_Notify->BreakPoint(__FILEW__, __LINE__); + g_Notify->DisplayError(L"Sync Error"); + g_Notify->BreakPoint(__FILEW__, __LINE__); } bool CN64System::SaveState() { - WriteTrace(TraceDebug, __FUNCTION__ ": Start"); + WriteTrace(TraceDebug, __FUNCTION__ ": Start"); - // if (!m_SystemTimer.SaveAllowed()) { return false; } - if ((m_Reg.STATUS_REGISTER & STATUS_EXL) != 0) { return false; } + // if (!m_SystemTimer.SaveAllowed()) { return false; } + if ((m_Reg.STATUS_REGISTER & STATUS_EXL) != 0) { return false; } - //Get the file Name - stdstr FileName, ExtraInfoFileName, CurrentSaveName = g_Settings->LoadStringVal(GameRunning_InstantSaveFile); - if (CurrentSaveName.empty()) - { - int Slot = g_Settings->LoadDword(Game_CurrentSaveState); - if (Slot != 0) - { - CurrentSaveName.Format("%s.pj%d", g_Settings->LoadStringVal(Game_GoodName).c_str(), Slot); - } - else - { - CurrentSaveName.Format("%s.pj", g_Settings->LoadStringVal(Game_GoodName).c_str()); - } - FileName.Format("%s%s", g_Settings->LoadStringVal(Directory_InstantSave).c_str(), CurrentSaveName.c_str()); - stdstr_f ZipFileName("%s.zip", FileName.c_str()); - //Make sure the target dir exists - CreateDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str(), NULL); - //delete any old save - DeleteFile(FileName.c_str()); - DeleteFile(ZipFileName.c_str()); - ExtraInfoFileName.Format("%s.dat", CurrentSaveName.c_str()); + //Get the file Name + stdstr FileName, ExtraInfoFileName, CurrentSaveName = g_Settings->LoadStringVal(GameRunning_InstantSaveFile); + if (CurrentSaveName.empty()) + { + int Slot = g_Settings->LoadDword(Game_CurrentSaveState); + if (Slot != 0) + { + CurrentSaveName.Format("%s.pj%d", g_Settings->LoadStringVal(Game_GoodName).c_str(), Slot); + } + else + { + CurrentSaveName.Format("%s.pj", g_Settings->LoadStringVal(Game_GoodName).c_str()); + } + FileName.Format("%s%s", g_Settings->LoadStringVal(Directory_InstantSave).c_str(), CurrentSaveName.c_str()); + stdstr_f ZipFileName("%s.zip", FileName.c_str()); + //Make sure the target dir exists + CreateDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str(), NULL); + //delete any old save + DeleteFile(FileName.c_str()); + DeleteFile(ZipFileName.c_str()); + ExtraInfoFileName.Format("%s.dat", CurrentSaveName.c_str()); - //If ziping save add .zip on the end - if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) - { - FileName = ZipFileName; - } - g_Settings->SaveDword(Game_LastSaveSlot, g_Settings->LoadDword(Game_CurrentSaveState)); - } - else - { - char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; - _splitpath(CurrentSaveName.c_str(), drive, dir, fname, ext); + //If ziping save add .zip on the end + if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) + { + FileName = ZipFileName; + } + g_Settings->SaveDword(Game_LastSaveSlot, g_Settings->LoadDword(Game_CurrentSaveState)); + } + else + { + char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; + _splitpath(CurrentSaveName.c_str(), drive, dir, fname, ext); - FileName.Format("%s.pj", CurrentSaveName.c_str()); + FileName.Format("%s.pj", CurrentSaveName.c_str()); - CurrentSaveName.Format("%s.pj", fname); - ExtraInfoFileName.Format("%s.dat", fname); + CurrentSaveName.Format("%s.pj", fname); + ExtraInfoFileName.Format("%s.dat", fname); - //If ziping save add .zip on the end - if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) - { - FileName.Format("%s.zip", FileName.c_str()); - } - } - if (FileName.empty()) { return true; } + //If ziping save add .zip on the end + if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) + { + FileName.Format("%s.zip", FileName.c_str()); + } + } + if (FileName.empty()) { return true; } - //Open the file - if (g_Settings->LoadDword(Game_FuncLookupMode) == FuncFind_ChangeMemory) - { - if (m_Recomp) - { - m_Recomp->ResetRecompCode(true); - } - } + //Open the file + if (g_Settings->LoadDword(Game_FuncLookupMode) == FuncFind_ChangeMemory) + { + if (m_Recomp) + { + m_Recomp->ResetRecompCode(true); + } + } - DWORD dwWritten, SaveID_0 = 0x23D8A6C8, SaveID_1 = 0x56D2CD23; - DWORD RdramSize = g_Settings->LoadDword(Game_RDRamSize); - DWORD MiInterReg = g_Reg->MI_INTR_REG; - DWORD NextViTimer = m_SystemTimer.GetTimer(CSystemTimer::ViTimer); - if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) - { - zipFile file; + DWORD dwWritten, SaveID_0 = 0x23D8A6C8, SaveID_1 = 0x56D2CD23; + DWORD RdramSize = g_Settings->LoadDword(Game_RDRamSize); + DWORD MiInterReg = g_Reg->MI_INTR_REG; + DWORD NextViTimer = m_SystemTimer.GetTimer(CSystemTimer::ViTimer); + if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) + { + zipFile file; - file = zipOpen(FileName.c_str(), 0); - zipOpenNewFileInZip(file, CurrentSaveName.c_str(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); - zipWriteInFileInZip(file, &SaveID_0, sizeof(SaveID_0)); - zipWriteInFileInZip(file, &RdramSize, sizeof(DWORD)); - zipWriteInFileInZip(file, g_Rom->GetRomAddress(), 0x40); - zipWriteInFileInZip(file, &NextViTimer, sizeof(DWORD)); - zipWriteInFileInZip(file, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER)); - zipWriteInFileInZip(file, m_Reg.m_GPR, sizeof(__int64) * 32); - zipWriteInFileInZip(file, m_Reg.m_FPR, sizeof(__int64) * 32); - zipWriteInFileInZip(file, m_Reg.m_CP0, sizeof(DWORD) * 32); - zipWriteInFileInZip(file, m_Reg.m_FPCR, sizeof(DWORD) * 32); - zipWriteInFileInZip(file, &m_Reg.m_HI, sizeof(__int64)); - zipWriteInFileInZip(file, &m_Reg.m_LO, sizeof(__int64)); - zipWriteInFileInZip(file, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10); - zipWriteInFileInZip(file, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10); - zipWriteInFileInZip(file, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10); - zipWriteInFileInZip(file, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4); - zipWriteInFileInZip(file, m_Reg.m_Video_Interface, sizeof(DWORD) * 14); - zipWriteInFileInZip(file, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6); - zipWriteInFileInZip(file, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13); - zipWriteInFileInZip(file, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8); - zipWriteInFileInZip(file, m_Reg.m_SerialInterface, sizeof(DWORD) * 4); - zipWriteInFileInZip(file, (void *const)&m_TLB.TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32); - zipWriteInFileInZip(file, m_MMU_VM.PifRam(), 0x40); - zipWriteInFileInZip(file, m_MMU_VM.Rdram(), RdramSize); - zipWriteInFileInZip(file, m_MMU_VM.Dmem(), 0x1000); - zipWriteInFileInZip(file, m_MMU_VM.Imem(), 0x1000); - zipCloseFileInZip(file); + file = zipOpen(FileName.c_str(), 0); + zipOpenNewFileInZip(file, CurrentSaveName.c_str(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); + zipWriteInFileInZip(file, &SaveID_0, sizeof(SaveID_0)); + zipWriteInFileInZip(file, &RdramSize, sizeof(DWORD)); + zipWriteInFileInZip(file, g_Rom->GetRomAddress(), 0x40); + zipWriteInFileInZip(file, &NextViTimer, sizeof(DWORD)); + zipWriteInFileInZip(file, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER)); + zipWriteInFileInZip(file, m_Reg.m_GPR, sizeof(__int64) * 32); + zipWriteInFileInZip(file, m_Reg.m_FPR, sizeof(__int64) * 32); + zipWriteInFileInZip(file, m_Reg.m_CP0, sizeof(DWORD) * 32); + zipWriteInFileInZip(file, m_Reg.m_FPCR, sizeof(DWORD) * 32); + zipWriteInFileInZip(file, &m_Reg.m_HI, sizeof(__int64)); + zipWriteInFileInZip(file, &m_Reg.m_LO, sizeof(__int64)); + zipWriteInFileInZip(file, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10); + zipWriteInFileInZip(file, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10); + zipWriteInFileInZip(file, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10); + zipWriteInFileInZip(file, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4); + zipWriteInFileInZip(file, m_Reg.m_Video_Interface, sizeof(DWORD) * 14); + zipWriteInFileInZip(file, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6); + zipWriteInFileInZip(file, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13); + zipWriteInFileInZip(file, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8); + zipWriteInFileInZip(file, m_Reg.m_SerialInterface, sizeof(DWORD) * 4); + zipWriteInFileInZip(file, (void *const)&m_TLB.TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32); + zipWriteInFileInZip(file, m_MMU_VM.PifRam(), 0x40); + zipWriteInFileInZip(file, m_MMU_VM.Rdram(), RdramSize); + zipWriteInFileInZip(file, m_MMU_VM.Dmem(), 0x1000); + zipWriteInFileInZip(file, m_MMU_VM.Imem(), 0x1000); + zipCloseFileInZip(file); - zipOpenNewFileInZip(file, ExtraInfoFileName.c_str(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); - zipWriteInFileInZip(file, &SaveID_1, sizeof(SaveID_1)); - m_SystemTimer.SaveData(file); - zipCloseFileInZip(file); + zipOpenNewFileInZip(file, ExtraInfoFileName.c_str(), NULL, NULL, 0, NULL, 0, NULL, Z_DEFLATED, Z_DEFAULT_COMPRESSION); + zipWriteInFileInZip(file, &SaveID_1, sizeof(SaveID_1)); + m_SystemTimer.SaveData(file); + zipCloseFileInZip(file); - zipClose(file, ""); - } - else - { - HANDLE hSaveFile = CreateFile(FileName.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); - if (hSaveFile == INVALID_HANDLE_VALUE) - { - g_Notify->DisplayError(GS(MSG_FAIL_OPEN_SAVE)); - m_Reg.MI_INTR_REG = MiInterReg; - return true; - } + zipClose(file, ""); + } + else + { + HANDLE hSaveFile = CreateFile(FileName.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); + if (hSaveFile == INVALID_HANDLE_VALUE) + { + g_Notify->DisplayError(GS(MSG_FAIL_OPEN_SAVE)); + m_Reg.MI_INTR_REG = MiInterReg; + return true; + } - //Write info to file - SetFilePointer(hSaveFile, 0, NULL, FILE_BEGIN); - WriteFile(hSaveFile, &SaveID_0, sizeof(DWORD), &dwWritten, NULL); - WriteFile(hSaveFile, &RdramSize, sizeof(DWORD), &dwWritten, NULL); - WriteFile(hSaveFile, g_Rom->GetRomAddress(), 0x40, &dwWritten, NULL); - WriteFile(hSaveFile, &NextViTimer, sizeof(DWORD), &dwWritten, NULL); - WriteFile(hSaveFile, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER), &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_GPR, sizeof(__int64) * 32, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_FPR, sizeof(__int64) * 32, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_CP0, sizeof(DWORD) * 32, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_FPCR, sizeof(DWORD) * 32, &dwWritten, NULL); - WriteFile(hSaveFile, &m_Reg.m_HI, sizeof(__int64), &dwWritten, NULL); - WriteFile(hSaveFile, &m_Reg.m_LO, sizeof(__int64), &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_Video_Interface, sizeof(DWORD) * 14, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8, &dwWritten, NULL); - WriteFile(hSaveFile, m_Reg.m_SerialInterface, sizeof(DWORD) * 4, &dwWritten, NULL); - WriteFile(hSaveFile, &g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32, &dwWritten, NULL); - WriteFile(hSaveFile, g_MMU->PifRam(), 0x40, &dwWritten, NULL); - WriteFile(hSaveFile, g_MMU->Rdram(), RdramSize, &dwWritten, NULL); - WriteFile(hSaveFile, g_MMU->Dmem(), 0x1000, &dwWritten, NULL); - WriteFile(hSaveFile, g_MMU->Imem(), 0x1000, &dwWritten, NULL); + //Write info to file + SetFilePointer(hSaveFile, 0, NULL, FILE_BEGIN); + WriteFile(hSaveFile, &SaveID_0, sizeof(DWORD), &dwWritten, NULL); + WriteFile(hSaveFile, &RdramSize, sizeof(DWORD), &dwWritten, NULL); + WriteFile(hSaveFile, g_Rom->GetRomAddress(), 0x40, &dwWritten, NULL); + WriteFile(hSaveFile, &NextViTimer, sizeof(DWORD), &dwWritten, NULL); + WriteFile(hSaveFile, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER), &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_GPR, sizeof(__int64) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_FPR, sizeof(__int64) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_CP0, sizeof(DWORD) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_FPCR, sizeof(DWORD) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, &m_Reg.m_HI, sizeof(__int64), &dwWritten, NULL); + WriteFile(hSaveFile, &m_Reg.m_LO, sizeof(__int64), &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Video_Interface, sizeof(DWORD) * 14, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8, &dwWritten, NULL); + WriteFile(hSaveFile, m_Reg.m_SerialInterface, sizeof(DWORD) * 4, &dwWritten, NULL); + WriteFile(hSaveFile, &g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->PifRam(), 0x40, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->Rdram(), RdramSize, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->Dmem(), 0x1000, &dwWritten, NULL); + WriteFile(hSaveFile, g_MMU->Imem(), 0x1000, &dwWritten, NULL); - CloseHandle(hSaveFile); - } - m_Reg.MI_INTR_REG = MiInterReg; - g_Settings->SaveString(GameRunning_InstantSaveFile, ""); - std::wstring SaveMessage = g_Lang->GetString(MSG_SAVED_STATE); + CloseHandle(hSaveFile); + } + m_Reg.MI_INTR_REG = MiInterReg; + g_Settings->SaveString(GameRunning_InstantSaveFile, ""); + std::wstring SaveMessage = g_Lang->GetString(MSG_SAVED_STATE); - CPath SavedFileName(FileName); + CPath SavedFileName(FileName); - g_Notify->DisplayMessage(5, stdstr_f("%s %s", SaveMessage.c_str(), SavedFileName.GetNameExtension()).ToUTF16().c_str()); - Notify().RefreshMenu(); - WriteTrace(TraceDebug, __FUNCTION__ ": Done"); - return true; + g_Notify->DisplayMessage(5, stdstr_f("%s %s", SaveMessage.c_str(), SavedFileName.GetNameExtension()).ToUTF16().c_str()); + Notify().RefreshMenu(); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); + return true; } bool CN64System::LoadState() { - stdstr InstantFileName = g_Settings->LoadStringVal(GameRunning_InstantSaveFile); - if (!InstantFileName.empty()) - { - bool Result = LoadState(InstantFileName.c_str()); - g_Settings->SaveString(GameRunning_InstantSaveFile, ""); - return Result; - } + stdstr InstantFileName = g_Settings->LoadStringVal(GameRunning_InstantSaveFile); + if (!InstantFileName.empty()) + { + bool Result = LoadState(InstantFileName.c_str()); + g_Settings->SaveString(GameRunning_InstantSaveFile, ""); + return Result; + } - CPath FileName; - FileName.SetDriveDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str()); - if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) - { - FileName.SetNameExtension(stdstr_f("%s.pj%d", g_Settings->LoadStringVal(Game_GoodName).c_str(), g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); - } - else - { - FileName.SetNameExtension(stdstr_f("%s.pj", g_Settings->LoadStringVal(Game_GoodName).c_str()).c_str()); - } + CPath FileName; + FileName.SetDriveDirectory(g_Settings->LoadStringVal(Directory_InstantSave).c_str()); + if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) + { + FileName.SetNameExtension(stdstr_f("%s.pj%d", g_Settings->LoadStringVal(Game_GoodName).c_str(), g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); + } + else + { + FileName.SetNameExtension(stdstr_f("%s.pj", g_Settings->LoadStringVal(Game_GoodName).c_str()).c_str()); + } - CPath ZipFileName; - ZipFileName = (stdstr&)FileName + ".zip"; + CPath ZipFileName; + ZipFileName = (stdstr&)FileName + ".zip"; - if ((g_Settings->LoadDword(Setting_AutoZipInstantSave) && ZipFileName.Exists()) || FileName.Exists()) - { - if (LoadState(FileName)) - { - return true; - } - } + if ((g_Settings->LoadDword(Setting_AutoZipInstantSave) && ZipFileName.Exists()) || FileName.Exists()) + { + if (LoadState(FileName)) + { + return true; + } + } - //Use old file Name - if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) - { - FileName.SetNameExtension(stdstr_f("%s.pj%d", g_Settings->LoadStringVal(Game_GameName).c_str(), g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); - } - else - { - FileName.SetNameExtension(stdstr_f("%s.pj", g_Settings->LoadStringVal(Game_GameName).c_str()).c_str()); - } - return LoadState(FileName); + //Use old file Name + if (g_Settings->LoadDword(Game_CurrentSaveState) != 0) + { + FileName.SetNameExtension(stdstr_f("%s.pj%d", g_Settings->LoadStringVal(Game_GameName).c_str(), g_Settings->LoadDword(Game_CurrentSaveState)).c_str()); + } + else + { + FileName.SetNameExtension(stdstr_f("%s.pj", g_Settings->LoadStringVal(Game_GameName).c_str()).c_str()); + } + return LoadState(FileName); } bool CN64System::LoadState(LPCSTR FileName) { - 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; + 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); + WriteTraceF((TraceType)(TraceDebug | TraceRecompiler), __FUNCTION__ "(%s): Start", FileName); - char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; - _splitpath(FileName, drive, dir, fname, ext); + char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; + _splitpath(FileName, drive, dir, fname, ext); - stdstr FileNameStr(FileName); - if (g_Settings->LoadDword(Setting_AutoZipInstantSave) || _stricmp(ext, ".zip") == 0) - { - //If ziping save add .zip on the end - if (_stricmp(ext, ".zip") != 0) - { - FileNameStr += ".zip"; - } - unzFile file = unzOpen(FileNameStr.c_str()); - int port = -1; - if (file != NULL) - { - port = unzGoToFirstFile(file); - } - DWORD Value; - while (port == UNZ_OK) - { - unz_file_info info; - char zname[132]; + stdstr FileNameStr(FileName); + if (g_Settings->LoadDword(Setting_AutoZipInstantSave) || _stricmp(ext, ".zip") == 0) + { + //If ziping save add .zip on the end + if (_stricmp(ext, ".zip") != 0) + { + FileNameStr += ".zip"; + } + unzFile file = unzOpen(FileNameStr.c_str()); + int port = -1; + if (file != NULL) + { + port = unzGoToFirstFile(file); + } + DWORD Value; + while (port == UNZ_OK) + { + unz_file_info info; + char zname[132]; - unzGetCurrentFileInfo(file, &info, zname, 128, NULL, 0, NULL, 0); - if (unzLocateFile(file, zname, 1) != UNZ_OK) - { - unzClose(file); - port = -1; - continue; - } - if (unzOpenCurrentFile(file) != UNZ_OK) - { - unzClose(file); - port = -1; - continue; - } - unzReadCurrentFile(file, &Value, 4); - if (Value != 0x23D8A6C8 && Value != 0x56D2CD23) - { - unzCloseCurrentFile(file); - port = unzGoToNextFile(file); - continue; - } - if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK) - { - unzReadCurrentFile(file, &SaveRDRAMSize, sizeof(SaveRDRAMSize)); - //Check header + unzGetCurrentFileInfo(file, &info, zname, 128, NULL, 0, NULL, 0); + if (unzLocateFile(file, zname, 1) != UNZ_OK) + { + unzClose(file); + port = -1; + continue; + } + if (unzOpenCurrentFile(file) != UNZ_OK) + { + unzClose(file); + port = -1; + continue; + } + unzReadCurrentFile(file, &Value, 4); + if (Value != 0x23D8A6C8 && Value != 0x56D2CD23) + { + unzCloseCurrentFile(file); + port = unzGoToNextFile(file); + continue; + } + if (!LoadedZipFile && Value == 0x23D8A6C8 && port == UNZ_OK) + { + unzReadCurrentFile(file, &SaveRDRAMSize, sizeof(SaveRDRAMSize)); + //Check header - BYTE LoadHeader[64]; - unzReadCurrentFile(file, LoadHeader, 0x40); - if (memcmp(LoadHeader, g_Rom->GetRomAddress(), 0x40) != 0) - { - //if (inFullScreen) { return false; } - int result = MessageBoxW(NULL, GS(MSG_SAVE_STATE_HEADER), GS(MSG_MSGBOX_TITLE), - MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2); + BYTE LoadHeader[64]; + unzReadCurrentFile(file, LoadHeader, 0x40); + if (memcmp(LoadHeader, g_Rom->GetRomAddress(), 0x40) != 0) + { + //if (inFullScreen) { return false; } + int result = MessageBoxW(NULL, GS(MSG_SAVE_STATE_HEADER), GS(MSG_MSGBOX_TITLE), + MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2); - if (result == IDNO) - return false; - } - Reset(false, true); + if (result == IDNO) + return false; + } + Reset(false, true); - g_MMU->UnProtectMemory(0x80000000, 0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); - g_MMU->UnProtectMemory(0xA4000000, 0xA4001FFC); - g_Settings->SaveDword(Game_RDRamSize, SaveRDRAMSize); - unzReadCurrentFile(file, &NextVITimer, sizeof(NextVITimer)); - unzReadCurrentFile(file, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER)); - unzReadCurrentFile(file, m_Reg.m_GPR, sizeof(__int64) * 32); - unzReadCurrentFile(file, m_Reg.m_FPR, sizeof(__int64) * 32); - unzReadCurrentFile(file, m_Reg.m_CP0, sizeof(DWORD) * 32); - unzReadCurrentFile(file, m_Reg.m_FPCR, sizeof(DWORD) * 32); - unzReadCurrentFile(file, &m_Reg.m_HI, sizeof(__int64)); - unzReadCurrentFile(file, &m_Reg.m_LO, sizeof(__int64)); - unzReadCurrentFile(file, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10); - unzReadCurrentFile(file, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10); - unzReadCurrentFile(file, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10); - unzReadCurrentFile(file, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4); - unzReadCurrentFile(file, m_Reg.m_Video_Interface, sizeof(DWORD) * 14); - unzReadCurrentFile(file, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6); - unzReadCurrentFile(file, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13); - unzReadCurrentFile(file, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8); - unzReadCurrentFile(file, m_Reg.m_SerialInterface, sizeof(DWORD) * 4); - unzReadCurrentFile(file, (void *const)&g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32); - unzReadCurrentFile(file, m_MMU_VM.PifRam(), 0x40); - unzReadCurrentFile(file, m_MMU_VM.Rdram(), SaveRDRAMSize); - unzReadCurrentFile(file, m_MMU_VM.Dmem(), 0x1000); - unzReadCurrentFile(file, m_MMU_VM.Imem(), 0x1000); - unzCloseCurrentFile(file); - port = unzGoToFirstFile(file); - LoadedZipFile = true; - continue; - } - if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK) - { - m_SystemTimer.LoadData(file); - } - unzCloseCurrentFile(file); - port = unzGoToNextFile(file); - } - unzClose(file); - } - if (!LoadedZipFile) - { - HANDLE hSaveFile = CreateFile(FileNameStr.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, NULL, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); - if (hSaveFile == INVALID_HANDLE_VALUE) - { - g_Notify->DisplayMessage(5, stdstr_f("%s %s", GS(MSG_UNABLED_LOAD_STATE), FileNameStr).ToUTF16().c_str()); - return false; - } + g_MMU->UnProtectMemory(0x80000000, 0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); + g_MMU->UnProtectMemory(0xA4000000, 0xA4001FFC); + g_Settings->SaveDword(Game_RDRamSize, SaveRDRAMSize); + unzReadCurrentFile(file, &NextVITimer, sizeof(NextVITimer)); + unzReadCurrentFile(file, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER)); + unzReadCurrentFile(file, m_Reg.m_GPR, sizeof(__int64) * 32); + unzReadCurrentFile(file, m_Reg.m_FPR, sizeof(__int64) * 32); + unzReadCurrentFile(file, m_Reg.m_CP0, sizeof(DWORD) * 32); + unzReadCurrentFile(file, m_Reg.m_FPCR, sizeof(DWORD) * 32); + unzReadCurrentFile(file, &m_Reg.m_HI, sizeof(__int64)); + unzReadCurrentFile(file, &m_Reg.m_LO, sizeof(__int64)); + unzReadCurrentFile(file, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10); + unzReadCurrentFile(file, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10); + unzReadCurrentFile(file, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10); + unzReadCurrentFile(file, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4); + unzReadCurrentFile(file, m_Reg.m_Video_Interface, sizeof(DWORD) * 14); + unzReadCurrentFile(file, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6); + unzReadCurrentFile(file, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13); + unzReadCurrentFile(file, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8); + unzReadCurrentFile(file, m_Reg.m_SerialInterface, sizeof(DWORD) * 4); + unzReadCurrentFile(file, (void *const)&g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32); + unzReadCurrentFile(file, m_MMU_VM.PifRam(), 0x40); + unzReadCurrentFile(file, m_MMU_VM.Rdram(), SaveRDRAMSize); + unzReadCurrentFile(file, m_MMU_VM.Dmem(), 0x1000); + unzReadCurrentFile(file, m_MMU_VM.Imem(), 0x1000); + unzCloseCurrentFile(file); + port = unzGoToFirstFile(file); + LoadedZipFile = true; + continue; + } + if (LoadedZipFile && Value == 0x56D2CD23 && port == UNZ_OK) + { + m_SystemTimer.LoadData(file); + } + unzCloseCurrentFile(file); + port = unzGoToNextFile(file); + } + unzClose(file); + } + if (!LoadedZipFile) + { + HANDLE hSaveFile = CreateFile(FileNameStr.c_str(), GENERIC_WRITE | GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); + if (hSaveFile == INVALID_HANDLE_VALUE) + { + g_Notify->DisplayMessage(5, stdstr_f("%s %s", GS(MSG_UNABLED_LOAD_STATE), FileNameStr).ToUTF16().c_str()); + return false; + } - SetFilePointer(hSaveFile, 0, NULL, FILE_BEGIN); - ReadFile(hSaveFile, &Value, sizeof(Value), &dwRead, NULL); - if (Value != 0x23D8A6C8) - return false; + SetFilePointer(hSaveFile, 0, NULL, FILE_BEGIN); + ReadFile(hSaveFile, &Value, sizeof(Value), &dwRead, NULL); + if (Value != 0x23D8A6C8) + return false; - ReadFile(hSaveFile, &SaveRDRAMSize, sizeof(SaveRDRAMSize), &dwRead, NULL); - //Check header - BYTE LoadHeader[64]; - ReadFile(hSaveFile, LoadHeader, 0x40, &dwRead, NULL); - if (memcmp(LoadHeader, g_Rom->GetRomAddress(), 0x40) != 0) - { - //if (inFullScreen) { return false; } - int result = MessageBoxW(NULL, GS(MSG_SAVE_STATE_HEADER), GS(MSG_MSGBOX_TITLE), - MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2); + ReadFile(hSaveFile, &SaveRDRAMSize, sizeof(SaveRDRAMSize), &dwRead, NULL); + //Check header + BYTE LoadHeader[64]; + ReadFile(hSaveFile, LoadHeader, 0x40, &dwRead, NULL); + if (memcmp(LoadHeader, g_Rom->GetRomAddress(), 0x40) != 0) + { + //if (inFullScreen) { return false; } + int result = MessageBoxW(NULL, GS(MSG_SAVE_STATE_HEADER), GS(MSG_MSGBOX_TITLE), + MB_YESNO | MB_ICONQUESTION | MB_DEFBUTTON2); - if (result == IDNO) - return false; - } - Reset(false, true); - m_MMU_VM.UnProtectMemory(0x80000000, 0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); - m_MMU_VM.UnProtectMemory(0xA4000000, 0xA4001FFC); - g_Settings->SaveDword(Game_RDRamSize, SaveRDRAMSize); + if (result == IDNO) + return false; + } + Reset(false, true); + m_MMU_VM.UnProtectMemory(0x80000000, 0x80000000 + g_Settings->LoadDword(Game_RDRamSize) - 4); + m_MMU_VM.UnProtectMemory(0xA4000000, 0xA4001FFC); + g_Settings->SaveDword(Game_RDRamSize, SaveRDRAMSize); - ReadFile(hSaveFile, &NextVITimer, sizeof(NextVITimer), &dwRead, NULL); - ReadFile(hSaveFile, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER), &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_GPR, sizeof(__int64) * 32, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_FPR, sizeof(__int64) * 32, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_CP0, sizeof(DWORD) * 32, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_FPCR, sizeof(DWORD) * 32, &dwRead, NULL); - ReadFile(hSaveFile, &m_Reg.m_HI, sizeof(__int64), &dwRead, NULL); - ReadFile(hSaveFile, &m_Reg.m_LO, sizeof(__int64), &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_Video_Interface, sizeof(DWORD) * 14, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8, &dwRead, NULL); - ReadFile(hSaveFile, m_Reg.m_SerialInterface, sizeof(DWORD) * 4, &dwRead, NULL); - ReadFile(hSaveFile, (void *const)&g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32, &dwRead, NULL); - ReadFile(hSaveFile, m_MMU_VM.PifRam(), 0x40, &dwRead, NULL); - ReadFile(hSaveFile, m_MMU_VM.Rdram(), SaveRDRAMSize, &dwRead, NULL); - ReadFile(hSaveFile, m_MMU_VM.Dmem(), 0x1000, &dwRead, NULL); - ReadFile(hSaveFile, m_MMU_VM.Imem(), 0x1000, &dwRead, NULL); - CloseHandle(hSaveFile); - } + ReadFile(hSaveFile, &NextVITimer, sizeof(NextVITimer), &dwRead, NULL); + ReadFile(hSaveFile, &m_Reg.m_PROGRAM_COUNTER, sizeof(m_Reg.m_PROGRAM_COUNTER), &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_GPR, sizeof(__int64) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_FPR, sizeof(__int64) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_CP0, sizeof(DWORD) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_FPCR, sizeof(DWORD) * 32, &dwRead, NULL); + ReadFile(hSaveFile, &m_Reg.m_HI, sizeof(__int64), &dwRead, NULL); + ReadFile(hSaveFile, &m_Reg.m_LO, sizeof(__int64), &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_RDRAM_Registers, sizeof(DWORD) * 10, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_SigProcessor_Interface, sizeof(DWORD) * 10, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Display_ControlReg, sizeof(DWORD) * 10, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Mips_Interface, sizeof(DWORD) * 4, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Video_Interface, sizeof(DWORD) * 14, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Audio_Interface, sizeof(DWORD) * 6, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_Peripheral_Interface, sizeof(DWORD) * 13, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_RDRAM_Interface, sizeof(DWORD) * 8, &dwRead, NULL); + ReadFile(hSaveFile, m_Reg.m_SerialInterface, sizeof(DWORD) * 4, &dwRead, NULL); + ReadFile(hSaveFile, (void *const)&g_TLB->TlbEntry(0), sizeof(CTLB::TLB_ENTRY) * 32, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.PifRam(), 0x40, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.Rdram(), SaveRDRAMSize, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.Dmem(), 0x1000, &dwRead, NULL); + ReadFile(hSaveFile, m_MMU_VM.Imem(), 0x1000, &dwRead, NULL); + CloseHandle(hSaveFile); + } - //Fix losing audio in certain games with certain plugins - AudioResetOnLoad = g_Settings->LoadBool(Game_AudioResetOnLoad); - if (AudioResetOnLoad) - { - m_Reg.m_AudioIntrReg |= MI_INTR_AI; - m_Reg.AI_STATUS_REG &= ~AI_STATUS_FIFO_FULL; - g_Reg->MI_INTR_REG |= MI_INTR_AI; - } + //Fix losing audio in certain games with certain plugins + AudioResetOnLoad = g_Settings->LoadBool(Game_AudioResetOnLoad); + if (AudioResetOnLoad) + { + m_Reg.m_AudioIntrReg |= MI_INTR_AI; + m_Reg.AI_STATUS_REG &= ~AI_STATUS_FIFO_FULL; + g_Reg->MI_INTR_REG |= MI_INTR_AI; + } - if (bFixedAudio()) - { - m_Audio.SetFrequency(m_Reg.AI_DACRATE_REG, g_System->SystemType()); - } + if (bFixedAudio()) + { + m_Audio.SetFrequency(m_Reg.AI_DACRATE_REG, g_System->SystemType()); + } - if (old_status != g_Reg->VI_STATUS_REG) - { - g_Plugins->Gfx()->ViStatusChanged(); - } + if (old_status != g_Reg->VI_STATUS_REG) + { + g_Plugins->Gfx()->ViStatusChanged(); + } - if (old_width != g_Reg->VI_WIDTH_REG) - { - g_Plugins->Gfx()->ViWidthChanged(); - } + if (old_width != g_Reg->VI_WIDTH_REG) + { + g_Plugins->Gfx()->ViWidthChanged(); + } - if (old_dacrate != g_Reg->AI_DACRATE_REG) - { - g_Plugins->Audio()->DacrateChanged(g_System->SystemType()); - } + 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) - { - m_Reg.RANDOM_REGISTER += 32 - m_Reg.WIRED_REGISTER; - } - //Fix up timer - WriteTrace(TraceDebug, __FUNCTION__ ": 2"); - m_SystemTimer.SetTimer(CSystemTimer::CompareTimer, m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER, false); - m_SystemTimer.SetTimer(CSystemTimer::ViTimer, NextVITimer, false); - m_Reg.FixFpuLocations(); - WriteTrace(TraceDebug, __FUNCTION__ ": 5"); - m_TLB.Reset(false); - WriteTrace(TraceDebug, __FUNCTION__ ": 6"); - m_CPU_Usage.ResetCounters(); - WriteTrace(TraceDebug, __FUNCTION__ ": 7"); - m_Profile.ResetCounters(); - WriteTrace(TraceDebug, __FUNCTION__ ": 8"); - m_FPS.Reset(true); - WriteTrace(TraceDebug, __FUNCTION__ ": 9"); - if (bLogX86Code()) - { - Stop_x86_Log(); - Start_x86_Log(); - } - WriteTrace(TraceDebug, __FUNCTION__ ": Done"); + //Fix Random Register + while ((int)m_Reg.RANDOM_REGISTER < (int)m_Reg.WIRED_REGISTER) + { + m_Reg.RANDOM_REGISTER += 32 - m_Reg.WIRED_REGISTER; + } + //Fix up timer + WriteTrace(TraceDebug, __FUNCTION__ ": 2"); + m_SystemTimer.SetTimer(CSystemTimer::CompareTimer, m_Reg.COMPARE_REGISTER - m_Reg.COUNT_REGISTER, false); + m_SystemTimer.SetTimer(CSystemTimer::ViTimer, NextVITimer, false); + m_Reg.FixFpuLocations(); + WriteTrace(TraceDebug, __FUNCTION__ ": 5"); + m_TLB.Reset(false); + WriteTrace(TraceDebug, __FUNCTION__ ": 6"); + m_CPU_Usage.ResetCounters(); + WriteTrace(TraceDebug, __FUNCTION__ ": 7"); + m_Profile.ResetCounters(); + WriteTrace(TraceDebug, __FUNCTION__ ": 8"); + m_FPS.Reset(true); + WriteTrace(TraceDebug, __FUNCTION__ ": 9"); + if (bLogX86Code()) + { + Stop_x86_Log(); + Start_x86_Log(); + } + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); #ifdef TEST_SP_TRACKING - m_CurrentSP = GPR[29].UW[0]; + m_CurrentSP = GPR[29].UW[0]; #endif - if (bFastSP() && m_Recomp) { m_Recomp->ResetMemoryStackPos(); } + if (bFastSP() && m_Recomp) { m_Recomp->ResetMemoryStackPos(); } - if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) - { - if (m_SyncCPU) - { - for (int i = 0; i < (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i++) - { - m_LastSuccessSyncPC[i] = 0; - } - m_SyncCPU->SetActiveSystem(true); - m_SyncCPU->LoadState(FileNameStr.c_str()); - SetActiveSystem(true); - SyncCPU(m_SyncCPU); - } - } - WriteTrace(TraceDebug, __FUNCTION__ ": 13"); - std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE); - g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str()); - WriteTrace(TraceDebug, __FUNCTION__ ": Done"); - return true; + if (g_Settings->LoadDword(Game_CpuType) == CPU_SyncCores) + { + if (m_SyncCPU) + { + for (int i = 0; i < (sizeof(m_LastSuccessSyncPC) / sizeof(m_LastSuccessSyncPC[0])); i++) + { + m_LastSuccessSyncPC[i] = 0; + } + m_SyncCPU->SetActiveSystem(true); + m_SyncCPU->LoadState(FileNameStr.c_str()); + SetActiveSystem(true); + SyncCPU(m_SyncCPU); + } + } + WriteTrace(TraceDebug, __FUNCTION__ ": 13"); + std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE); + g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str()); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); + return true; } void CN64System::DisplayRSPListCount() { - g_Notify->DisplayMessage(0, stdstr_f("Dlist: %d Alist: %d Unknown: %d", m_DlistCount, m_AlistCount, m_UnknownCount).ToUTF16().c_str()); + g_Notify->DisplayMessage(0, stdstr_f("Dlist: %d Alist: %d Unknown: %d", m_DlistCount, m_AlistCount, m_UnknownCount).ToUTF16().c_str()); } void CN64System::RunRSP() { - WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)", m_Reg.SP_STATUS_REG); - if ((m_Reg.SP_STATUS_REG & SP_STATUS_HALT) == 0) - { - if ((m_Reg.SP_STATUS_REG & SP_STATUS_BROKE) == 0) - { - SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfileAddr = Timer_None*/; + WriteTraceF(TraceRSP, __FUNCTION__ ": Start (SP Status %X)", m_Reg.SP_STATUS_REG); + if ((m_Reg.SP_STATUS_REG & SP_STATUS_HALT) == 0) + { + if ((m_Reg.SP_STATUS_REG & SP_STATUS_BROKE) == 0) + { + SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfileAddr = Timer_None*/; - DWORD Task = 0; - if (m_RspBroke) - { - g_MMU->LW_VAddr(0xA4000FC0, (uint32_t &)Task); - if (Task == 1 && (m_Reg.DPC_STATUS_REG & DPC_STATUS_FREEZE) != 0) - { - WriteTrace(TraceRSP, __FUNCTION__ ": Dlist that is frozen"); - return; - } + DWORD Task = 0; + if (m_RspBroke) + { + g_MMU->LW_VAddr(0xA4000FC0, (uint32_t &)Task); + if (Task == 1 && (m_Reg.DPC_STATUS_REG & DPC_STATUS_FREEZE) != 0) + { + WriteTrace(TraceRSP, __FUNCTION__ ": Dlist that is frozen"); + return; + } - switch (Task) - { - case 1: - WriteTrace(TraceRSP, __FUNCTION__ ": *** Display list ***"); - m_DlistCount += 1; - m_FPS.UpdateDlCounter(); - break; - case 2: - WriteTrace(TraceRSP, __FUNCTION__ ": *** Audio list ***"); - m_AlistCount += 1; - break; - default: - WriteTrace(TraceRSP, __FUNCTION__ ": *** Unknown list ***"); - m_UnknownCount += 1; - break; - } + switch (Task) + { + case 1: + WriteTrace(TraceRSP, __FUNCTION__ ": *** Display list ***"); + m_DlistCount += 1; + m_FPS.UpdateDlCounter(); + break; + case 2: + WriteTrace(TraceRSP, __FUNCTION__ ": *** Audio list ***"); + m_AlistCount += 1; + break; + default: + WriteTrace(TraceRSP, __FUNCTION__ ": *** Unknown list ***"); + m_UnknownCount += 1; + break; + } - if (bShowDListAListCount()) - { - DisplayRSPListCount(); - } - if (bShowCPUPer()) - { - switch (Task) - { - case 1: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Dlist); break; - case 2: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Alist); break; - default: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Unknown); break; - } - } - } + if (bShowDListAListCount()) + { + DisplayRSPListCount(); + } + if (bShowCPUPer()) + { + switch (Task) + { + case 1: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Dlist); break; + case 2: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Alist); break; + default: CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RSP_Unknown); break; + } + } + } - __try - { - WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - starting"); - g_Plugins->RSP()->DoRspCycles(100); - WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - Done"); - } - __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) - { - WriteTrace(TraceError, __FUNCTION__ ": exception generated"); - g_Notify->FatalError(__FUNCTIONW__ L"\nUnknown memory action\n\nEmulation stop"); - } + __try + { + WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - starting"); + g_Plugins->RSP()->DoRspCycles(100); + WriteTrace(TraceRSP, __FUNCTION__ ": do cycles - Done"); + } + __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) + { + WriteTrace(TraceError, __FUNCTION__ ": exception generated"); + g_Notify->FatalError(__FUNCTIONW__ L"\nUnknown memory action\n\nEmulation stop"); + } - if (Task == 1 && bDelayDP() && ((m_Reg.m_GfxIntrReg & MI_INTR_DP) != 0)) - { - g_SystemTimer->SetTimer(CSystemTimer::RSPTimerDlist, 0x1000, false); - m_Reg.m_GfxIntrReg &= ~MI_INTR_DP; - } - if (bShowCPUPer()) { m_CPU_Usage.StartTimer(CPU_UsageAddr); } - //if (bProfiling) { m_Profile.StartTimer(ProfileAddr); } + if (Task == 1 && bDelayDP() && ((m_Reg.m_GfxIntrReg & MI_INTR_DP) != 0)) + { + g_SystemTimer->SetTimer(CSystemTimer::RSPTimerDlist, 0x1000, false); + m_Reg.m_GfxIntrReg &= ~MI_INTR_DP; + } + if (bShowCPUPer()) { m_CPU_Usage.StartTimer(CPU_UsageAddr); } + //if (bProfiling) { m_Profile.StartTimer(ProfileAddr); } - if ((m_Reg.SP_STATUS_REG & SP_STATUS_HALT) == 0 && - (m_Reg.SP_STATUS_REG & SP_STATUS_BROKE) == 0 && - m_Reg.m_RspIntrReg == 0) - { - g_SystemTimer->SetTimer(CSystemTimer::RspTimer, 0x200, false); - m_RspBroke = false; - } - else - { - m_RspBroke = true; - } - WriteTrace(TraceRSP, __FUNCTION__ ": check interrupts"); - g_Reg->CheckInterrupts(); - } - } - WriteTraceF(TraceRSP, __FUNCTION__ ": Done (SP Status %X)", m_Reg.SP_STATUS_REG); + if ((m_Reg.SP_STATUS_REG & SP_STATUS_HALT) == 0 && + (m_Reg.SP_STATUS_REG & SP_STATUS_BROKE) == 0 && + m_Reg.m_RspIntrReg == 0) + { + g_SystemTimer->SetTimer(CSystemTimer::RspTimer, 0x200, false); + m_RspBroke = false; + } + else + { + m_RspBroke = true; + } + WriteTrace(TraceRSP, __FUNCTION__ ": check interrupts"); + g_Reg->CheckInterrupts(); + } + } + WriteTraceF(TraceRSP, __FUNCTION__ ": Done (SP Status %X)", m_Reg.SP_STATUS_REG); } void CN64System::SyncToAudio() { - if (!bSyncToAudio() || !bLimitFPS()) - { - return; - } - SPECIAL_TIMERS CPU_UsageAddr = Timer_None; + if (!bSyncToAudio() || !bLimitFPS()) + { + return; + } + SPECIAL_TIMERS CPU_UsageAddr = Timer_None; - if (bShowCPUPer()) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_Idel); } + if (bShowCPUPer()) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_Idel); } - for (int i = 0; i < 50; i++) - { - if (g_Reg->m_AudioIntrReg != 0) - { - WriteTraceF(TraceAudio, __FUNCTION__ ": Audio Interrupt done (%d)", i); - break; - } - Sleep(1); - } - if (bShowCPUPer()) - { - m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300); - } + for (int i = 0; i < 50; i++) + { + if (g_Reg->m_AudioIntrReg != 0) + { + WriteTraceF(TraceAudio, __FUNCTION__ ": Audio Interrupt done (%d)", i); + break; + } + Sleep(1); + } + if (bShowCPUPer()) + { + m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300); + } } void CN64System::RefreshScreen() { - SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfilingAddr = Timer_None*/; - DWORD VI_INTR_TIME = 500000; + SPECIAL_TIMERS CPU_UsageAddr = Timer_None/*, ProfilingAddr = Timer_None*/; + DWORD VI_INTR_TIME = 500000; - if (bShowCPUPer()) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RefreshScreen); } - //if (bProfiling) { ProfilingAddr = m_Profile.StartTimer(Timer_RefreshScreen); } + if (bShowCPUPer()) { CPU_UsageAddr = m_CPU_Usage.StartTimer(Timer_RefreshScreen); } + //if (bProfiling) { ProfilingAddr = m_Profile.StartTimer(Timer_RefreshScreen); } - //Calculate how many cycles to next refresh - if (m_Reg.VI_V_SYNC_REG == 0) - { - VI_INTR_TIME = 500000; - } - else - { - VI_INTR_TIME = (m_Reg.VI_V_SYNC_REG + 1) * ViRefreshRate(); - if ((m_Reg.VI_V_SYNC_REG % 1) != 0) - { - VI_INTR_TIME -= 38; - } - } - g_SystemTimer->SetTimer(CSystemTimer::ViTimer, VI_INTR_TIME, true); - if (bFixedAudio()) - { - g_Audio->SetViIntr(VI_INTR_TIME); - } - if (g_Plugins->Control()->GetKeys) - { - BUTTONS Keys; - memset(&Keys, 0, sizeof(Keys)); + //Calculate how many cycles to next refresh + if (m_Reg.VI_V_SYNC_REG == 0) + { + VI_INTR_TIME = 500000; + } + else + { + VI_INTR_TIME = (m_Reg.VI_V_SYNC_REG + 1) * ViRefreshRate(); + if ((m_Reg.VI_V_SYNC_REG % 1) != 0) + { + VI_INTR_TIME -= 38; + } + } + g_SystemTimer->SetTimer(CSystemTimer::ViTimer, VI_INTR_TIME, true); + if (bFixedAudio()) + { + g_Audio->SetViIntr(VI_INTR_TIME); + } + if (g_Plugins->Control()->GetKeys) + { + BUTTONS Keys; + memset(&Keys, 0, sizeof(Keys)); - for (int Control = 0; Control < 4; Control++) - { - g_Plugins->Control()->GetKeys(Control, &Keys); - m_Buttons[Control] = Keys.Value; - } - } + for (int Control = 0; Control < 4; Control++) + { + g_Plugins->Control()->GetKeys(Control, &Keys); + m_Buttons[Control] = Keys.Value; + } + } - if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_UpdateScreen); } - // if (bProfiling) { m_Profile.StartTimer(Timer_UpdateScreen); } + if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_UpdateScreen); } + // if (bProfiling) { m_Profile.StartTimer(Timer_UpdateScreen); } - __try - { - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Starting"); - g_Plugins->Gfx()->UpdateScreen(); - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Done"); - } - __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) - { - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Exception caught"); - WriteTrace(TraceError, __FUNCTION__ ": Exception caught"); - } + __try + { + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Starting"); + g_Plugins->Gfx()->UpdateScreen(); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Done"); + } + __except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) + { + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Exception caught"); + WriteTrace(TraceError, __FUNCTION__ ": Exception caught"); + } - g_MMU->UpdateFieldSerration((m_Reg.VI_STATUS_REG & 0x40) != 0); + g_MMU->UpdateFieldSerration((m_Reg.VI_STATUS_REG & 0x40) != 0); - if ((bBasicMode() || bLimitFPS()) && !bSyncToAudio()) - { - if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_Idel); } - uint32_t FrameRate; - if (m_Limitor.Timer_Process(&FrameRate) && bDisplayFrameRate()) - { - m_FPS.DisplayViCounter(FrameRate); - m_bCleanFrameBox = true; - } - } - else if (bDisplayFrameRate()) - { - if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_UpdateFPS); } - m_FPS.UpdateViCounter(); - m_bCleanFrameBox = true; - } + if ((bBasicMode() || bLimitFPS()) && !bSyncToAudio()) + { + if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_Idel); } + uint32_t FrameRate; + if (m_Limitor.Timer_Process(&FrameRate) && bDisplayFrameRate()) + { + m_FPS.DisplayViCounter(FrameRate); + m_bCleanFrameBox = true; + } + } + else if (bDisplayFrameRate()) + { + if (bShowCPUPer()) { m_CPU_Usage.StartTimer(Timer_UpdateFPS); } + m_FPS.UpdateViCounter(); + m_bCleanFrameBox = true; + } - if (m_bCleanFrameBox && !bDisplayFrameRate()) - { - m_FPS.Reset(true); - m_bCleanFrameBox = false; - } + if (m_bCleanFrameBox && !bDisplayFrameRate()) + { + m_FPS.Reset(true); + m_bCleanFrameBox = false; + } - if (bShowCPUPer()) - { - m_CPU_Usage.StopTimer(); - m_CPU_Usage.ShowCPU_Usage(); - m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300); - } - if ((m_Reg.STATUS_REGISTER & STATUS_IE) != 0) - { - if (HasCheatsSlectionChanged()) - { - if (this == g_BaseSystem && g_SyncSystem != NULL) - { - g_SyncSystem->SetCheatsSlectionChanged(true); - } - SetCheatsSlectionChanged(false); - m_Cheats.LoadCheats(false, g_BaseSystem->m_Plugins); - } - m_Cheats.ApplyCheats(g_MMU); - } - // if (bProfiling) { m_Profile.StartTimer(ProfilingAddr != Timer_None ? ProfilingAddr : Timer_R4300); } + if (bShowCPUPer()) + { + m_CPU_Usage.StopTimer(); + m_CPU_Usage.ShowCPU_Usage(); + m_CPU_Usage.StartTimer(CPU_UsageAddr != Timer_None ? CPU_UsageAddr : Timer_R4300); + } + if ((m_Reg.STATUS_REGISTER & STATUS_IE) != 0) + { + if (HasCheatsSlectionChanged()) + { + if (this == g_BaseSystem && g_SyncSystem != NULL) + { + g_SyncSystem->SetCheatsSlectionChanged(true); + } + SetCheatsSlectionChanged(false); + m_Cheats.LoadCheats(false, g_BaseSystem->m_Plugins); + } + m_Cheats.ApplyCheats(g_MMU); + } + // if (bProfiling) { m_Profile.StartTimer(ProfilingAddr != Timer_None ? ProfilingAddr : Timer_R4300); } } bool CN64System::WriteToProtectedMemory(uint32_t Address, int length) { - WriteTraceF(TraceDebug, __FUNCTION__ ": Address: %X Len: %d", Address, length); - if (m_Recomp) - { - g_Notify->BreakPoint(__FILEW__, __LINE__); + WriteTraceF(TraceDebug, __FUNCTION__ ": Address: %X Len: %d", Address, length); + if (m_Recomp) + { + g_Notify->BreakPoint(__FILEW__, __LINE__); #ifdef tofix - return m_Recomp->ClearRecompCode_Phys(Address,length,CRecompiler::Remove_ProtectedMem); + return m_Recomp->ClearRecompCode_Phys(Address,length,CRecompiler::Remove_ProtectedMem); #endif - } - return false; + } + return false; } void CN64System::TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly) { - m_MMU_VM.TLB_Mapped(VAddr, Len, PAddr, bReadOnly); + m_MMU_VM.TLB_Mapped(VAddr, Len, PAddr, bReadOnly); } void CN64System::TLB_Unmaped(uint32_t VAddr, uint32_t Len) { - m_MMU_VM.TLB_Unmaped(VAddr, Len); - if (m_Recomp && bSMM_TLB()) - { - m_Recomp->ClearRecompCode_Virt(VAddr, Len, CRecompiler::Remove_TLB); - } + m_MMU_VM.TLB_Unmaped(VAddr, Len); + if (m_Recomp && bSMM_TLB()) + { + m_Recomp->ClearRecompCode_Virt(VAddr, Len, CRecompiler::Remove_TLB); + } } void CN64System::TLB_Changed() { - if (g_Debugger) - { - g_Debugger->TLBChanged(); - } + if (g_Debugger) + { + g_Debugger->TLBChanged(); + } } \ No newline at end of file diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index 27292a815..123fa1e64 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -21,145 +21,145 @@ class CRecompiler; //#define TEST_SP_TRACKING //track the SP to make sure all ops pick it up fine class CN64System : - public CMipsMemory_CallBack, - public CTLB_CB, - private CSystemEvents, - protected CN64SystemSettings, - public CGameSettings, - protected CDebugSettings + public CMipsMemory_CallBack, + public CTLB_CB, + private CSystemEvents, + protected CN64SystemSettings, + public CGameSettings, + protected CDebugSettings { public: - CN64System(CPlugins * Plugins, bool SavesReadOnly); - virtual ~CN64System(void); + CN64System(CPlugins * Plugins, bool SavesReadOnly); + virtual ~CN64System(void); - struct ThreadInfo { - HANDLE * ThreadHandle; - DWORD ThreadID; - }; + struct ThreadInfo { + HANDLE * ThreadHandle; + DWORD ThreadID; + }; - CProfiling m_Profile; - CCheats m_Cheats; - bool m_EndEmulation; - SAVE_CHIP_TYPE m_SaveUsing; + CProfiling m_Profile; + CCheats m_Cheats; + bool m_EndEmulation; + SAVE_CHIP_TYPE m_SaveUsing; - //Methods - static bool RunFileImage(const char * FileLoc); - static void CloseSystem(void); + //Methods + static bool RunFileImage(const char * FileLoc); + static void CloseSystem(void); - void CloseCpu(); - void ExternalEvent(SystemEvent action); //covers gui interacting and timers etc.. - stdstr ChooseFileToOpen(HWND hParent); - void DisplayRomInfo(HWND hParent); - void StartEmulation(bool NewThread); - void SyncToAudio(); - void IncreaseSpeed() { m_Limitor.IncreaseSpeed(); } - void DecreaseSpeed() { m_Limitor.DecreaseSpeed(); } - void Reset(bool bInitReg, bool ClearMenory); - void GameReset(); - void PluginReset(); + void CloseCpu(); + void ExternalEvent(SystemEvent action); //covers gui interacting and timers etc.. + stdstr ChooseFileToOpen(HWND hParent); + void DisplayRomInfo(HWND hParent); + void StartEmulation(bool NewThread); + void SyncToAudio(); + void IncreaseSpeed() { m_Limitor.IncreaseSpeed(); } + void DecreaseSpeed() { m_Limitor.DecreaseSpeed(); } + void Reset(bool bInitReg, bool ClearMenory); + void GameReset(); + void PluginReset(); - void Pause(); - void RunRSP(); - bool SaveState(); - bool LoadState(LPCSTR FileName); - bool LoadState(); + void Pause(); + void RunRSP(); + bool SaveState(); + bool LoadState(LPCSTR FileName); + bool LoadState(); - bool DmaUsed() const { return m_DMAUsed; } - void SetDmaUsed(bool DMAUsed) { m_DMAUsed = DMAUsed; } - void SetCheatsSlectionChanged(bool changed) { m_CheatsSlectionChanged = changed; } - bool HasCheatsSlectionChanged(void) const { return m_CheatsSlectionChanged; } - DWORD GetButtons(int Control) const { return m_Buttons[Control]; } + bool DmaUsed() const { return m_DMAUsed; } + void SetDmaUsed(bool DMAUsed) { m_DMAUsed = DMAUsed; } + void SetCheatsSlectionChanged(bool changed) { m_CheatsSlectionChanged = changed; } + bool HasCheatsSlectionChanged(void) const { return m_CheatsSlectionChanged; } + DWORD GetButtons(int Control) const { return m_Buttons[Control]; } - //Variable used to track that the SP is being handled and stays the same as the real SP in sync core + //Variable used to track that the SP is being handled and stays the same as the real SP in sync core #ifdef TEST_SP_TRACKING - DWORD m_CurrentSP; + DWORD m_CurrentSP; #endif - //For Sync CPU - void UpdateSyncCPU(CN64System * const SecondCPU, DWORD const Cycles); - void SyncCPU(CN64System * const SecondCPU); - void SyncCPUPC(CN64System * const SecondCPU); - void SyncSystem(); - void SyncSystemPC(); + //For Sync CPU + void UpdateSyncCPU(CN64System * const SecondCPU, DWORD const Cycles); + void SyncCPU(CN64System * const SecondCPU); + void SyncCPUPC(CN64System * const SecondCPU); + void SyncSystem(); + void SyncSystemPC(); private: - //Make sure plugins can directly access this information - friend CGfxPlugin; - friend CAudioPlugin; - friend CRSP_Plugin; - friend CControl_Plugin; + //Make sure plugins can directly access this information + friend CGfxPlugin; + friend CAudioPlugin; + friend CRSP_Plugin; + friend CControl_Plugin; - //Recompiler has access to manipulate and call functions - friend CSystemTimer; + //Recompiler has access to manipulate and call functions + friend CSystemTimer; - //Used for loading and potentially executing the CPU in its own thread. - static void StartEmulationThread(ThreadInfo * Info); - static bool EmulationStarting(HANDLE hThread, DWORD ThreadId); + //Used for loading and potentially executing the CPU in its own thread. + static void StartEmulationThread(ThreadInfo * Info); + static bool EmulationStarting(HANDLE hThread, DWORD ThreadId); - void ExecuteCPU(); - void RefreshScreen(); - void DumpSyncErrors(CN64System * SecondCPU); - void StartEmulation2(bool NewThread); - bool SetActiveSystem(bool bActive = true); - void InitRegisters(bool bPostPif, CMipsMemory & MMU); - void DisplayRSPListCount(); + void ExecuteCPU(); + void RefreshScreen(); + void DumpSyncErrors(CN64System * SecondCPU); + void StartEmulation2(bool NewThread); + bool SetActiveSystem(bool bActive = true); + void InitRegisters(bool bPostPif, CMipsMemory & MMU); + void DisplayRSPListCount(); - //CPU Methods - void ExecuteRecompiler(); - void ExecuteInterpret(); - void ExecuteSyncCPU(); + //CPU Methods + void ExecuteRecompiler(); + void ExecuteInterpret(); + void ExecuteSyncCPU(); - //Mark information saying that the CPU has stopped - void CpuStopped(); + //Mark information saying that the CPU has stopped + void CpuStopped(); - //Function in CMipsMemory_CallBack - virtual bool WriteToProtectedMemory(uint32_t Address, int length); + //Function in CMipsMemory_CallBack + virtual bool WriteToProtectedMemory(uint32_t Address, int length); - //Functions in CTLB_CB - void TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly); - void TLB_Unmaped(uint32_t VAddr, uint32_t Len); - void TLB_Changed(); + //Functions in CTLB_CB + void TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly); + void TLB_Unmaped(uint32_t VAddr, uint32_t Len); + void TLB_Changed(); - CPlugins * const m_Plugins; //The plugin container - CN64System * m_SyncCPU; - CPlugins * m_SyncPlugins; - CMainGui * m_SyncWindow; - CMipsMemoryVM m_MMU_VM; //Memory of the n64 - CTLB m_TLB; - CRegisters m_Reg; - CFramePerSecond m_FPS; - CProfiling m_CPU_Usage; //used to track the cpu usage - CRecompiler * m_Recomp; - CAudio m_Audio; - CSpeedLimitor m_Limitor; - bool m_InReset; - int m_NextTimer; - CSystemTimer m_SystemTimer; - bool m_bCleanFrameBox; - bool m_bInitialized; - bool m_RspBroke; - bool m_DMAUsed; - DWORD m_Buttons[4]; - bool m_TestTimer; - DWORD m_NextInstruction; - DWORD m_JumpToLocation; - uint32_t m_TLBLoadAddress; - uint32_t m_TLBStoreAddress; - DWORD m_SyncCount; - bool m_CheatsSlectionChanged; + CPlugins * const m_Plugins; //The plugin container + CN64System * m_SyncCPU; + CPlugins * m_SyncPlugins; + CMainGui * m_SyncWindow; + CMipsMemoryVM m_MMU_VM; //Memory of the n64 + CTLB m_TLB; + CRegisters m_Reg; + CFramePerSecond m_FPS; + CProfiling m_CPU_Usage; //used to track the cpu usage + CRecompiler * m_Recomp; + CAudio m_Audio; + CSpeedLimitor m_Limitor; + bool m_InReset; + int m_NextTimer; + CSystemTimer m_SystemTimer; + bool m_bCleanFrameBox; + bool m_bInitialized; + bool m_RspBroke; + bool m_DMAUsed; + DWORD m_Buttons[4]; + bool m_TestTimer; + DWORD m_NextInstruction; + DWORD m_JumpToLocation; + uint32_t m_TLBLoadAddress; + uint32_t m_TLBStoreAddress; + DWORD m_SyncCount; + bool m_CheatsSlectionChanged; - //When Syncing cores this is the PC where it last Sync'ed correctly - DWORD m_LastSuccessSyncPC[10]; - int m_CyclesToSkip; + //When Syncing cores this is the PC where it last Sync'ed correctly + DWORD m_LastSuccessSyncPC[10]; + int m_CyclesToSkip; - //Handle to the cpu thread - HANDLE m_CPU_Handle; - DWORD m_CPU_ThreadID; + //Handle to the cpu thread + HANDLE m_CPU_Handle; + DWORD m_CPU_ThreadID; - //Handle to pause mutex - void * m_hPauseEvent; + //Handle to pause mutex + SyncEvent m_hPauseEvent; - //No of Alist and Dlist sent to the RSP - DWORD m_AlistCount, m_DlistCount, m_UnknownCount; + //No of Alist and Dlist sent to the RSP + DWORD m_AlistCount, m_DlistCount, m_UnknownCount; - //list of function that have been called .. used in profiling - FUNC_CALLS m_FunctionCalls; + //list of function that have been called .. used in profiling + FUNC_CALLS m_FunctionCalls; }; From 5888b1d3f69b57be40c1dc733834bee7388d129b Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 18:08:10 +1100 Subject: [PATCH 033/102] [Project64] Change m_hPauseEvent to a sync event --- Source/Project64/N64 System/N64 Class.cpp | 34 ++++++++++------------- Source/Project64/N64 System/N64 Class.h | 2 ++ 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index fb49d3464..70955bda8 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -42,6 +42,7 @@ m_TLBStoreAddress(0), m_SyncCount(0), m_CPU_Handle(NULL), m_CPU_ThreadID(0), +m_hPauseEvent(true), m_CheatsSlectionChanged(false) { DWORD gameHertz = g_Settings->LoadDword(Game_ScreenHertz); @@ -49,7 +50,6 @@ m_CheatsSlectionChanged(false) { gameHertz = (SystemType() == SYSTEM_PAL) ? 50 : 60; } - m_hPauseEvent = CreateEvent(NULL, true, false, NULL); m_Limitor.SetHertz(gameHertz); g_Settings->SaveDword(GameRunning_ScreenHertz, gameHertz); m_Cheats.LoadCheats(!g_Settings->LoadDword(Setting_RememberCheats), Plugins); @@ -123,54 +123,54 @@ void CN64System::ExternalEvent(SystemEvent action) break; case SysEvent_ResumeCPU_FromMenu: // always resume if from menu - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); break; case SysEvent_ResumeCPU_AppGainedFocus: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostFocus) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; case SysEvent_ResumeCPU_AppGainedActive: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_AppLostActive) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; case SysEvent_ResumeCPU_SaveGame: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SaveGame) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; case SysEvent_ResumeCPU_LoadGame: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_LoadGame) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; case SysEvent_ResumeCPU_DumpMemory: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_DumpMemory) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; case SysEvent_ResumeCPU_SearchMemory: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_SearchMemory) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; case SysEvent_ResumeCPU_Settings: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Settings) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; case SysEvent_ResumeCPU_Cheats: if (g_Settings->LoadDword(GameRunning_CPU_PausedType) == PauseType_Cheats) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } break; default: @@ -420,7 +420,7 @@ void CN64System::CloseCpu() m_EndEmulation = true; if (g_Settings->LoadBool(GameRunning_CPU_Paused)) { - SetEvent(m_hPauseEvent); + m_hPauseEvent.Trigger(); } if (GetCurrentThreadId() == m_CPU_ThreadID) @@ -474,12 +474,12 @@ void CN64System::Pause() { return; } - ResetEvent(m_hPauseEvent); + m_hPauseEvent.Reset(); g_Settings->SaveBool(GameRunning_CPU_Paused, true); Notify().RefreshMenu(); g_Notify->DisplayMessage(5, MSG_CPU_PAUSED); - WaitForSingleObject(m_hPauseEvent, INFINITE); - ResetEvent(m_hPauseEvent); + m_hPauseEvent.IsTriggered(SyncEvent::INFINITE_TIMEOUT); + m_hPauseEvent.Reset(); g_Settings->SaveBool(GameRunning_CPU_Paused, (DWORD)false); Notify().RefreshMenu(); Notify().DisplayMessage(5, MSG_CPU_RESUMED); @@ -946,12 +946,6 @@ void CN64System::CpuStopped() Notify().WindowMode(); if (!m_InReset) { - if (m_hPauseEvent) - { - CloseHandle(m_hPauseEvent); - m_hPauseEvent = NULL; - } - Notify().RefreshMenu(); Notify().MakeWindowOnTop(false); g_Notify->DisplayMessage(5, MSG_EMULATION_ENDED); diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index 123fa1e64..95b6d6606 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -10,6 +10,8 @@ ****************************************************************************/ #pragma once +#include + typedef std::list EVENT_LIST; typedef std::map FUNC_CALLS; From efa3c87de720e6db4be5e5ede1708a0021827103 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 19:43:32 +1100 Subject: [PATCH 034/102] {Project64] Tabs to spaces in Plugin List.cpp --- Source/Project64/Plugins/Plugin List.cpp | 211 +++++++++++------------ Source/Project64/Plugins/Plugin List.h | 50 ++++-- 2 files changed, 136 insertions(+), 125 deletions(-) diff --git a/Source/Project64/Plugins/Plugin List.cpp b/Source/Project64/Plugins/Plugin List.cpp index 244492e76..725ad27a7 100644 --- a/Source/Project64/Plugins/Plugin List.cpp +++ b/Source/Project64/Plugins/Plugin List.cpp @@ -12,12 +12,12 @@ #include CPluginList::CPluginList(bool bAutoFill /* = true */) : - m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin),"") +m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin), "") { - if (bAutoFill) - { - LoadList(); - } + if (bAutoFill) + { + LoadList(); + } } CPluginList::~CPluginList() @@ -26,123 +26,122 @@ CPluginList::~CPluginList() int CPluginList::GetPluginCount() const { - return m_PluginList.size(); + return m_PluginList.size(); } -const CPluginList::PLUGIN * CPluginList::GetPluginInfo ( int indx ) const +const CPluginList::PLUGIN * CPluginList::GetPluginInfo(int indx) const { - if (indx < 0 || indx >= (int)m_PluginList.size()) - { - return NULL; - } - return &m_PluginList[indx]; - + if (indx < 0 || indx >= (int)m_PluginList.size()) + { + return NULL; + } + return &m_PluginList[indx]; } bool CPluginList::LoadList() { - WriteTrace(TraceDebug,__FUNCTION__ ": Start"); - m_PluginList.clear(); - AddPluginFromDir(m_PluginDir); - WriteTrace(TraceDebug,__FUNCTION__ ": Done"); - return true; + WriteTrace(TraceDebug, __FUNCTION__ ": Start"); + m_PluginList.clear(); + AddPluginFromDir(m_PluginDir); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); + return true; } -void CPluginList::AddPluginFromDir ( CPath Dir) +void CPluginList::AddPluginFromDir(CPath Dir) { - Dir.SetNameExtension("*.*"); - if (Dir.FindFirst(_A_SUBDIR)) - { - do { - AddPluginFromDir(Dir); - } while (Dir.FindNext()); - Dir.UpDirectory(); - } + Dir.SetNameExtension("*.*"); + if (Dir.FindFirst(_A_SUBDIR)) + { + do { + AddPluginFromDir(Dir); + } while (Dir.FindNext()); + Dir.UpDirectory(); + } - Dir.SetNameExtension("*.dll"); - if (Dir.FindFirst()) - { - HMODULE hLib = NULL; - do { - if (hLib) - { - FreeLibrary(hLib); - hLib = NULL; - } + Dir.SetNameExtension("*.dll"); + if (Dir.FindFirst()) + { + HMODULE hLib = NULL; + do { + if (hLib) + { + FreeLibrary(hLib); + hLib = NULL; + } - //UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS ); - WriteTraceF(TraceDebug,__FUNCTION__ ": loading %s",(LPCSTR)Dir); - hLib = LoadLibrary(Dir); - //SetErrorMode(LastErrorMode); + //UINT LastErrorMode = SetErrorMode( SEM_FAILCRITICALERRORS ); + WriteTraceF(TraceDebug, __FUNCTION__ ": loading %s", (LPCSTR)Dir); + hLib = LoadLibrary(Dir); + //SetErrorMode(LastErrorMode); - if (hLib == NULL) - { - DWORD LoadError = GetLastError(); - WriteTraceF(TraceDebug, __FUNCTION__ ": failed to loadi %s (error: %d)", (LPCSTR)Dir, LoadError); - continue; - } + if (hLib == NULL) + { + DWORD LoadError = GetLastError(); + WriteTraceF(TraceDebug, __FUNCTION__ ": failed to loadi %s (error: %d)", (LPCSTR)Dir, LoadError); + continue; + } - void (__cdecl *GetDllInfo) ( PLUGIN_INFO * PluginInfo ); - GetDllInfo = (void (__cdecl *)(PLUGIN_INFO *))GetProcAddress( hLib, "GetDllInfo" ); - if (GetDllInfo == NULL) - { - continue; - } - - PLUGIN Plugin = { 0 }; - Plugin.Info.MemoryBswaped = true; - GetDllInfo(&Plugin.Info); - if (!ValidPluginVersion(Plugin.Info)) - { - continue; - } + void(__cdecl *GetDllInfo) (PLUGIN_INFO * PluginInfo); + GetDllInfo = (void(__cdecl *)(PLUGIN_INFO *))GetProcAddress(hLib, "GetDllInfo"); + if (GetDllInfo == NULL) + { + continue; + } - Plugin.FullPath = Dir; - std::string& fullPath = Dir; - std::string& pluginPath = m_PluginDir; - Plugin.FileName = fullPath.substr(pluginPath.length()); + PLUGIN Plugin = { 0 }; + Plugin.Info.MemoryBswaped = true; + GetDllInfo(&Plugin.Info); + if (!ValidPluginVersion(Plugin.Info)) + { + continue; + } - if (GetProcAddress(hLib,"DllAbout") != NULL) - { - Plugin.AboutFunction = true; - } - m_PluginList.push_back(Plugin); - } while (Dir.FindNext()); + Plugin.FullPath = Dir; + std::string& fullPath = Dir; + std::string& pluginPath = m_PluginDir; + Plugin.FileName = fullPath.substr(pluginPath.length()); - if (hLib) - { - FreeLibrary(hLib); - hLib = NULL; - } - } + if (GetProcAddress(hLib, "DllAbout") != NULL) + { + Plugin.AboutFunction = true; + } + m_PluginList.push_back(Plugin); + } while (Dir.FindNext()); + + if (hLib) + { + FreeLibrary(hLib); + hLib = NULL; + } + } } -bool CPluginList::ValidPluginVersion ( PLUGIN_INFO & PluginInfo ) { - switch (PluginInfo.Type) - { - case PLUGIN_TYPE_RSP: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0001) { return true; } - if (PluginInfo.Version == 0x0100) { return true; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - case PLUGIN_TYPE_GFX: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0102) { return true; } - if (PluginInfo.Version == 0x0103) { return true; } - if (PluginInfo.Version == 0x0104) { return true; } - break; - case PLUGIN_TYPE_AUDIO: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - case PLUGIN_TYPE_CONTROLLER: - if (PluginInfo.Version == 0x0100) { return true; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - } - return FALSE; -} +bool CPluginList::ValidPluginVersion(PLUGIN_INFO & PluginInfo) { + switch (PluginInfo.Type) + { + case PLUGIN_TYPE_RSP: + if (!PluginInfo.MemoryBswaped) { return false; } + if (PluginInfo.Version == 0x0001) { return true; } + if (PluginInfo.Version == 0x0100) { return true; } + if (PluginInfo.Version == 0x0101) { return true; } + if (PluginInfo.Version == 0x0102) { return true; } + break; + case PLUGIN_TYPE_GFX: + if (!PluginInfo.MemoryBswaped) { return false; } + if (PluginInfo.Version == 0x0102) { return true; } + if (PluginInfo.Version == 0x0103) { return true; } + if (PluginInfo.Version == 0x0104) { return true; } + break; + case PLUGIN_TYPE_AUDIO: + if (!PluginInfo.MemoryBswaped) { return false; } + if (PluginInfo.Version == 0x0101) { return true; } + if (PluginInfo.Version == 0x0102) { return true; } + break; + case PLUGIN_TYPE_CONTROLLER: + if (PluginInfo.Version == 0x0100) { return true; } + if (PluginInfo.Version == 0x0101) { return true; } + if (PluginInfo.Version == 0x0102) { return true; } + break; + } + return FALSE; +} \ No newline at end of file diff --git a/Source/Project64/Plugins/Plugin List.h b/Source/Project64/Plugins/Plugin List.h index 17edd39c3..ae67c6805 100644 --- a/Source/Project64/Plugins/Plugin List.h +++ b/Source/Project64/Plugins/Plugin List.h @@ -1,30 +1,42 @@ -#include "..\\Settings.h" +/**************************************************************************** +* * +* Project64 - A Nintendo 64 emulator. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2012 Project64. All rights reserved. * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* * +****************************************************************************/ +#pragma once -class CPluginList +#include + +class CPluginList { public: - typedef struct - { - PLUGIN_INFO Info; - bool AboutFunction; - CPath FullPath; - stdstr FileName; - } PLUGIN; + typedef struct + { + PLUGIN_INFO Info; + bool AboutFunction; + CPath FullPath; + stdstr FileName; + } PLUGIN; public: - CPluginList(bool bAutoFill = true); - ~CPluginList(); + CPluginList(bool bAutoFill = true); + ~CPluginList(); - bool LoadList ( void ); - int GetPluginCount ( void ) const; - const PLUGIN * GetPluginInfo ( int indx ) const; - static bool ValidPluginVersion ( PLUGIN_INFO & PluginInfo ); + bool LoadList(void); + int GetPluginCount(void) const; + const PLUGIN * GetPluginInfo(int indx) const; + static bool ValidPluginVersion(PLUGIN_INFO & PluginInfo); private: - typedef std::vector PluginList; + typedef std::vector PluginList; - PluginList m_PluginList; - CPath m_PluginDir; + PluginList m_PluginList; + CPath m_PluginDir; - void AddPluginFromDir(CPath Dir); + void AddPluginFromDir(CPath Dir); }; From 69383fcc7e80fcca8fb071302b122a4291c09b26 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 20:15:49 +1100 Subject: [PATCH 035/102] [Project64] remove ValidPluginVersion from Plugin List.cpp --- Source/Project64/Plugins/Plugin List.cpp | 38 +++--------------------- Source/Project64/Plugins/Plugin List.h | 3 +- 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/Source/Project64/Plugins/Plugin List.cpp b/Source/Project64/Plugins/Plugin List.cpp index 725ad27a7..73aaa4f52 100644 --- a/Source/Project64/Plugins/Plugin List.cpp +++ b/Source/Project64/Plugins/Plugin List.cpp @@ -10,6 +10,8 @@ ****************************************************************************/ #include "stdafx.h" #include +#include "Plugin List.h" +#include CPluginList::CPluginList(bool bAutoFill /* = true */) : m_PluginDir(g_Settings->LoadStringVal(Directory_Plugin), "") @@ -91,15 +93,13 @@ void CPluginList::AddPluginFromDir(CPath Dir) PLUGIN Plugin = { 0 }; Plugin.Info.MemoryBswaped = true; GetDllInfo(&Plugin.Info); - if (!ValidPluginVersion(Plugin.Info)) + if (!CPlugin::ValidPluginVersion(Plugin.Info)) { continue; } Plugin.FullPath = Dir; - std::string& fullPath = Dir; - std::string& pluginPath = m_PluginDir; - Plugin.FileName = fullPath.substr(pluginPath.length()); + Plugin.FileName = stdstr((const char *)Dir).substr(strlen(m_PluginDir)); if (GetProcAddress(hLib, "DllAbout") != NULL) { @@ -115,33 +115,3 @@ void CPluginList::AddPluginFromDir(CPath Dir) } } } - -bool CPluginList::ValidPluginVersion(PLUGIN_INFO & PluginInfo) { - switch (PluginInfo.Type) - { - case PLUGIN_TYPE_RSP: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0001) { return true; } - if (PluginInfo.Version == 0x0100) { return true; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - case PLUGIN_TYPE_GFX: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0102) { return true; } - if (PluginInfo.Version == 0x0103) { return true; } - if (PluginInfo.Version == 0x0104) { return true; } - break; - case PLUGIN_TYPE_AUDIO: - if (!PluginInfo.MemoryBswaped) { return false; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - case PLUGIN_TYPE_CONTROLLER: - if (PluginInfo.Version == 0x0100) { return true; } - if (PluginInfo.Version == 0x0101) { return true; } - if (PluginInfo.Version == 0x0102) { return true; } - break; - } - return FALSE; -} \ No newline at end of file diff --git a/Source/Project64/Plugins/Plugin List.h b/Source/Project64/Plugins/Plugin List.h index ae67c6805..f1ee46064 100644 --- a/Source/Project64/Plugins/Plugin List.h +++ b/Source/Project64/Plugins/Plugin List.h @@ -10,7 +10,7 @@ ****************************************************************************/ #pragma once -#include +#include class CPluginList { @@ -30,7 +30,6 @@ public: bool LoadList(void); int GetPluginCount(void) const; const PLUGIN * GetPluginInfo(int indx) const; - static bool ValidPluginVersion(PLUGIN_INFO & PluginInfo); private: typedef std::vector PluginList; From 93c76fe7dc78fd855ee7f21c3cfa4dc49a099ff4 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 21:08:47 +1100 Subject: [PATCH 036/102] [Project64] Create RenderWindow interface --- Source/Project64/N64 System/N64 Class.cpp | 27 +- Source/Project64/N64 System/N64 Class.h | 1 - Source/Project64/Plugins/Audio Plugin.cpp | 4 +- Source/Project64/Plugins/Audio Plugin.h | 3 +- .../Project64/Plugins/Controller Plugin.cpp | 6 +- Source/Project64/Plugins/Controller Plugin.h | 3 +- Source/Project64/Plugins/GFX plugin.cpp | 6 +- Source/Project64/Plugins/GFX plugin.h | 3 +- Source/Project64/Plugins/Plugin Class.cpp | 30 +- Source/Project64/Plugins/Plugin Class.h | 18 +- Source/Project64/User Interface/Gui Class.cpp | 1743 ++++++++--------- Source/Project64/User Interface/Gui Class.h | 7 +- .../User Interface/Notification Class.cpp | 515 +++-- 13 files changed, 1177 insertions(+), 1189 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 70955bda8..b222b9958 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -22,7 +22,6 @@ m_SaveUsing((SAVE_CHIP_TYPE)g_Settings->LoadDword(Game_SaveChip)), m_Plugins(Plugins), m_SyncCPU(NULL), m_SyncPlugins(NULL), -m_SyncWindow(NULL), m_MMU_VM(this, SavesReadOnly), m_TLB(this), m_Reg(this, this), @@ -75,11 +74,6 @@ CN64System::~CN64System() delete m_SyncPlugins; m_SyncPlugins = NULL; } - if (m_SyncWindow) - { - delete m_SyncWindow; - m_SyncWindow = NULL; - } } void CN64System::ExternalEvent(SystemEvent action) @@ -269,10 +263,7 @@ bool CN64System::EmulationStarting(HANDLE hThread, DWORD ThreadId) } catch (...) { - WriteTraceF(TraceError, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); - char Message[600]; - sprintf(Message, __FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); - MessageBox(NULL, Message, "Exception", MB_OK); + g_Notify->DisplayError(stdstr_f(__FUNCTION__ ": Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__).ToUTF16().c_str()); } } else @@ -313,17 +304,15 @@ void CN64System::StartEmulation2(bool NewThread) if (CpuType == CPU_SyncCores) { + if (g_Plugins->SyncWindow() == NULL) + { + g_Notify->BreakPoint(__FILEW__, __LINE__); + } g_Notify->DisplayMessage(5, L"Copy Plugins"); g_Plugins->CopyPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); -#if defined(WINDOWS_UI) - m_SyncWindow = new CMainGui(false); m_SyncPlugins = new CPlugins(g_Settings->LoadStringVal(Directory_PluginSync)); - m_SyncPlugins->SetRenderWindows(m_SyncWindow, m_SyncWindow); - + m_SyncPlugins->SetRenderWindows(g_Plugins->SyncWindow(), NULL); m_SyncCPU = new CN64System(m_SyncPlugins, true); -#else - g_Notify -> BreakPoint(__FILEW__, __LINE__); -#endif } if (CpuType == CPU_Recompiler || CpuType == CPU_SyncCores) @@ -1158,7 +1147,7 @@ void CN64System::DumpSyncErrors(CN64System * SecondCPU) Error.Log("Register, Recompiler, Interpter\r\n"); #ifdef TEST_SP_TRACKING if (m_CurrentSP != GPR[29].UW[0]) { - Error.Log("m_CurrentSP,%X,%X\r\n",m_CurrentSP,GPR[29].UW[0]); + Error.Log("m_CurrentSP,%X,%X\r\n", m_CurrentSP, GPR[29].UW[0]); } #endif if (m_Reg.m_PROGRAM_COUNTER != SecondCPU->m_Reg.m_PROGRAM_COUNTER) { @@ -2058,7 +2047,7 @@ bool CN64System::WriteToProtectedMemory(uint32_t Address, int length) { g_Notify->BreakPoint(__FILEW__, __LINE__); #ifdef tofix - return m_Recomp->ClearRecompCode_Phys(Address,length,CRecompiler::Remove_ProtectedMem); + return m_Recomp->ClearRecompCode_Phys(Address, length, CRecompiler::Remove_ProtectedMem); #endif } return false; diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index 95b6d6606..b703e1861 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -123,7 +123,6 @@ private: CPlugins * const m_Plugins; //The plugin container CN64System * m_SyncCPU; CPlugins * m_SyncPlugins; - CMainGui * m_SyncWindow; CMipsMemoryVM m_MMU_VM; //Memory of the n64 CTLB m_TLB; CRegisters m_Reg; diff --git a/Source/Project64/Plugins/Audio Plugin.cpp b/Source/Project64/Plugins/Audio Plugin.cpp index 618fcee12..2d229cfee 100644 --- a/Source/Project64/Plugins/Audio Plugin.cpp +++ b/Source/Project64/Plugins/Audio Plugin.cpp @@ -51,7 +51,7 @@ bool CAudioPlugin::LoadFunctions(void) return true; } -bool CAudioPlugin::Initiate(CN64System * System, CMainGui * RenderWindow) +bool CAudioPlugin::Initiate(CN64System * System, RenderWindow * Window) { struct AUDIO_INFO { @@ -88,7 +88,7 @@ bool CAudioPlugin::Initiate(CN64System * System, CMainGui * RenderWindow) AUDIO_INFO Info = { 0 }; - Info.hwnd = (HWND)RenderWindow->m_hMainWindow;; + Info.hwnd = (HWND)Window->GetWindowHandle(); Info.hinst = GetModuleHandle(NULL); Info.MemoryBswaped = TRUE; Info.CheckInterrupts = DummyCheckInterrupts; diff --git a/Source/Project64/Plugins/Audio Plugin.h b/Source/Project64/Plugins/Audio Plugin.h index bd53392d4..1890986f5 100644 --- a/Source/Project64/Plugins/Audio Plugin.h +++ b/Source/Project64/Plugins/Audio Plugin.h @@ -9,6 +9,7 @@ * * ****************************************************************************/ #pragma once +#include "Plugin Base.h" class CAudioPlugin : public CPlugin { @@ -17,7 +18,7 @@ public: ~CAudioPlugin(); void DacrateChanged(SYSTEM_TYPE Type); - bool Initiate(CN64System * System, CMainGui * RenderWindow); + bool Initiate(CN64System * System, RenderWindow * Window); void(__cdecl *AiLenChanged)(void); uint32_t(__cdecl *AiReadLength)(void); diff --git a/Source/Project64/Plugins/Controller Plugin.cpp b/Source/Project64/Plugins/Controller Plugin.cpp index dc0810b0d..35bb21f6c 100644 --- a/Source/Project64/Plugins/Controller Plugin.cpp +++ b/Source/Project64/Plugins/Controller Plugin.cpp @@ -58,7 +58,7 @@ bool CControl_Plugin::LoadFunctions(void) return true; } -bool CControl_Plugin::Initiate(CN64System * System, CMainGui * RenderWindow) +bool CControl_Plugin::Initiate(CN64System * System, RenderWindow * Window) { for (int32_t i = 0; i < 4; i++) { @@ -74,7 +74,7 @@ bool CControl_Plugin::Initiate(CN64System * System, CMainGui * RenderWindow) void(__cdecl *InitiateControllers_1_0)(HWND hMainWindow, CONTROL Controls[4]); InitiateControllers_1_0 = (void(__cdecl *)(HWND, CONTROL *))GetProcAddress((HMODULE)m_hDll, "InitiateControllers"); if (InitiateControllers_1_0 == NULL) { return false; } - InitiateControllers_1_0((HWND)RenderWindow->m_hMainWindow,m_PluginControllers); + InitiateControllers_1_0((HWND)Window->GetWindowHandle(),m_PluginControllers); m_Initialized = true; } else if (m_PluginInfo.Version >= 0x0101) @@ -104,7 +104,7 @@ bool CControl_Plugin::Initiate(CN64System * System, CMainGui * RenderWindow) ControlInfo.Controls = m_PluginControllers; ControlInfo.HEADER = (System == NULL ? Buffer : g_Rom->GetRomAddress()); ControlInfo.hinst = GetModuleHandle(NULL); - ControlInfo.hMainWindow = (HWND)RenderWindow->m_hMainWindow; + ControlInfo.hMainWindow = (HWND)Window->GetWindowHandle(); ControlInfo.MemoryBswaped = TRUE; InitiateControllers_1_1(&ControlInfo); diff --git a/Source/Project64/Plugins/Controller Plugin.h b/Source/Project64/Plugins/Controller Plugin.h index 5ac28657e..2613fbdb1 100644 --- a/Source/Project64/Plugins/Controller Plugin.h +++ b/Source/Project64/Plugins/Controller Plugin.h @@ -9,6 +9,7 @@ * * ****************************************************************************/ #pragma once +#include "Plugin Base.h" #pragma warning(push) #pragma warning(disable : 4201) // warning C4201: nonstandard extension used : nameless struct/union @@ -87,7 +88,7 @@ public: CControl_Plugin(void); ~CControl_Plugin(); - bool Initiate(CN64System * System, CMainGui * RenderWindow); + bool Initiate(CN64System * System, RenderWindow * Window); void SetControl(CControl_Plugin const * const Plugin); void UpdateKeys(void); diff --git a/Source/Project64/Plugins/GFX plugin.cpp b/Source/Project64/Plugins/GFX plugin.cpp index b08397a3f..199f716b9 100644 --- a/Source/Project64/Plugins/GFX plugin.cpp +++ b/Source/Project64/Plugins/GFX plugin.cpp @@ -93,7 +93,7 @@ bool CGfxPlugin::LoadFunctions(void) return true; } -bool CGfxPlugin::Initiate(CN64System * System, CMainGui * RenderWindow) +bool CGfxPlugin::Initiate(CN64System * System, RenderWindow * Window) { if (m_Initialized) { @@ -153,8 +153,8 @@ bool CGfxPlugin::Initiate(CN64System * System, CMainGui * RenderWindow) GFX_INFO Info = { 0 }; Info.MemoryBswaped = TRUE; - Info.hWnd = (HWND)RenderWindow->m_hMainWindow; - Info.hStatusBar = (HWND)RenderWindow->m_hStatusWnd; + Info.hWnd = (HWND)Window->GetWindowHandle(); + Info.hStatusBar = (HWND)Window->GetStatusBar(); Info.CheckInterrupts = DummyCheckInterrupts; // We are initializing the plugin before any rom is loaded so we do not have any correct diff --git a/Source/Project64/Plugins/GFX plugin.h b/Source/Project64/Plugins/GFX plugin.h index 8f5f7a4d4..7deb1dc6c 100644 --- a/Source/Project64/Plugins/GFX plugin.h +++ b/Source/Project64/Plugins/GFX plugin.h @@ -9,6 +9,7 @@ * * ****************************************************************************/ #pragma once +#include "Plugin Base.h" class CGfxPlugin : public CPlugin { @@ -52,7 +53,7 @@ public: ~CGfxPlugin(); bool LoadFunctions(void); - bool Initiate(CN64System * System, CMainGui * RenderWindow); + bool Initiate(CN64System * System, RenderWindow * Window); void(__cdecl *CaptureScreen) (const char *); void(__cdecl *ChangeWindow) (void); diff --git a/Source/Project64/Plugins/Plugin Class.cpp b/Source/Project64/Plugins/Plugin Class.cpp index 30a5d291d..e614eed90 100644 --- a/Source/Project64/Plugins/Plugin Class.cpp +++ b/Source/Project64/Plugins/Plugin Class.cpp @@ -9,9 +9,12 @@ * * ****************************************************************************/ #include "stdafx.h" +#include +#include "Plugin Class.h" CPlugins::CPlugins(const stdstr & PluginDir) : - m_RenderWindow(NULL), m_DummyWindow(NULL), +m_MainWindow(NULL), +m_SyncWindow(NULL), m_PluginDir(PluginDir), m_Gfx(NULL), m_Audio(NULL), @@ -215,10 +218,10 @@ void CPlugins::DestroyControlPlugin(void) // g_Settings->UnknownSetting_CTRL = NULL; } -void CPlugins::SetRenderWindows( CMainGui * RenderWindow, CMainGui * DummyWindow ) +void CPlugins::SetRenderWindows(RenderWindow * MainWindow, RenderWindow * SyncWindow) { - m_RenderWindow = RenderWindow; - m_DummyWindow = DummyWindow; + m_MainWindow = MainWindow; + m_SyncWindow = SyncWindow; } void CPlugins::RomOpened(void) @@ -247,13 +250,13 @@ bool CPlugins::Initiate(CN64System * System) if (m_Control == NULL) { return false; } WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Gfx Initiate Starting"); - if (!m_Gfx->Initiate(System,m_RenderWindow)) { return false; } + if (!m_Gfx->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Gfx Initiate Done"); WriteTrace(TraceDebug, __FUNCTION__ ": Audio Initiate Starting"); - if (!m_Audio->Initiate(System,m_RenderWindow)) { return false; } + if (!m_Audio->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceDebug, __FUNCTION__ ": Audio Initiate Done"); WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Starting"); - if (!m_Control->Initiate(System,m_RenderWindow)) { return false; } + if (!m_Control->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Done"); WriteTrace(TraceRSP, __FUNCTION__ ": RSP Initiate Starting"); if (!m_RSP->Initiate(this, System)) { return false; } @@ -264,12 +267,7 @@ 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 + return m_MainWindow->ResetPluginsInUiThread(this, System); } bool CPlugins::Reset(CN64System * System) @@ -295,19 +293,19 @@ bool CPlugins::Reset(CN64System * System) if (m_Gfx && bGfxChange) { WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Gfx Initiate Starting"); - if (!m_Gfx->Initiate(System,m_RenderWindow)) { return false; } + if (!m_Gfx->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Gfx Initiate Done"); } if (m_Audio && bAudioChange) { WriteTrace(TraceDebug, __FUNCTION__ ": Audio Initiate Starting"); - if (!m_Audio->Initiate(System,m_RenderWindow)) { return false; } + if (!m_Audio->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceDebug, __FUNCTION__ ": Audio Initiate Done"); } if (m_Control && bContChange) { WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Starting"); - if (!m_Control->Initiate(System,m_RenderWindow)) { return false; } + if (!m_Control->Initiate(System, m_MainWindow)) { return false; } WriteTrace(TraceDebug, __FUNCTION__ ": Control Initiate Done"); } if (m_RSP && bRspChange) diff --git a/Source/Project64/Plugins/Plugin Class.h b/Source/Project64/Plugins/Plugin Class.h index 21c761293..f0acbc5de 100644 --- a/Source/Project64/Plugins/Plugin Class.h +++ b/Source/Project64/Plugins/Plugin Class.h @@ -81,8 +81,16 @@ enum PLUGIN_TYPE }; class CSettings; -class CMainGui; class CGfxPlugin; class CAudioPlugin; class CRSP_Plugin; class CControl_Plugin; +class CN64System; +class CPlugins; + +__interface RenderWindow +{ + bool ResetPluginsInUiThread(CPlugins * plugins, CN64System * System) = 0; + void * GetWindowHandle(void) const = 0; + void * GetStatusBar(void) const = 0; +}; class CPlugins : private CDebugSettings @@ -95,7 +103,7 @@ public: bool Initiate(CN64System * System); void RomOpened(void); void RomClosed(void); - void SetRenderWindows ( CMainGui * RenderWindow, CMainGui * DummyWindow ); + void SetRenderWindows(RenderWindow * MainWindow, RenderWindow * SyncWindow); void ConfigPlugin(uint32_t hParent, PLUGIN_TYPE Type); bool CopyPlugins(const stdstr & DstDir) const; void CreatePlugins(void); @@ -108,6 +116,8 @@ public: inline CRSP_Plugin * RSP(void) const { return m_RSP; } inline CControl_Plugin * Control(void) const { return m_Control; } + inline RenderWindow * MainWindow(void) const { return m_MainWindow; } + inline RenderWindow * SyncWindow(void) const { return m_SyncWindow; } private: CPlugins(void); // Disable default constructor @@ -121,8 +131,8 @@ private: static void PluginChanged(CPlugins * _this); - CMainGui * m_RenderWindow; - CMainGui * m_DummyWindow; + RenderWindow * m_MainWindow; + RenderWindow * m_SyncWindow; stdstr const m_PluginDir; diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index f1ba42901..ee2394dbb 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -32,1072 +32,1071 @@ m_MakingVisible(false), m_ResetPlugins(false), m_ResetInfo(NULL) { - m_Menu = NULL; + m_Menu = NULL; - m_hMainWindow = 0; - m_hStatusWnd = 0; - m_SaveMainWindowPos = false; - m_SaveMainWindowTop = 0; - m_SaveMainWindowLeft = 0; + m_hMainWindow = 0; + m_hStatusWnd = 0; + m_SaveMainWindowPos = false; + m_SaveMainWindowTop = 0; + m_SaveMainWindowLeft = 0; - m_SaveRomBrowserPos = false; - m_SaveRomBrowserTop = 0; - m_SaveRomBrowserLeft = 0; + m_SaveRomBrowserPos = false; + m_SaveRomBrowserTop = 0; + m_SaveRomBrowserLeft = 0; - if (m_bMainWindow) - { - g_Settings->RegisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged); - g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); - g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); - } + if (m_bMainWindow) + { + g_Settings->RegisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged); + g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); + g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); + } - //if this fails then it has already been created - RegisterWinClass(); - Create(WindowTitle); + //if this fails then it has already been created + RegisterWinClass(); + Create(WindowTitle); } CMainGui::~CMainGui(void) { - WriteTrace(TraceDebug, __FUNCTION__ ": Start"); - if (m_bMainWindow) - { - g_Settings->UnregisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged); - g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); - g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); - } - if (m_hMainWindow) - { - DestroyWindow(m_hMainWindow); - } - WriteTrace(TraceDebug, __FUNCTION__ ": Done"); + WriteTrace(TraceDebug, __FUNCTION__ ": Start"); + if (m_bMainWindow) + { + g_Settings->UnregisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged); + g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); + g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); + } + if (m_hMainWindow) + { + DestroyWindow(m_hMainWindow); + } + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); } bool CMainGui::RegisterWinClass(void) { - stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR); + stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR); - WNDCLASS wcl; + WNDCLASS wcl; - wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; - wcl.cbClsExtra = 0; - wcl.cbWndExtra = 0; - wcl.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_PJ64_Icon)); - wcl.hCursor = LoadCursor(NULL, IDC_ARROW); - wcl.hInstance = GetModuleHandle(NULL); + wcl.style = CS_OWNDC | CS_HREDRAW | CS_VREDRAW; + wcl.cbClsExtra = 0; + wcl.cbWndExtra = 0; + wcl.hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_PJ64_Icon)); + wcl.hCursor = LoadCursor(NULL, IDC_ARROW); + wcl.hInstance = GetModuleHandle(NULL); - wcl.lpfnWndProc = (WNDPROC)MainGui_Proc; - wcl.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); - wcl.lpszMenuName = NULL; - wcl.lpszClassName = VersionDisplay.c_str(); - if (RegisterClass(&wcl) == 0) return false; - return true; + wcl.lpfnWndProc = (WNDPROC)MainGui_Proc; + wcl.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); + wcl.lpszMenuName = NULL; + wcl.lpszClassName = VersionDisplay.c_str(); + if (RegisterClass(&wcl) == 0) return false; + return true; } - void RomBowserEnabledChanged(CMainGui * Gui) { - if (Gui && g_Settings->LoadBool(RomBrowser_Enabled)) - { - if (!Gui->RomBrowserVisible()) - { - Gui->ShowRomList(); - } - } - else - { - if (Gui->RomBrowserVisible()) - { - Gui->HideRomList(); - } - } + if (Gui && g_Settings->LoadBool(RomBrowser_Enabled)) + { + if (!Gui->RomBrowserVisible()) + { + Gui->ShowRomList(); + } + } + else + { + if (Gui->RomBrowserVisible()) + { + Gui->HideRomList(); + } + } } void RomBowserColoumnsChanged(CMainGui * Gui) { - Gui->ResetRomBrowserColomuns(); + Gui->ResetRomBrowserColomuns(); } void RomBrowserRecursiveChanged(CMainGui * Gui) { - Gui->RefreshRomBrowser(); - Gui->HighLightLastRom(); + Gui->RefreshRomBrowser(); + Gui->HighLightLastRom(); } void CMainGui::ChangeWinSize(long width, long height) { - CGuard Guard(m_CS); - WINDOWPLACEMENT wndpl; - RECT rc1, swrect; + CGuard Guard(m_CS); + WINDOWPLACEMENT wndpl; + RECT rc1, swrect; - wndpl.length = sizeof(wndpl); - GetWindowPlacement(m_hMainWindow, &wndpl); + wndpl.length = sizeof(wndpl); + GetWindowPlacement(m_hMainWindow, &wndpl); - if ((HWND)m_hStatusWnd != NULL) - { - GetClientRect((HWND)m_hStatusWnd, &swrect); - SetRect(&rc1, 0, 0, width, height + swrect.bottom); - } - else - { - SetRect(&rc1, 0, 0, width, height); - } + if ((HWND)m_hStatusWnd != NULL) + { + GetClientRect((HWND)m_hStatusWnd, &swrect); + SetRect(&rc1, 0, 0, width, height + swrect.bottom); + } + else + { + SetRect(&rc1, 0, 0, width, height); + } - AdjustWindowRectEx(&rc1, GetWindowLong(m_hMainWindow, GWL_STYLE), GetMenu(m_hMainWindow) != NULL, GetWindowLong(m_hMainWindow, GWL_EXSTYLE)); + AdjustWindowRectEx(&rc1, GetWindowLong(m_hMainWindow, GWL_STYLE), GetMenu(m_hMainWindow) != NULL, GetWindowLong(m_hMainWindow, GWL_EXSTYLE)); - MoveWindow(m_hMainWindow, wndpl.rcNormalPosition.left, wndpl.rcNormalPosition.top, rc1.right - rc1.left, rc1.bottom - rc1.top, TRUE); + MoveWindow(m_hMainWindow, wndpl.rcNormalPosition.left, wndpl.rcNormalPosition.top, rc1.right - rc1.left, rc1.bottom - rc1.top, TRUE); } void CMainGui::AboutBox(void) { - DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_About), m_hMainWindow, (DLGPROC)AboutBoxProc, (LPARAM)this); + DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_About), m_hMainWindow, (DLGPROC)AboutBoxProc, (LPARAM)this); } void CMainGui::AboutIniBox(void) { - DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About_Ini), m_hMainWindow, (DLGPROC)AboutIniBoxProc,(LPARAM)this); + DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About_Ini), m_hMainWindow, (DLGPROC)AboutIniBoxProc, (LPARAM)this); } DWORD CALLBACK AboutIniBoxProc(HWND hDlg, DWORD uMsg, DWORD wParam, DWORD /*lParam*/) { - static wchar_t RDBHomePage[300], CHTHomePage[300], RDXHomePage[300]; + static wchar_t RDBHomePage[300], CHTHomePage[300], RDXHomePage[300]; - switch (uMsg) { - case WM_INITDIALOG: - { - wchar_t String[200]; + switch (uMsg) { + case WM_INITDIALOG: + { + wchar_t String[200]; - //Title - LONG_PTR originalWndProc = GetWindowLongPtrW(hDlg, GWLP_WNDPROC); - SetWindowLongPtrW(hDlg, GWLP_WNDPROC, (LONG_PTR) DefWindowProcW); - SetWindowTextW(hDlg, GS(INI_TITLE)); - SetWindowLongPtrW(hDlg, GWLP_WNDPROC, originalWndProc); + //Title + LONG_PTR originalWndProc = GetWindowLongPtrW(hDlg, GWLP_WNDPROC); + SetWindowLongPtrW(hDlg, GWLP_WNDPROC, (LONG_PTR)DefWindowProcW); + SetWindowTextW(hDlg, GS(INI_TITLE)); + SetWindowLongPtrW(hDlg, GWLP_WNDPROC, originalWndProc); - //Language - SetDlgItemTextW(hDlg, IDC_LAN, GS(INI_CURRENT_LANG)); - set_about_field(hDlg, IDC_LAN_AUTHOR, GS(INI_AUTHOR), GS(LANGUAGE_AUTHOR)); - set_about_field(hDlg, IDC_LAN_VERSION, GS(INI_VERSION), GS(LANGUAGE_VERSION)); - set_about_field(hDlg, IDC_LAN_DATE, GS(INI_DATE), GS(LANGUAGE_DATE)); - if (wcslen(GS(LANGUAGE_NAME)) == 0) - { - EnableWindow(GetDlgItem(hDlg, IDC_LAN), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_LAN_AUTHOR), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_LAN_VERSION), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_LAN_DATE), FALSE); - } - //RDB - CIniFile RdbIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str()); - wcsncpy(String, RdbIniFile.GetString("Meta", "Author", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - if (wcslen(String) == 0) - { - EnableWindow(GetDlgItem(hDlg, IDC_RDB), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDB_AUTHOR), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDB_VERSION), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDB_DATE), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDB_HOME), FALSE); - } + //Language + SetDlgItemTextW(hDlg, IDC_LAN, GS(INI_CURRENT_LANG)); + set_about_field(hDlg, IDC_LAN_AUTHOR, GS(INI_AUTHOR), GS(LANGUAGE_AUTHOR)); + set_about_field(hDlg, IDC_LAN_VERSION, GS(INI_VERSION), GS(LANGUAGE_VERSION)); + set_about_field(hDlg, IDC_LAN_DATE, GS(INI_DATE), GS(LANGUAGE_DATE)); + if (wcslen(GS(LANGUAGE_NAME)) == 0) + { + EnableWindow(GetDlgItem(hDlg, IDC_LAN), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_LAN_AUTHOR), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_LAN_VERSION), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_LAN_DATE), FALSE); + } + //RDB + CIniFile RdbIniFile(g_Settings->LoadStringVal(SupportFile_RomDatabase).c_str()); + wcsncpy(String, RdbIniFile.GetString("Meta", "Author", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + if (wcslen(String) == 0) + { + EnableWindow(GetDlgItem(hDlg, IDC_RDB), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDB_AUTHOR), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDB_VERSION), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDB_DATE), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDB_HOME), FALSE); + } - set_about_field(hDlg, IDC_RDB_AUTHOR, GS(INI_AUTHOR), String); + set_about_field(hDlg, IDC_RDB_AUTHOR, GS(INI_AUTHOR), String); - wcsncpy(String, RdbIniFile.GetString("Meta", "Version", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - set_about_field(hDlg, IDC_RDB_VERSION, GS(INI_VERSION), String); - wcsncpy(String, RdbIniFile.GetString("Meta", "Date", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - set_about_field(hDlg, IDC_RDB_DATE, GS(INI_DATE), String); - wcsncpy(RDBHomePage, RdbIniFile.GetString("Meta", "Homepage", "").ToUTF16().c_str(), sizeof(RDBHomePage) / sizeof(RDBHomePage[0])); - SetDlgItemTextW(hDlg, IDC_RDB_HOME, GS(INI_HOMEPAGE)); - if (wcslen(RDBHomePage) == 0) - { - EnableWindow(GetDlgItem(hDlg, IDC_RDB_HOME), FALSE); - } + wcsncpy(String, RdbIniFile.GetString("Meta", "Version", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + set_about_field(hDlg, IDC_RDB_VERSION, GS(INI_VERSION), String); + wcsncpy(String, RdbIniFile.GetString("Meta", "Date", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + set_about_field(hDlg, IDC_RDB_DATE, GS(INI_DATE), String); + wcsncpy(RDBHomePage, RdbIniFile.GetString("Meta", "Homepage", "").ToUTF16().c_str(), sizeof(RDBHomePage) / sizeof(RDBHomePage[0])); + SetDlgItemTextW(hDlg, IDC_RDB_HOME, GS(INI_HOMEPAGE)); + if (wcslen(RDBHomePage) == 0) + { + EnableWindow(GetDlgItem(hDlg, IDC_RDB_HOME), FALSE); + } - //Cheat - SetDlgItemTextW(hDlg, IDC_CHT, GS(INI_CURRENT_CHT)); - CIniFile CheatIniFile(g_Settings->LoadStringVal(SupportFile_Cheats).c_str()); - wcsncpy(String, CheatIniFile.GetString("Meta", "Author", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - if (wcslen(String) == 0) - { - EnableWindow(GetDlgItem(hDlg, IDC_CHT), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_CHT_AUTHOR), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_CHT_VERSION), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_CHT_DATE), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_CHT_HOME), FALSE); - } - set_about_field(hDlg, IDC_CHT_AUTHOR, GS(INI_AUTHOR), String); - wcsncpy(String, CheatIniFile.GetString("Meta", "Version", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - set_about_field(hDlg, IDC_CHT_VERSION, GS(INI_VERSION), String); - wcsncpy(String, CheatIniFile.GetString("Meta", "Date", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - set_about_field(hDlg, IDC_CHT_DATE, GS(INI_DATE), String); - wcsncpy(CHTHomePage, CheatIniFile.GetString("Meta", "Homepage", "").ToUTF16().c_str(), sizeof(CHTHomePage) / sizeof(CHTHomePage[0])); - SetDlgItemTextW(hDlg, IDC_CHT_HOME, GS(INI_HOMEPAGE)); - if (wcslen(CHTHomePage) == 0) - { - EnableWindow(GetDlgItem(hDlg, IDC_CHT_HOME), FALSE); - } + //Cheat + SetDlgItemTextW(hDlg, IDC_CHT, GS(INI_CURRENT_CHT)); + CIniFile CheatIniFile(g_Settings->LoadStringVal(SupportFile_Cheats).c_str()); + wcsncpy(String, CheatIniFile.GetString("Meta", "Author", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + if (wcslen(String) == 0) + { + EnableWindow(GetDlgItem(hDlg, IDC_CHT), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_CHT_AUTHOR), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_CHT_VERSION), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_CHT_DATE), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_CHT_HOME), FALSE); + } + set_about_field(hDlg, IDC_CHT_AUTHOR, GS(INI_AUTHOR), String); + wcsncpy(String, CheatIniFile.GetString("Meta", "Version", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + set_about_field(hDlg, IDC_CHT_VERSION, GS(INI_VERSION), String); + wcsncpy(String, CheatIniFile.GetString("Meta", "Date", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + set_about_field(hDlg, IDC_CHT_DATE, GS(INI_DATE), String); + wcsncpy(CHTHomePage, CheatIniFile.GetString("Meta", "Homepage", "").ToUTF16().c_str(), sizeof(CHTHomePage) / sizeof(CHTHomePage[0])); + SetDlgItemTextW(hDlg, IDC_CHT_HOME, GS(INI_HOMEPAGE)); + if (wcslen(CHTHomePage) == 0) + { + EnableWindow(GetDlgItem(hDlg, IDC_CHT_HOME), FALSE); + } - //Extended Info - SetDlgItemTextW(hDlg, IDC_RDX, GS(INI_CURRENT_RDX)); - CIniFile RdxIniFile(g_Settings->LoadStringVal(SupportFile_ExtInfo).c_str()); - wcsncpy(String, RdxIniFile.GetString("Meta", "Author", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - if (wcslen(String) == 0) - { - EnableWindow(GetDlgItem(hDlg, IDC_RDX), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDX_AUTHOR), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDX_VERSION), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDX_DATE), FALSE); - EnableWindow(GetDlgItem(hDlg, IDC_RDX_HOME), FALSE); - } - set_about_field(hDlg, IDC_RDX_AUTHOR, GS(INI_AUTHOR), String); - wcsncpy(String, RdxIniFile.GetString("Meta", "Version", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - set_about_field(hDlg, IDC_RDX_VERSION, GS(INI_VERSION), String); - wcsncpy(String, RdxIniFile.GetString("Meta", "Date", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); - set_about_field(hDlg, IDC_RDX_DATE, GS(INI_DATE), String); - wcsncpy(RDXHomePage, RdxIniFile.GetString("Meta", "Homepage", "").ToUTF16().c_str(), sizeof(RDXHomePage) / sizeof(RDXHomePage[0])); - SetDlgItemTextW(hDlg, IDC_RDX_HOME, GS(INI_HOMEPAGE)); - if (wcslen(RDXHomePage) == 0) - { - EnableWindow(GetDlgItem(hDlg, IDC_RDX_HOME), FALSE); - } - SetDlgItemTextW(hDlg, IDOK, GS(CHEAT_OK)); - } - break; - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDC_RDB_HOME: ShellExecuteW(NULL, L"open", RDBHomePage, NULL, NULL, SW_SHOWNORMAL); break; - case IDC_CHT_HOME: ShellExecuteW(NULL, L"open", CHTHomePage, NULL, NULL, SW_SHOWNORMAL); break; - case IDC_RDX_HOME: ShellExecuteW(NULL, L"open", RDXHomePage, NULL, NULL, SW_SHOWNORMAL); break; - case IDOK: - case IDCANCEL: - EndDialog(hDlg, 0); - break; - } - default: - return FALSE; - } - return TRUE; + //Extended Info + SetDlgItemTextW(hDlg, IDC_RDX, GS(INI_CURRENT_RDX)); + CIniFile RdxIniFile(g_Settings->LoadStringVal(SupportFile_ExtInfo).c_str()); + wcsncpy(String, RdxIniFile.GetString("Meta", "Author", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + if (wcslen(String) == 0) + { + EnableWindow(GetDlgItem(hDlg, IDC_RDX), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDX_AUTHOR), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDX_VERSION), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDX_DATE), FALSE); + EnableWindow(GetDlgItem(hDlg, IDC_RDX_HOME), FALSE); + } + set_about_field(hDlg, IDC_RDX_AUTHOR, GS(INI_AUTHOR), String); + wcsncpy(String, RdxIniFile.GetString("Meta", "Version", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + set_about_field(hDlg, IDC_RDX_VERSION, GS(INI_VERSION), String); + wcsncpy(String, RdxIniFile.GetString("Meta", "Date", "").ToUTF16().c_str(), sizeof(String) / sizeof(String[0])); + set_about_field(hDlg, IDC_RDX_DATE, GS(INI_DATE), String); + wcsncpy(RDXHomePage, RdxIniFile.GetString("Meta", "Homepage", "").ToUTF16().c_str(), sizeof(RDXHomePage) / sizeof(RDXHomePage[0])); + SetDlgItemTextW(hDlg, IDC_RDX_HOME, GS(INI_HOMEPAGE)); + if (wcslen(RDXHomePage) == 0) + { + EnableWindow(GetDlgItem(hDlg, IDC_RDX_HOME), FALSE); + } + SetDlgItemTextW(hDlg, IDOK, GS(CHEAT_OK)); + } + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDC_RDB_HOME: ShellExecuteW(NULL, L"open", RDBHomePage, NULL, NULL, SW_SHOWNORMAL); break; + case IDC_CHT_HOME: ShellExecuteW(NULL, L"open", CHTHomePage, NULL, NULL, SW_SHOWNORMAL); break; + case IDC_RDX_HOME: ShellExecuteW(NULL, L"open", RDXHomePage, NULL, NULL, SW_SHOWNORMAL); break; + case IDOK: + case IDCANCEL: + EndDialog(hDlg, 0); + break; + } + default: + return FALSE; + } + return TRUE; } -bool CMainGui::ResetPlugins (CPlugins * plugins, CN64System * System) +bool CMainGui::ResetPluginsInUiThread(CPlugins * plugins, CN64System * System) { - RESET_PLUGIN info; - info.system = System; - info.plugins = plugins; - info.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); - bool bRes = true; - if (info.hEvent) - { - PostMessage(m_hMainWindow, WM_RESET_PLUGIN, (WPARAM)&bRes, (LPARAM)&info); + RESET_PLUGIN info; + info.system = System; + info.plugins = plugins; + info.hEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + bool bRes = true; + if (info.hEvent) + { + PostMessage(m_hMainWindow, WM_RESET_PLUGIN, (WPARAM)&bRes, (LPARAM)&info); #ifdef _DEBUG - DWORD dwRes = WaitForSingleObject(info.hEvent, INFINITE); + DWORD dwRes = WaitForSingleObject(info.hEvent, INFINITE); #else - DWORD dwRes = WaitForSingleObject(info.hEvent, 5000); + DWORD dwRes = WaitForSingleObject(info.hEvent, 5000); #endif - dwRes = dwRes; - CloseHandle(info.hEvent); - } - else - { - WriteTrace(TraceError, __FUNCTION__ ": Failed to create event"); - bRes = false; - } - return bRes; + dwRes = dwRes; + CloseHandle(info.hEvent); + } + else + { + WriteTrace(TraceError, __FUNCTION__ ": Failed to create event"); + bRes = false; + } + return bRes; } void CMainGui::BringToTop(void) { - CGuard Guard(m_CS); - SetForegroundWindow(m_hMainWindow); - SetFocus(GetDesktopWindow()); - Sleep(100); - SetFocus(m_hMainWindow); + CGuard Guard(m_CS); + SetForegroundWindow(m_hMainWindow); + SetFocus(GetDesktopWindow()); + Sleep(100); + SetFocus(m_hMainWindow); } void CMainGui::MakeWindowOnTop(bool OnTop) { - CGuard Guard(m_CS); - SetWindowPos(m_hMainWindow, OnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW); + CGuard Guard(m_CS); + SetWindowPos(m_hMainWindow, OnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW); } void CMainGui::Caption(LPCWSTR Caption) { - CGuard Guard(m_CS); - SetWindowTextW(m_hMainWindow, Caption); + CGuard Guard(m_CS); + SetWindowTextW(m_hMainWindow, Caption); } void CMainGui::Create(const char * WindowTitle) { - stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR); - m_hMainWindow = (HWND)CreateWindowEx(WS_EX_ACCEPTFILES, VersionDisplay.c_str(), WindowTitle, WS_OVERLAPPED | WS_CLIPCHILDREN | - WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX, 5, 5, 640, 480, - NULL, NULL, GetModuleHandle(NULL), this); - m_Created = m_hMainWindow != NULL; + stdstr_f VersionDisplay("Project64 %s", VER_FILE_VERSION_STR); + m_hMainWindow = (HWND)CreateWindowEx(WS_EX_ACCEPTFILES, VersionDisplay.c_str(), WindowTitle, WS_OVERLAPPED | WS_CLIPCHILDREN | + WS_CLIPSIBLINGS | WS_SYSMENU | WS_MINIMIZEBOX, 5, 5, 640, 480, + NULL, NULL, GetModuleHandle(NULL), this); + m_Created = m_hMainWindow != NULL; } void CMainGui::CreateStatusBar(void) { - m_hStatusWnd = (HWND)CreateStatusWindow(WS_CHILD | WS_VISIBLE, "", m_hMainWindow, StatusBarID); - SendMessage((HWND)m_hStatusWnd, SB_SETTEXT, 0, (LPARAM)""); + m_hStatusWnd = (HWND)CreateStatusWindow(WS_CHILD | WS_VISIBLE, "", m_hMainWindow, StatusBarID); + SendMessage((HWND)m_hStatusWnd, SB_SETTEXT, 0, (LPARAM)""); } WPARAM CMainGui::ProcessAllMessages(void) { - MSG msg; + MSG msg; - while (GetMessage(&msg, NULL, 0, 0)) - { - if (g_cheatUI != NULL && g_cheatUI->IsCheatMessage(&msg)) - { - continue; - } + while (GetMessage(&msg, NULL, 0, 0)) + { + if (g_cheatUI != NULL && g_cheatUI->IsCheatMessage(&msg)) + { + continue; + } - if (m_ResetPlugins) - { - m_ResetPlugins = false; - m_ResetInfo->res = m_ResetInfo->plugins->Reset(m_ResetInfo->system); - SetEvent(m_ResetInfo->hEvent); - m_ResetInfo = NULL; - } - if (g_cheatUI && g_cheatUI->IsCheatMessage(&msg)) { continue; } - if (m_Menu->ProcessAccelerator(m_hMainWindow, &msg)) { continue; } - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return msg.wParam; + if (m_ResetPlugins) + { + m_ResetPlugins = false; + m_ResetInfo->res = m_ResetInfo->plugins->Reset(m_ResetInfo->system); + SetEvent(m_ResetInfo->hEvent); + m_ResetInfo = NULL; + } + if (g_cheatUI && g_cheatUI->IsCheatMessage(&msg)) { continue; } + if (m_Menu->ProcessAccelerator(m_hMainWindow, &msg)) { continue; } + TranslateMessage(&msg); + DispatchMessage(&msg); + } + return msg.wParam; } bool CMainGui::ProcessGuiMessages(void) { - MSG msg; + MSG msg; - while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) - { - if (m_ResetPlugins) - { - m_ResetPlugins = false; - } - if (msg.message == WM_QUIT) - { - return true; - } - PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); - if (m_Menu->ProcessAccelerator(m_hMainWindow, &msg)) { continue; } - TranslateMessage(&msg); - DispatchMessage(&msg); - } - return false; + while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) + { + if (m_ResetPlugins) + { + m_ResetPlugins = false; + } + if (msg.message == WM_QUIT) + { + return true; + } + PeekMessage(&msg, NULL, 0, 0, PM_REMOVE); + if (m_Menu->ProcessAccelerator(m_hMainWindow, &msg)) { continue; } + TranslateMessage(&msg); + DispatchMessage(&msg); + } + return false; } void CMainGui::Resize(DWORD /*fwSizeType*/, WORD nWidth, WORD nHeight) { - RECT clrect, swrect; - GetClientRect(m_hMainWindow, &clrect); - GetClientRect((HWND)m_hStatusWnd, &swrect); + RECT clrect, swrect; + GetClientRect(m_hMainWindow, &clrect); + GetClientRect((HWND)m_hStatusWnd, &swrect); - int Parts[2]; - Parts[0] = (nWidth - (int)(clrect.right * 0.25)); - Parts[1] = nWidth; + int Parts[2]; + Parts[0] = (nWidth - (int)(clrect.right * 0.25)); + Parts[1] = nWidth; - SendMessage((HWND)m_hStatusWnd, SB_SETPARTS, 2, (LPARAM)&Parts[0]); - MoveWindow((HWND)m_hStatusWnd, 0, clrect.bottom - swrect.bottom, nWidth, nHeight, TRUE); + SendMessage((HWND)m_hStatusWnd, SB_SETPARTS, 2, (LPARAM)&Parts[0]); + MoveWindow((HWND)m_hStatusWnd, 0, clrect.bottom - swrect.bottom, nWidth, nHeight, TRUE); } void CMainGui::Show(bool Visible) { - m_MakingVisible = true; + m_MakingVisible = true; - CGuard Guard(m_CS); - if (m_hMainWindow) - { - ShowWindow(m_hMainWindow, Visible ? SW_SHOW : SW_HIDE); - if (Visible && RomBrowserVisible()) - { - RomBrowserToTop(); - } - } + CGuard Guard(m_CS); + if (m_hMainWindow) + { + ShowWindow(m_hMainWindow, Visible ? SW_SHOW : SW_HIDE); + if (Visible && RomBrowserVisible()) + { + RomBrowserToTop(); + } + } - m_MakingVisible = false; + m_MakingVisible = false; } -void CMainGui::EnterLogOptions (void) +void CMainGui::EnterLogOptions(void) { - ::EnterLogOptions(m_hMainWindow); + ::EnterLogOptions(m_hMainWindow); } int CMainGui::Height(void) { - if (!m_hMainWindow) { return 0; } + if (!m_hMainWindow) { return 0; } - RECT rect; - GetWindowRect(m_hMainWindow, &rect); - return rect.bottom - rect.top; + RECT rect; + GetWindowRect(m_hMainWindow, &rect); + return rect.bottom - rect.top; } int CMainGui::Width(void) { - if (!m_hMainWindow) { return 0; } + if (!m_hMainWindow) { return 0; } - RECT rect; - GetWindowRect(m_hMainWindow, &rect); - return rect.right - rect.left; + RECT rect; + GetWindowRect(m_hMainWindow, &rect); + return rect.right - rect.left; } void CMainGui::SetPos(int X, int Y) { - SetWindowPos(m_hMainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + SetWindowPos(m_hMainWindow, NULL, X, Y, 0, 0, SWP_NOZORDER | SWP_NOSIZE); } void CMainGui::SetWindowMenu(CBaseMenu * Menu) { - m_AttachingMenu = true; + m_AttachingMenu = true; - HMENU hMenu = NULL; - { - CGuard Guard(m_CS); - m_Menu = Menu; - hMenu = (HMENU)Menu->GetHandle(); - } + HMENU hMenu = NULL; + { + CGuard Guard(m_CS); + m_Menu = Menu; + hMenu = (HMENU)Menu->GetHandle(); + } - if (hMenu) - { - SetMenu(m_hMainWindow, hMenu); - } + if (hMenu) + { + SetMenu(m_hMainWindow, hMenu); + } - m_AttachingMenu = false; + m_AttachingMenu = false; } void CMainGui::RefreshMenu(void) { - if (!m_Menu) { return; } - m_Menu->ResetMenu(); + if (!m_Menu) { return; } + m_Menu->ResetMenu(); } void CMainGui::SetStatusText(int Panel, const wchar_t * Text) { - static wchar_t Message[2][500]; - if (Panel >= 2) - { - g_Notify->BreakPoint(__FILEW__, __LINE__); - return; - } - wchar_t * Msg = Message[Panel]; + static wchar_t Message[2][500]; + if (Panel >= 2) + { + g_Notify->BreakPoint(__FILEW__, __LINE__); + return; + } + wchar_t * Msg = Message[Panel]; - memset(Msg, 0, sizeof(Message[0])); - _snwprintf(Msg, sizeof(Message[0]) / sizeof(Message[0][0]), L"%s", Text); - Msg[(sizeof(Message[0]) / sizeof(Message[0][0])) - 1] = 0; - if (GetCurrentThreadId() == m_ThreadId) - { - SendMessageW((HWND)m_hStatusWnd, SB_SETTEXTW, Panel, (LPARAM)Msg); - } - else { - PostMessageW((HWND)m_hStatusWnd, SB_SETTEXTW, Panel, (LPARAM)Msg); - } + memset(Msg, 0, sizeof(Message[0])); + _snwprintf(Msg, sizeof(Message[0]) / sizeof(Message[0][0]), L"%s", Text); + Msg[(sizeof(Message[0]) / sizeof(Message[0][0])) - 1] = 0; + if (GetCurrentThreadId() == m_ThreadId) + { + SendMessageW((HWND)m_hStatusWnd, SB_SETTEXTW, Panel, (LPARAM)Msg); + } + else { + PostMessageW((HWND)m_hStatusWnd, SB_SETTEXTW, Panel, (LPARAM)Msg); + } } void CMainGui::ShowStatusBar(bool ShowBar) { - ShowWindow((HWND)m_hStatusWnd, ShowBar ? SW_SHOW : SW_HIDE); + ShowWindow((HWND)m_hStatusWnd, ShowBar ? SW_SHOW : SW_HIDE); } void CMainGui::SaveWindowLoc(void) { - bool flush = false; - if (m_SaveMainWindowPos) - { - m_SaveMainWindowPos = false; - g_Settings->SaveDword(UserInterface_MainWindowTop, m_SaveMainWindowTop); - g_Settings->SaveDword(UserInterface_MainWindowLeft, m_SaveMainWindowLeft); - flush = true; - } + bool flush = false; + if (m_SaveMainWindowPos) + { + m_SaveMainWindowPos = false; + g_Settings->SaveDword(UserInterface_MainWindowTop, m_SaveMainWindowTop); + g_Settings->SaveDword(UserInterface_MainWindowLeft, m_SaveMainWindowLeft); + flush = true; + } - if (m_SaveRomBrowserPos) - { - m_SaveRomBrowserPos = false; - g_Settings->SaveDword(RomBrowser_Top, m_SaveRomBrowserTop); - g_Settings->SaveDword(RomBrowser_Left, m_SaveRomBrowserLeft); - flush = true; - } + if (m_SaveRomBrowserPos) + { + m_SaveRomBrowserPos = false; + g_Settings->SaveDword(RomBrowser_Top, m_SaveRomBrowserTop); + g_Settings->SaveDword(RomBrowser_Left, m_SaveRomBrowserLeft); + flush = true; + } - if (flush) - { - CSettingTypeApplication::Flush(); - } + if (flush) + { + CSettingTypeApplication::Flush(); + } } LRESULT CALLBACK CMainGui::MainGui_Proc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) { - switch (uMsg) - { - case WM_CREATE: - { - //record class for future usage - LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam; - CMainGui * _this = (CMainGui *)lpcs->lpCreateParams; - SetProp((HWND)hWnd, "Class", _this); + switch (uMsg) + { + case WM_CREATE: + { + //record class for future usage + LPCREATESTRUCT lpcs = (LPCREATESTRUCT)lParam; + CMainGui * _this = (CMainGui *)lpcs->lpCreateParams; + SetProp((HWND)hWnd, "Class", _this); - _this->m_hMainWindow = hWnd; - _this->CreateStatusBar(); + _this->m_hMainWindow = hWnd; + _this->CreateStatusBar(); - //Move the Main window to the location last executed from or center the window - int X = (GetSystemMetrics(SM_CXSCREEN) - _this->Width()) / 2; - int Y = (GetSystemMetrics(SM_CYSCREEN) - _this->Height()) / 2; + //Move the Main window to the location last executed from or center the window + int X = (GetSystemMetrics(SM_CXSCREEN) - _this->Width()) / 2; + int Y = (GetSystemMetrics(SM_CYSCREEN) - _this->Height()) / 2; - g_Settings->LoadDword(UserInterface_MainWindowTop, (uint32_t &)Y); - g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X); + g_Settings->LoadDword(UserInterface_MainWindowTop, (uint32_t &)Y); + g_Settings->LoadDword(UserInterface_MainWindowLeft, (uint32_t &)X); - _this->SetPos(X, Y); + _this->SetPos(X, Y); - _this->ChangeWinSize(640, 480); - } - break; - case WM_SYSCOMMAND: - switch (wParam) { - case SC_SCREENSAVE: - case SC_MONITORPOWER: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this && - _this->bCPURunning() && - !g_Settings->LoadBool(GameRunning_CPU_Paused) && - g_Settings->LoadDword(Setting_DisableScrSaver)) - { - return 0; - } - } - break; - case SC_MAXIMIZE: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this) - { - if (_this->RomBrowserVisible()) - { - _this->RomBrowserMaximize(true); - } - } - } - break; - } - return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); - break; - case WM_MOVE: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + _this->ChangeWinSize(640, 480); + } + break; + case WM_SYSCOMMAND: + switch (wParam) { + case SC_SCREENSAVE: + case SC_MONITORPOWER: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this && + _this->bCPURunning() && + !g_Settings->LoadBool(GameRunning_CPU_Paused) && + g_Settings->LoadDword(Setting_DisableScrSaver)) + { + return 0; + } + } + break; + case SC_MAXIMIZE: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this) + { + if (_this->RomBrowserVisible()) + { + _this->RomBrowserMaximize(true); + } + } + } + break; + } + return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); + break; + case WM_MOVE: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (!_this->m_bMainWindow || - !_this->m_Created || - _this->m_AttachingMenu || - _this->m_MakingVisible || - IsIconic((HWND)hWnd) || - _this->ShowingRomBrowser()) - { - break; - } + if (!_this->m_bMainWindow || + !_this->m_Created || + _this->m_AttachingMenu || + _this->m_MakingVisible || + IsIconic((HWND)hWnd) || + _this->ShowingRomBrowser()) + { + break; + } - if (IsZoomed((HWND)hWnd)) - { - if (_this->RomBrowserVisible()) - { - // save that browser is maximized - } - break; - } + if (IsZoomed((HWND)hWnd)) + { + if (_this->RomBrowserVisible()) + { + // save that browser is maximized + } + break; + } - //get the current position of the window - RECT WinRect; - GetWindowRect((HWND)hWnd, &WinRect); + //get the current position of the window + RECT WinRect; + GetWindowRect((HWND)hWnd, &WinRect); - //save the location of the window - if (_this->RomBrowserVisible()) - { - _this->m_SaveRomBrowserPos = true; - _this->m_SaveRomBrowserTop = WinRect.top; - _this->m_SaveRomBrowserLeft = WinRect.left; - } - else - { - _this->m_SaveMainWindowPos = true; - _this->m_SaveMainWindowTop = WinRect.top; - _this->m_SaveMainWindowLeft = WinRect.left; - } - KillTimer(hWnd, Timer_SetWindowPos); - SetTimer(hWnd, Timer_SetWindowPos, 1000, NULL); - } - if (CGuiSettings::bCPURunning() && g_BaseSystem) - { - if (g_Plugins->Gfx() && g_Plugins->Gfx()->MoveScreen) - { - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Starting"); - g_Plugins->Gfx()->MoveScreen((int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)); - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Done"); - } - } - break; - case WM_TIMER: - if (wParam == Timer_SetWindowPos) - { - KillTimer(hWnd, Timer_SetWindowPos); - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - _this->SaveWindowLoc(); - break; - } - break; - case WM_SIZE: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this) { _this->Resize(wParam, LOWORD(lParam), HIWORD(lParam)); } - if (_this) - { - if (wParam == SIZE_MAXIMIZED) - { - if (_this->RomBrowserVisible()) - { - _this->RomBrowserMaximize(true); - } - } - _this->ResizeRomList(LOWORD(lParam), HIWORD(lParam)); - } - if (_this) - { - if (wParam == SIZE_RESTORED && _this->RomBrowserVisible()) - { - _this->RomBrowserMaximize(false); - } - } - } - break; - case WM_NOTIFY: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this) - { - if (_this->RomBrowserVisible() && !_this->RomListNotify(wParam, lParam)) - { - return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); - } - } - } - break; - case WM_DRAWITEM: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this) - { - if (!_this->RomListDrawItem(wParam, lParam)) - { - return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); - } - } - } - break; - case WM_PAINT: - { - // CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); - // CN64System * System = _this->m_System; + //save the location of the window + if (_this->RomBrowserVisible()) + { + _this->m_SaveRomBrowserPos = true; + _this->m_SaveRomBrowserTop = WinRect.top; + _this->m_SaveRomBrowserLeft = WinRect.left; + } + else + { + _this->m_SaveMainWindowPos = true; + _this->m_SaveMainWindowTop = WinRect.top; + _this->m_SaveMainWindowLeft = WinRect.left; + } + KillTimer(hWnd, Timer_SetWindowPos); + SetTimer(hWnd, Timer_SetWindowPos, 1000, NULL); + } + if (CGuiSettings::bCPURunning() && g_BaseSystem) + { + if (g_Plugins->Gfx() && g_Plugins->Gfx()->MoveScreen) + { + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Starting"); + g_Plugins->Gfx()->MoveScreen((int)(short)LOWORD(lParam), (int)(short)HIWORD(lParam)); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Done"); + } + } + break; + case WM_TIMER: + if (wParam == Timer_SetWindowPos) + { + KillTimer(hWnd, Timer_SetWindowPos); + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + _this->SaveWindowLoc(); + break; + } + break; + case WM_SIZE: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this) { _this->Resize(wParam, LOWORD(lParam), HIWORD(lParam)); } + if (_this) + { + if (wParam == SIZE_MAXIMIZED) + { + if (_this->RomBrowserVisible()) + { + _this->RomBrowserMaximize(true); + } + } + _this->ResizeRomList(LOWORD(lParam), HIWORD(lParam)); + } + if (_this) + { + if (wParam == SIZE_RESTORED && _this->RomBrowserVisible()) + { + _this->RomBrowserMaximize(false); + } + } + } + break; + case WM_NOTIFY: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this) + { + if (_this->RomBrowserVisible() && !_this->RomListNotify(wParam, lParam)) + { + return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); + } + } + } + break; + case WM_DRAWITEM: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this) + { + if (!_this->RomListDrawItem(wParam, lParam)) + { + return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); + } + } + } + break; + case WM_PAINT: + { + // CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); + // CN64System * System = _this->m_System; - // if (bCPURunning() && Settings->Load(CPU_Paused)) { - // CPlugins * Plugins = System->Plugins(); - // if (Plugins->Gfx()->DrawScreen) { - // Plugins->Gfx()->DrawScreen(); - // } - // } - ValidateRect((HWND)hWnd, NULL); - } - break; - case WM_KEYUP: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + // if (bCPURunning() && Settings->Load(CPU_Paused)) { + // CPlugins * Plugins = System->Plugins(); + // if (Plugins->Gfx()->DrawScreen) { + // Plugins->Gfx()->DrawScreen(); + // } + // } + ValidateRect((HWND)hWnd, NULL); + } + break; + case WM_KEYUP: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this->m_bMainWindow && bCPURunning()) - { - if (g_BaseSystem) - { - if (g_Plugins && g_Plugins->Control()->WM_KeyUp) { - g_Plugins->Control()->WM_KeyUp(wParam, lParam); - } - } - } - } - break; - case WM_KEYDOWN: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this->m_bMainWindow && bCPURunning()) + { + if (g_BaseSystem) + { + if (g_Plugins && g_Plugins->Control()->WM_KeyUp) { + g_Plugins->Control()->WM_KeyUp(wParam, lParam); + } + } + } + } + break; + case WM_KEYDOWN: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this->m_bMainWindow && bCPURunning()) - { - if (g_BaseSystem) - { - if (g_Plugins && g_Plugins->Control()->WM_KeyDown) - { - g_Plugins->Control()->WM_KeyDown(wParam, lParam); - } - } - } - } - break; - case WM_SETFOCUS: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this->RomBrowserVisible()) - { - PostMessage((HWND)hWnd, WM_BORWSER_TOP, 0, 0); - break; - } + if (_this->m_bMainWindow && bCPURunning()) + { + if (g_BaseSystem) + { + if (g_Plugins && g_Plugins->Control()->WM_KeyDown) + { + g_Plugins->Control()->WM_KeyDown(wParam, lParam); + } + } + } + } + break; + case WM_SETFOCUS: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this->RomBrowserVisible()) + { + PostMessage((HWND)hWnd, WM_BORWSER_TOP, 0, 0); + break; + } - if (_this->m_bMainWindow && bCPURunning() && bAutoSleep()) - { - if (g_BaseSystem) - { - g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_AppGainedFocus); - } - } - } - break; - case WM_KILLFOCUS: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this->RomBrowserVisible()) - { - break; - } + if (_this->m_bMainWindow && bCPURunning() && bAutoSleep()) + { + if (g_BaseSystem) + { + g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_AppGainedFocus); + } + } + } + break; + case WM_KILLFOCUS: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this->RomBrowserVisible()) + { + break; + } - if (_this->m_bMainWindow && bCPURunning() && bAutoSleep()) - { - if (g_BaseSystem) - { - g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_AppLostFocus); - } - } - } - break; - case WM_ACTIVATEAPP: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - DWORD fActive = (BOOL)wParam; + if (_this->m_bMainWindow && bCPURunning() && bAutoSleep()) + { + if (g_BaseSystem) + { + g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_AppLostFocus); + } + } + } + break; + case WM_ACTIVATEAPP: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + DWORD fActive = (BOOL)wParam; - if (fActive && _this->RomBrowserVisible()) - { - PostMessage((HWND)hWnd, WM_BORWSER_TOP, 0, 0); - } - if (_this->m_bMainWindow && bCPURunning()) - { - if (!fActive && g_Settings->LoadBool(UserInterface_InFullScreen)) - { - Notify().WindowMode(); - if (bAutoSleep() && g_BaseSystem) - { - //System->ExternalEvent(PauseCPU_AppLostActiveDelayed ); - } - break; - } - if (bAutoSleep() || fActive) - { - if (g_BaseSystem) - { - g_BaseSystem->ExternalEvent(fActive ? SysEvent_ResumeCPU_AppGainedActive : SysEvent_PauseCPU_AppLostActive); - } - } - } - } - break; - case WM_HIDE_CUROSR: - if (!wParam) - { - while (ShowCursor(FALSE) >= 0) { Sleep(0); } - } - else - { - while (ShowCursor(TRUE) < 0) { Sleep(0); } - } - break; - case WM_MAKE_FOCUS: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - _this->BringToTop(); - } - break; - case WM_BORWSER_TOP: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - _this->RomBrowserToTop(); - } - break; - case WM_RESET_PLUGIN: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this->m_ResetInfo != NULL) - { - g_Notify->BreakPoint(__FILEW__, __LINE__); - } - _this->m_ResetInfo = (RESET_PLUGIN *)lParam; - _this->m_ResetPlugins = true; - } - break; - case WM_COMMAND: - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this == NULL) { break; } + if (fActive && _this->RomBrowserVisible()) + { + PostMessage((HWND)hWnd, WM_BORWSER_TOP, 0, 0); + } + if (_this->m_bMainWindow && bCPURunning()) + { + if (!fActive && g_Settings->LoadBool(UserInterface_InFullScreen)) + { + Notify().WindowMode(); + if (bAutoSleep() && g_BaseSystem) + { + //System->ExternalEvent(PauseCPU_AppLostActiveDelayed ); + } + break; + } + if (bAutoSleep() || fActive) + { + if (g_BaseSystem) + { + g_BaseSystem->ExternalEvent(fActive ? SysEvent_ResumeCPU_AppGainedActive : SysEvent_PauseCPU_AppLostActive); + } + } + } + } + break; + case WM_HIDE_CUROSR: + if (!wParam) + { + while (ShowCursor(FALSE) >= 0) { Sleep(0); } + } + else + { + while (ShowCursor(TRUE) < 0) { Sleep(0); } + } + break; + case WM_MAKE_FOCUS: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + _this->BringToTop(); + } + break; + case WM_BORWSER_TOP: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + _this->RomBrowserToTop(); + } + break; + case WM_RESET_PLUGIN: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this->m_ResetInfo != NULL) + { + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + _this->m_ResetInfo = (RESET_PLUGIN *)lParam; + _this->m_ResetPlugins = true; + } + break; + case WM_COMMAND: + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this == NULL) { break; } - switch (LOWORD(wParam)) { - case ID_POPUPMENU_PLAYGAME: g_BaseSystem->RunFileImage(_this->CurrentedSelectedRom()); break; - case ID_POPUPMENU_ROMDIRECTORY: _this->SelectRomDir(); break; - case ID_POPUPMENU_REFRESHROMLIST: _this->RefreshRomBrowser(); break; - case ID_POPUPMENU_ROMINFORMATION: - { - RomInformation Info(_this->CurrentedSelectedRom()); - Info.DisplayInformation(hWnd); - } - break; - case ID_POPUPMENU_EDITSETTINGS: - case ID_POPUPMENU_EDITCHEATS: - { - CN64Rom Rom; - Rom.LoadN64Image(_this->CurrentedSelectedRom(), true); - Rom.SaveRomSettingID(true); + switch (LOWORD(wParam)) { + case ID_POPUPMENU_PLAYGAME: g_BaseSystem->RunFileImage(_this->CurrentedSelectedRom()); break; + case ID_POPUPMENU_ROMDIRECTORY: _this->SelectRomDir(); break; + case ID_POPUPMENU_REFRESHROMLIST: _this->RefreshRomBrowser(); break; + case ID_POPUPMENU_ROMINFORMATION: + { + RomInformation Info(_this->CurrentedSelectedRom()); + Info.DisplayInformation(hWnd); + } + break; + case ID_POPUPMENU_EDITSETTINGS: + case ID_POPUPMENU_EDITCHEATS: + { + CN64Rom Rom; + Rom.LoadN64Image(_this->CurrentedSelectedRom(), true); + Rom.SaveRomSettingID(true); - if (LOWORD(wParam) == ID_POPUPMENU_EDITSETTINGS) - { - CSettingConfig SettingConfig(true); - SettingConfig.Display(hWnd); - } + if (LOWORD(wParam) == ID_POPUPMENU_EDITSETTINGS) + { + CSettingConfig SettingConfig(true); + SettingConfig.Display(hWnd); + } - if (LOWORD(wParam) == ID_POPUPMENU_EDITCHEATS) - { - CCheatsUI * cheatUI = new CCheatsUI; - g_cheatUI = cheatUI; - cheatUI->SelectCheats(hWnd, true); - if (g_cheatUI == cheatUI) - { - g_cheatUI = NULL; - } - } + if (LOWORD(wParam) == ID_POPUPMENU_EDITCHEATS) + { + CCheatsUI * cheatUI = new CCheatsUI; + g_cheatUI = cheatUI; + cheatUI->SelectCheats(hWnd, true); + if (g_cheatUI == cheatUI) + { + g_cheatUI = NULL; + } + } - if (g_Rom) - { - g_Rom->SaveRomSettingID(false); - } - else - { - Rom.ClearRomSettingID(); - } - } - break; - default: - if (_this->m_Menu) - { - if (LOWORD(wParam) > 5000 && LOWORD(wParam) <= 5100) - { - if (g_Plugins->RSP()) - { - g_Plugins->RSP()->ProcessMenuItem(LOWORD(wParam)); - } - } - else if (LOWORD(wParam) > 5100 && LOWORD(wParam) <= 5200) - { - if (g_Plugins->Gfx()) - { - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Starting"); - g_Plugins->Gfx()->ProcessMenuItem(LOWORD(wParam)); - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Done"); - } - } - else if (LOWORD(wParam) > 5200 && LOWORD(wParam) <= 5300) - { - if (g_Plugins->Gfx() && g_Plugins->Gfx()->OnRomBrowserMenuItem != NULL) - { - CN64Rom Rom; - if (!Rom.LoadN64Image(_this->CurrentedSelectedRom(), true)) - { - break; - } - Rom.SaveRomSettingID(true); - g_Notify->DisplayMessage(0, L""); - BYTE * RomHeader = Rom.GetRomAddress(); - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": OnRomBrowserMenuItem - Starting"); - g_Plugins->Gfx()->OnRomBrowserMenuItem(LOWORD(wParam), hWnd, RomHeader); - WriteTrace(TraceGfxPlugin, __FUNCTION__ ": OnRomBrowserMenuItem - Done"); - if (g_Rom) - { - g_Rom->SaveRomSettingID(false); - } - else - { - g_Settings->SaveString(Game_IniKey, ""); - } - } - } - else if (_this->m_Menu->ProcessMessage(hWnd, HIWORD(wParam), LOWORD(wParam))) - { - return true; - } - } - } - } - break; - case WM_DROPFILES: - { - char filename[MAX_PATH]; + if (g_Rom) + { + g_Rom->SaveRomSettingID(false); + } + else + { + Rom.ClearRomSettingID(); + } + } + break; + default: + if (_this->m_Menu) + { + if (LOWORD(wParam) > 5000 && LOWORD(wParam) <= 5100) + { + if (g_Plugins->RSP()) + { + g_Plugins->RSP()->ProcessMenuItem(LOWORD(wParam)); + } + } + else if (LOWORD(wParam) > 5100 && LOWORD(wParam) <= 5200) + { + if (g_Plugins->Gfx()) + { + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Starting"); + g_Plugins->Gfx()->ProcessMenuItem(LOWORD(wParam)); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": Done"); + } + } + else if (LOWORD(wParam) > 5200 && LOWORD(wParam) <= 5300) + { + if (g_Plugins->Gfx() && g_Plugins->Gfx()->OnRomBrowserMenuItem != NULL) + { + CN64Rom Rom; + if (!Rom.LoadN64Image(_this->CurrentedSelectedRom(), true)) + { + break; + } + Rom.SaveRomSettingID(true); + g_Notify->DisplayMessage(0, L""); + BYTE * RomHeader = Rom.GetRomAddress(); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": OnRomBrowserMenuItem - Starting"); + g_Plugins->Gfx()->OnRomBrowserMenuItem(LOWORD(wParam), hWnd, RomHeader); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": OnRomBrowserMenuItem - Done"); + if (g_Rom) + { + g_Rom->SaveRomSettingID(false); + } + else + { + g_Settings->SaveString(Game_IniKey, ""); + } + } + } + else if (_this->m_Menu->ProcessMessage(hWnd, HIWORD(wParam), LOWORD(wParam))) + { + return true; + } + } + } + } + break; + case WM_DROPFILES: + { + char filename[MAX_PATH]; - HDROP hDrop = (HDROP)wParam; - DragQueryFile(hDrop, 0, filename, sizeof(filename)); - DragFinish(hDrop); + HDROP hDrop = (HDROP)wParam; + DragQueryFile(hDrop, 0, filename, sizeof(filename)); + DragFinish(hDrop); - CN64System::RunFileImage(filename); - } - break; - case WM_DESTROY: - WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - start"); - { - CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); - if (_this->m_bMainWindow) - { - Notify().WindowMode(); - } - _this->m_hMainWindow = NULL; - WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 1"); - if (_this->m_bMainWindow) - { - _this->SaveRomListColoumnInfo(); - WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 2"); - _this->SaveWindowLoc(); - } - } - WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 3"); - RemoveProp((HWND)hWnd, "Class"); - WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 4"); - PostQuitMessage(0); - WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - Done"); - break; - default: - return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); - } - return TRUE; + CN64System::RunFileImage(filename); + } + break; + case WM_DESTROY: + WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - start"); + { + CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd, "Class"); + if (_this->m_bMainWindow) + { + Notify().WindowMode(); + } + _this->m_hMainWindow = NULL; + WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 1"); + if (_this->m_bMainWindow) + { + _this->SaveRomListColoumnInfo(); + WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 2"); + _this->SaveWindowLoc(); + } + } + WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 3"); + RemoveProp((HWND)hWnd, "Class"); + WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - 4"); + PostQuitMessage(0); + WriteTrace(TraceDebug, __FUNCTION__ ": WM_DESTROY - Done"); + break; + default: + return DefWindowProc((HWND)hWnd, uMsg, wParam, lParam); + } + return TRUE; } DWORD CALLBACK AboutBoxProc(HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) { - static HBITMAP hbmpBackgroundTop = NULL; - static HFONT hPageHeadingFont = NULL; - static HFONT hTextFont = NULL; - static HFONT hAuthorFont = NULL; + static HBITMAP hbmpBackgroundTop = NULL; + static HFONT hPageHeadingFont = NULL; + static HFONT hTextFont = NULL; + static HFONT hAuthorFont = NULL; - switch (uMsg) { - case WM_INITDIALOG: - { - //Title - SetWindowTextW(hWnd, GS(PLUG_ABOUT)); + switch (uMsg) { + case WM_INITDIALOG: + { + //Title + SetWindowTextW(hWnd, GS(PLUG_ABOUT)); - // Use the size of the image - hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_LOGO)); + // Use the size of the image + hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_LOGO)); - BITMAP bmTL; - GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); + BITMAP bmTL; + GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); - hTextFont = ::CreateFont(18, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); - hAuthorFont = ::CreateFont(18, 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); + hTextFont = ::CreateFont(18, 0, 0, 0, FW_NORMAL, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); + hAuthorFont = ::CreateFont(18, 0, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial"); - hPageHeadingFont = ::CreateFont(24, 0, 0, 0, FW_BOLD, 0, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial Bold"); + hPageHeadingFont = ::CreateFont(24, 0, 0, 0, FW_BOLD, 0, FALSE, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, DEFAULT_PITCH | FF_DONTCARE, "Arial Bold"); - SendDlgItemMessage(hWnd, IDC_VERSION, WM_SETFONT, (WPARAM)hTextFont, TRUE); - SendDlgItemMessage(hWnd, IDC_TEAM, WM_SETFONT, (WPARAM)hPageHeadingFont, TRUE); - SendDlgItemMessage(hWnd, IDC_THANKS, WM_SETFONT, (WPARAM)hPageHeadingFont, TRUE); + SendDlgItemMessage(hWnd, IDC_VERSION, WM_SETFONT, (WPARAM)hTextFont, TRUE); + SendDlgItemMessage(hWnd, IDC_TEAM, WM_SETFONT, (WPARAM)hPageHeadingFont, TRUE); + SendDlgItemMessage(hWnd, IDC_THANKS, WM_SETFONT, (WPARAM)hPageHeadingFont, TRUE); - SendDlgItemMessage(hWnd, IDC_ZILMAR, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); - SendDlgItemMessage(hWnd, IDC_JABO, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); - SendDlgItemMessage(hWnd, IDC_SMIFF, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); - SendDlgItemMessage(hWnd, IDC_GENT, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); + SendDlgItemMessage(hWnd, IDC_ZILMAR, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); + SendDlgItemMessage(hWnd, IDC_JABO, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); + SendDlgItemMessage(hWnd, IDC_SMIFF, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); + SendDlgItemMessage(hWnd, IDC_GENT, WM_SETFONT, (WPARAM)hAuthorFont, TRUE); - SendDlgItemMessage(hWnd, IDC_ZILMAR_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); - SendDlgItemMessage(hWnd, IDC_JABO_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); - SendDlgItemMessage(hWnd, IDC_SMIFF_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); - SendDlgItemMessage(hWnd, IDC_GENT_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); + SendDlgItemMessage(hWnd, IDC_ZILMAR_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); + SendDlgItemMessage(hWnd, IDC_JABO_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); + SendDlgItemMessage(hWnd, IDC_SMIFF_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); + SendDlgItemMessage(hWnd, IDC_GENT_DETAILS, WM_SETFONT, (WPARAM)hTextFont, TRUE); - SendDlgItemMessage(hWnd, IDC_THANK_LIST, WM_SETFONT, (WPARAM)hTextFont, TRUE); + SendDlgItemMessage(hWnd, IDC_THANK_LIST, WM_SETFONT, (WPARAM)hTextFont, TRUE); - stdstr_f VersionDisplay("Version: %s", VER_FILE_VERSION_STR); - SetWindowText(GetDlgItem(hWnd, IDC_VERSION), VersionDisplay.c_str()); - } - break; - case WM_CTLCOLORSTATIC: - { - HDC hdcStatic = (HDC)wParam; - SetTextColor(hdcStatic, RGB(0, 0, 0)); - SetBkMode(hdcStatic, TRANSPARENT); - return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); - } - break; - case WM_ERASEBKGND: - { - HPEN outline; - HBRUSH fill; - RECT rect; + stdstr_f VersionDisplay("Version: %s", VER_FILE_VERSION_STR); + SetWindowText(GetDlgItem(hWnd, IDC_VERSION), VersionDisplay.c_str()); + } + break; + case WM_CTLCOLORSTATIC: + { + HDC hdcStatic = (HDC)wParam; + SetTextColor(hdcStatic, RGB(0, 0, 0)); + SetBkMode(hdcStatic, TRANSPARENT); + return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); + } + break; + case WM_ERASEBKGND: + { + HPEN outline; + HBRUSH fill; + RECT rect; - outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); - fill = CreateSolidBrush(0x00FFFFFF); - SelectObject((HDC)wParam, outline); - SelectObject((HDC)wParam, fill); + outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); + fill = CreateSolidBrush(0x00FFFFFF); + SelectObject((HDC)wParam, outline); + SelectObject((HDC)wParam, fill); - GetClientRect(hWnd, &rect); + GetClientRect(hWnd, &rect); - Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); - } - break; - case WM_PAINT: - { - PAINTSTRUCT ps; + Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); + } + break; + case WM_PAINT: + { + PAINTSTRUCT ps; - if (BeginPaint(hWnd, &ps)) - { - RECT rcClient; - GetClientRect(hWnd, &rcClient); + if (BeginPaint(hWnd, &ps)) + { + RECT rcClient; + GetClientRect(hWnd, &rcClient); - BITMAP bmTL_top; - GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL_top); + BITMAP bmTL_top; + GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL_top); - HDC memdc = CreateCompatibleDC(ps.hdc); - HGDIOBJ save = SelectObject(memdc, hbmpBackgroundTop); - BitBlt(ps.hdc, 0, 0, bmTL_top.bmWidth, bmTL_top.bmHeight, memdc, 0, 0, SRCCOPY); - SelectObject(memdc, save); - DeleteDC(memdc); + HDC memdc = CreateCompatibleDC(ps.hdc); + HGDIOBJ save = SelectObject(memdc, hbmpBackgroundTop); + BitBlt(ps.hdc, 0, 0, bmTL_top.bmWidth, bmTL_top.bmHeight, memdc, 0, 0, SRCCOPY); + SelectObject(memdc, save); + DeleteDC(memdc); - EndPaint(hWnd, &ps); - } - } - break; - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDOK: - case IDCANCEL: - if (hbmpBackgroundTop) - { - DeleteObject(hbmpBackgroundTop); - } - if (hTextFont) - { - ::DeleteObject(hTextFont); - } - if (hPageHeadingFont) - { - ::DeleteObject(hPageHeadingFont); - } - if (hAuthorFont) - { - ::DeleteObject(hAuthorFont); - } - //ReleaseCapture(); - EndDialog(hWnd, 0); - break; - } - default: - return FALSE; - } - return TRUE; + EndPaint(hWnd, &ps); + } + } + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDOK: + case IDCANCEL: + if (hbmpBackgroundTop) + { + DeleteObject(hbmpBackgroundTop); + } + if (hTextFont) + { + ::DeleteObject(hTextFont); + } + if (hPageHeadingFont) + { + ::DeleteObject(hPageHeadingFont); + } + if (hAuthorFont) + { + ::DeleteObject(hAuthorFont); + } + //ReleaseCapture(); + EndDialog(hWnd, 0); + break; + } + default: + return FALSE; + } + return TRUE; } BOOL set_about_field(HWND hDlg, int nIDDlgItem, const wchar_t * config_string, const wchar_t * language_string) { - wchar_t temp_string[200]; + wchar_t temp_string[200]; - swprintf(temp_string, sizeof(temp_string) / sizeof(temp_string[0]), L"%s: %s", config_string, language_string); - return SetDlgItemTextW(hDlg, nIDDlgItem, temp_string); -} + swprintf(temp_string, sizeof(temp_string) / sizeof(temp_string[0]), L"%s: %s", config_string, language_string); + return SetDlgItemTextW(hDlg, nIDDlgItem, temp_string); +} \ No newline at end of file diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index 264bcc7c6..0ab6b34f6 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -11,6 +11,7 @@ #pragma once #include +#include class CGfxPlugin; //Plugin that controls the rendering class CAudioPlugin; //Plugin for audio, need the hwnd @@ -28,6 +29,7 @@ enum }; class CMainGui : + public RenderWindow, public CRomBrowser, public CDebuggerUI, private CGuiSettings @@ -80,10 +82,11 @@ public: void AboutBox(void); //Plugins - bool ResetPlugins ( CPlugins * plugins, CN64System * System ); + bool ResetPluginsInUiThread(CPlugins * plugins, CN64System * System); //Get Window Handle - inline HWND GetHandle ( void ) const { return m_hMainWindow; } + void * GetWindowHandle(void) const { return m_hMainWindow; } + void * GetStatusBar(void) const { return m_hStatusWnd; } private: CMainGui(void); // Disable default constructor diff --git a/Source/Project64/User Interface/Notification Class.cpp b/Source/Project64/User Interface/Notification Class.cpp index bbeb27394..764ea07ba 100644 --- a/Source/Project64/User Interface/Notification Class.cpp +++ b/Source/Project64/User Interface/Notification Class.cpp @@ -1,335 +1,322 @@ #include "stdafx.h" #include -CNotification & Notify ( void ) +CNotification & Notify(void) { - static CNotification g_Notify; - return g_Notify; + static CNotification g_Notify; + return g_Notify; } CNotification::CNotification() : - m_hWnd(NULL), - m_gfxPlugin(NULL), - m_NextMsg(0) +m_hWnd(NULL), +m_gfxPlugin(NULL), +m_NextMsg(0) { - _tzset(); + _tzset(); } void CNotification::AppInitDone(void) { - CNotificationSettings::RegisterNotifications(); + CNotificationSettings::RegisterNotifications(); } -void CNotification::SetMainWindow ( CMainGui * Gui ) +void CNotification::SetMainWindow(CMainGui * Gui) { - m_hWnd = Gui; + m_hWnd = Gui; } -void CNotification::WindowMode ( void ) const +void CNotification::WindowMode(void) const { - static bool InsideFunc = false; - if (InsideFunc) - { - return; - } - InsideFunc = true; - if (InFullScreen()) - { - ChangeFullScreen(); - for (int i = 0; i < 5; i++) - { - Sleep(50); - if (ProcessGuiMessages()) - { - break; - } - } - } - InsideFunc = false; + static bool InsideFunc = false; + if (InsideFunc) + { + return; + } + InsideFunc = true; + if (InFullScreen()) + { + ChangeFullScreen(); + for (int i = 0; i < 5; i++) + { + Sleep(50); + if (ProcessGuiMessages()) + { + break; + } + } + } + InsideFunc = false; } void CNotification::DisplayError(LanguageStringID StringID) const { - DisplayError(g_Lang->GetString(StringID).c_str()); + DisplayError(g_Lang->GetString(StringID).c_str()); } void CNotification::DisplayError(const wchar_t * Message) const { - if (this == NULL) { return; } + if (this == NULL) { return; } stdstr TraceMessage; - TraceMessage.FromUTF16(Message); - WriteTrace(TraceError,TraceMessage.c_str()); - WindowMode(); + TraceMessage.FromUTF16(Message); + WriteTrace(TraceError, TraceMessage.c_str()); + WindowMode(); - HWND Parent = NULL; - if (m_hWnd) - { - Parent = m_hWnd->GetHandle(); + HWND Parent = NULL; + if (m_hWnd) + { + Parent = reinterpret_cast(m_hWnd->GetWindowHandle()); } - MessageBoxW(Parent, Message, GS(MSG_MSGBOX_TITLE), MB_OK | MB_ICONERROR | MB_SETFOREGROUND); + MessageBoxW(Parent, Message, GS(MSG_MSGBOX_TITLE), MB_OK | MB_ICONERROR | MB_SETFOREGROUND); } void CNotification::DisplayMessage(int DisplayTime, LanguageStringID StringID) const { - DisplayMessage(DisplayTime, g_Lang->GetString(StringID).c_str()); + DisplayMessage(DisplayTime, g_Lang->GetString(StringID).c_str()); } void CNotification::DisplayMessage(int DisplayTime, const wchar_t * Message) const { - if (!m_hWnd) { return; } + if (!m_hWnd) { return; } - if (m_NextMsg > 0 || DisplayTime > 0) - { - time_t Now = time(NULL); - if (DisplayTime == 0 && Now < m_NextMsg) - { - return; - } - if (DisplayTime > 0) - { - m_NextMsg = Now + DisplayTime; - } - if (m_NextMsg == 0) - { - m_NextMsg = 0; - } - } - - if (InFullScreen()) - { - if (m_gfxPlugin && m_gfxPlugin->DrawStatus) - { - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": DrawStatus - Starting"); - stdstr PluginMessage; - PluginMessage.FromUTF16(Message); - m_gfxPlugin->DrawStatus(PluginMessage.c_str(), FALSE); - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": DrawStatus - Done"); - } - } - else + if (m_NextMsg > 0 || DisplayTime > 0) { -#if defined(WINDOWS_UI) - m_hWnd->SetStatusText(0, Message); -#else - g_Notify -> BreakPoint(__FILEW__, __LINE__); -#endif - } + time_t Now = time(NULL); + if (DisplayTime == 0 && Now < m_NextMsg) + { + return; + } + if (DisplayTime > 0) + { + m_NextMsg = Now + DisplayTime; + } + if (m_NextMsg == 0) + { + m_NextMsg = 0; + } + } + + if (InFullScreen()) + { + if (m_gfxPlugin && m_gfxPlugin->DrawStatus) + { + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": DrawStatus - Starting"); + stdstr PluginMessage; + PluginMessage.FromUTF16(Message); + m_gfxPlugin->DrawStatus(PluginMessage.c_str(), FALSE); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": DrawStatus - Done"); + } + } + else + { + m_hWnd->SetStatusText(0, Message); + } } -void CNotification::DisplayMessage2 ( const wchar_t * Message ) const +void CNotification::DisplayMessage2(const wchar_t * Message) const { - if (!m_hWnd) { return; } + if (!m_hWnd) { return; } -#if defined(WINDOWS_UI) - m_hWnd->SetStatusText(1, Message); -#else - g_Notify -> BreakPoint(__FILEW__, __LINE__); -#endif + m_hWnd->SetStatusText(1, Message); } -void CNotification::SetGfxPlugin( CGfxPlugin * Plugin ) +void CNotification::SetGfxPlugin(CGfxPlugin * Plugin) { - m_gfxPlugin = Plugin; + m_gfxPlugin = Plugin; } -void CNotification::SetWindowCaption (const wchar_t * Caption) +void CNotification::SetWindowCaption(const wchar_t * Caption) { - static const size_t TITLE_SIZE = 256; - wchar_t WinTitle[TITLE_SIZE]; + static const size_t TITLE_SIZE = 256; + wchar_t WinTitle[TITLE_SIZE]; - _snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", Caption, g_Settings->LoadStringVal(Setting_ApplicationName).ToUTF16().c_str()); - WinTitle[TITLE_SIZE - 1] = 0; + _snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", Caption, g_Settings->LoadStringVal(Setting_ApplicationName).ToUTF16().c_str()); + WinTitle[TITLE_SIZE - 1] = 0; #if defined(WINDOWS_UI) - m_hWnd->Caption(WinTitle); + m_hWnd->Caption(WinTitle); #else - g_Notify -> BreakPoint(__FILEW__, __LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); #endif } void CNotification::FatalError(LanguageStringID StringID) const { - FatalError(g_Lang->GetString(StringID).c_str()); + FatalError(g_Lang->GetString(StringID).c_str()); } void CNotification::FatalError(const wchar_t * Message) const { - WindowMode(); + WindowMode(); - HWND Parent = NULL; - if (m_hWnd) { Parent = reinterpret_cast(m_hWnd->GetHandle()); } - MessageBoxW(Parent, Message, L"Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); - ExitThread(0); + HWND Parent = NULL; + if (m_hWnd) { Parent = reinterpret_cast(m_hWnd->GetWindowHandle()); } + MessageBoxW(Parent, Message, L"Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); + ExitThread(0); } -void CNotification::AddRecentDir ( const char * RomDir ) +void CNotification::AddRecentDir(const char * RomDir) { - //Validate the passed string - if (HIWORD(RomDir) == NULL) { return; } + //Validate the passed string + if (HIWORD(RomDir) == NULL) { return; } - //Get Information about the stored rom list - size_t MaxRememberedDirs = g_Settings->LoadDword(Directory_RecentGameDirCount); - strlist RecentDirs; - size_t i; - for (i = 0; i < MaxRememberedDirs; i ++ ) - { - stdstr RecentDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex,i); - if (RecentDir.empty()) - { - break; - } - RecentDirs.push_back(RecentDir); - } - - //See if the dir is already in the list if so then move it to the top of the list - strlist::iterator iter; - for (iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++) - { - if (_stricmp(RomDir,iter->c_str()) != 0) - { - continue; - } - RecentDirs.erase(iter); - break; - } - RecentDirs.push_front(RomDir); - if (RecentDirs.size() > MaxRememberedDirs) - { - RecentDirs.pop_back(); - } - - for (i = 0, iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++, i++) - { - g_Settings->SaveStringIndex(Directory_RecentGameDirIndex,i,*iter); - } -} - -void CNotification::AddRecentRom ( const char * ImagePath ) -{ - if (HIWORD(ImagePath) == NULL) { return; } - - //Get Information about the stored rom list - size_t MaxRememberedFiles = g_Settings->LoadDword(File_RecentGameFileCount); - strlist RecentGames; - size_t i; - for (i = 0; i < MaxRememberedFiles; i ++ ) - { - stdstr RecentGame = g_Settings->LoadStringIndex(File_RecentGameFileIndex,i); - if (RecentGame.empty()) - { - break; - } - RecentGames.push_back(RecentGame); - } - - //See if the dir is already in the list if so then move it to the top of the list - strlist::iterator iter; - for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++) - { - if (_stricmp(ImagePath,iter->c_str()) != 0) - { - continue; - } - RecentGames.erase(iter); - break; - } - RecentGames.push_front(ImagePath); - if (RecentGames.size() > MaxRememberedFiles) - { - RecentGames.pop_back(); - } - - for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++) - { - g_Settings->SaveStringIndex(File_RecentGameFileIndex,i,*iter); - } -} - -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 ) -{ - if (m_hWnd == NULL) { return; } - m_hWnd->HideRomList(); -} - -void CNotification::ShowRomBrowser ( void ) -{ - if (m_hWnd == NULL) { return; } - if (g_Settings->LoadDword(RomBrowser_Enabled)) + //Get Information about the stored rom list + size_t MaxRememberedDirs = g_Settings->LoadDword(Directory_RecentGameDirCount); + strlist RecentDirs; + size_t i; + for (i = 0; i < MaxRememberedDirs; i++) { - //Display the rom browser - m_hWnd->ShowRomList(); - m_hWnd->HighLightLastRom(); - } -} - -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 -{ - if (m_hWnd == NULL) { return; } - SendMessage((HWND)(m_hWnd->GetHandle()),WM_COMMAND,MAKELPARAM(ID_OPTIONS_FULLSCREEN2,false),0); -} - -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 ) -{ - if (g_Settings->LoadBool(Debugger_Enabled)) - { - DisplayError(stdstr_f("Break point found at\n%ws\n%d", FileName, LineNumber).ToUTF16().c_str()); - if (IsDebuggerPresent() != 0) - { - DebugBreak(); - } - else + stdstr RecentDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, i); + if (RecentDir.empty()) { - g_BaseSystem->CloseCpu(); - } - } - else + break; + } + RecentDirs.push_back(RecentDir); + } + + //See if the dir is already in the list if so then move it to the top of the list + strlist::iterator iter; + for (iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++) { - DisplayError(L"Fatal Error: Stopping emulation"); - g_BaseSystem->CloseCpu(); - } + if (_stricmp(RomDir, iter->c_str()) != 0) + { + continue; + } + RecentDirs.erase(iter); + break; + } + RecentDirs.push_front(RomDir); + if (RecentDirs.size() > MaxRememberedDirs) + { + RecentDirs.pop_back(); + } + + for (i = 0, iter = RecentDirs.begin(); iter != RecentDirs.end(); iter++, i++) + { + g_Settings->SaveStringIndex(Directory_RecentGameDirIndex, i, *iter); + } } + +void CNotification::AddRecentRom(const char * ImagePath) +{ + if (HIWORD(ImagePath) == NULL) { return; } + + //Get Information about the stored rom list + size_t MaxRememberedFiles = g_Settings->LoadDword(File_RecentGameFileCount); + strlist RecentGames; + size_t i; + for (i = 0; i < MaxRememberedFiles; i++) + { + stdstr RecentGame = g_Settings->LoadStringIndex(File_RecentGameFileIndex, i); + if (RecentGame.empty()) + { + break; + } + RecentGames.push_back(RecentGame); + } + + //See if the dir is already in the list if so then move it to the top of the list + strlist::iterator iter; + for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++) + { + if (_stricmp(ImagePath, iter->c_str()) != 0) + { + continue; + } + RecentGames.erase(iter); + break; + } + RecentGames.push_front(ImagePath); + if (RecentGames.size() > MaxRememberedFiles) + { + RecentGames.pop_back(); + } + + for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++) + { + g_Settings->SaveStringIndex(File_RecentGameFileIndex, i, *iter); + } +} + +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) +{ + if (m_hWnd == NULL) { return; } + m_hWnd->HideRomList(); +} + +void CNotification::ShowRomBrowser(void) +{ + if (m_hWnd == NULL) { return; } + if (g_Settings->LoadDword(RomBrowser_Enabled)) + { + //Display the rom browser + m_hWnd->ShowRomList(); + m_hWnd->HighLightLastRom(); + } +} + +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 +{ + if (m_hWnd == NULL) { return; } + SendMessage((HWND)(m_hWnd->GetWindowHandle()), WM_COMMAND, MAKELPARAM(ID_OPTIONS_FULLSCREEN2, false), 0); +} + +bool CNotification::ProcessGuiMessages(void) const +{ + if (m_hWnd == NULL) { return false; } + + return m_hWnd->ProcessGuiMessages(); +} + +void CNotification::BreakPoint(const wchar_t * FileName, const int LineNumber) +{ + if (g_Settings->LoadBool(Debugger_Enabled)) + { + DisplayError(stdstr_f("Break point found at\n%ws\n%d", FileName, LineNumber).ToUTF16().c_str()); + if (IsDebuggerPresent() != 0) + { + DebugBreak(); + } + else + { + g_BaseSystem->CloseCpu(); + } + } + else + { + DisplayError(L"Fatal Error: Stopping emulation"); + g_BaseSystem->CloseCpu(); + } +} \ No newline at end of file From 89361c57139778c684b618f5d37c97de8d2fbb27 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 21:20:30 +1100 Subject: [PATCH 037/102] [Poject64] register callback for GameRunning_LoadingInProgress to refresh menu --- Source/Project64/N64 System/N64 Class.cpp | 8 -------- Source/Project64/User Interface/Gui Class.cpp | 7 +++++++ Source/Project64/User Interface/Gui Class.h | 1 + 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index b222b9958..9bfe6bdf3 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -180,13 +180,10 @@ bool CN64System::RunFileImage(const char * FileLoc) { return false; } - g_Settings->SaveBool(GameRunning_LoadingInProgress, true); - WriteTrace(TraceDebug, __FUNCTION__ ": Mark Rom as loading"); //Mark the rom as loading g_Settings->SaveBool(GameRunning_LoadingInProgress, true); - Notify().RefreshMenu(); //Try to load the passed N64 rom if (g_Rom == NULL) @@ -209,7 +206,6 @@ bool CN64System::RunFileImage(const char * FileLoc) Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); if (g_Settings->LoadDword(Setting_AutoStart) != 0) { @@ -227,7 +223,6 @@ bool CN64System::RunFileImage(const char * FileLoc) delete g_Rom; g_Rom = NULL; g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); return false; } return true; @@ -254,7 +249,6 @@ bool CN64System::EmulationStarting(HANDLE hThread, DWORD ThreadId) g_BaseSystem->m_CPU_ThreadID = ThreadId; WriteTrace(TraceDebug, __FUNCTION__ ": Setting up N64 system done"); g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); try { WriteTrace(TraceDebug, __FUNCTION__ ": Game set to auto start, starting"); @@ -271,7 +265,6 @@ bool CN64System::EmulationStarting(HANDLE hThread, DWORD ThreadId) WriteTrace(TraceError, __FUNCTION__ ": SetActiveSystem failed"); g_Notify->DisplayError(__FUNCTIONW__ L": Failed to Initialize N64 System"); g_Settings->SaveBool(GameRunning_LoadingInProgress, false); - Notify().RefreshMenu(); bRes = false; } return bRes; @@ -336,7 +329,6 @@ void CN64System::StartEmulation2(bool NewThread) g_Settings->SaveBool(GameRunning_LoadingInProgress, false); g_Notify->DisplayError(MSG_PLUGIN_NOT_INIT); - Notify().RefreshMenu(); Notify().ShowRomBrowser(); } diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index ee2394dbb..6ecc23c69 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -49,6 +49,7 @@ m_ResetInfo(NULL) g_Settings->RegisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged); g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); + g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); } //if this fails then it has already been created @@ -64,6 +65,7 @@ CMainGui::~CMainGui(void) g_Settings->UnregisterChangeCB(RomBrowser_Enabled, this, (CSettings::SettingChangedFunc)RomBowserEnabledChanged); g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); + g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); } if (m_hMainWindow) { @@ -111,6 +113,11 @@ void RomBowserEnabledChanged(CMainGui * Gui) } } +void CMainGui::LoadingInProgressChanged(CMainGui * Gui) +{ + Gui->RefreshMenu(); +} + void RomBowserColoumnsChanged(CMainGui * Gui) { Gui->ResetRomBrowserColomuns(); diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index 0ab6b34f6..6d06c4fb1 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -110,6 +110,7 @@ private: friend void RomBowserEnabledChanged(CMainGui * Gui); friend void RomBowserColoumnsChanged(CMainGui * Gui); friend void RomBrowserRecursiveChanged(CMainGui * Gui); + static void LoadingInProgressChanged(CMainGui * Gui); CBaseMenu * m_Menu; From c997b6b1d94cbbb923e153ee96c6c9d167aa20c3 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 21:38:10 +1100 Subject: [PATCH 038/102] [Project64] Get about ini window to be created with DialogBoxParamW --- Source/Project64/User Interface/Gui Class.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 6ecc23c69..843a8d89c 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -160,7 +160,7 @@ void CMainGui::AboutBox(void) void CMainGui::AboutIniBox(void) { - DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About_Ini), m_hMainWindow, (DLGPROC)AboutIniBoxProc, (LPARAM)this); + DialogBoxParamW(GetModuleHandle(NULL), MAKEINTRESOURCEW(IDD_About_Ini), m_hMainWindow, (DLGPROC)AboutIniBoxProc, (LPARAM)this); } DWORD CALLBACK AboutIniBoxProc(HWND hDlg, DWORD uMsg, DWORD wParam, DWORD /*lParam*/) @@ -173,10 +173,7 @@ DWORD CALLBACK AboutIniBoxProc(HWND hDlg, DWORD uMsg, DWORD wParam, DWORD /*lPar wchar_t String[200]; //Title - LONG_PTR originalWndProc = GetWindowLongPtrW(hDlg, GWLP_WNDPROC); - SetWindowLongPtrW(hDlg, GWLP_WNDPROC, (LONG_PTR)DefWindowProcW); SetWindowTextW(hDlg, GS(INI_TITLE)); - SetWindowLongPtrW(hDlg, GWLP_WNDPROC, originalWndProc); //Language SetDlgItemTextW(hDlg, IDC_LAN, GS(INI_CURRENT_LANG)); From 7f73838ffe1baf33015b4c9d173de280445388a5 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 21:47:34 +1100 Subject: [PATCH 039/102] [Project64] Move Settings.h in to Settings directory --- Source/Project64/Plugins/Plugin List.h | 2 +- Source/Project64/Project64.vcxproj | 2 +- Source/Project64/Project64.vcxproj.filters | 6 +++--- Source/Project64/{ => Settings}/Settings.h | 0 Source/Project64/User Interface.h | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) rename Source/Project64/{ => Settings}/Settings.h (100%) diff --git a/Source/Project64/Plugins/Plugin List.h b/Source/Project64/Plugins/Plugin List.h index f1ee46064..04a566351 100644 --- a/Source/Project64/Plugins/Plugin List.h +++ b/Source/Project64/Plugins/Plugin List.h @@ -10,7 +10,7 @@ ****************************************************************************/ #pragma once -#include +#include class CPluginList { diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj index 0cea30d80..517fca83e 100644 --- a/Source/Project64/Project64.vcxproj +++ b/Source/Project64/Project64.vcxproj @@ -183,7 +183,7 @@ - + diff --git a/Source/Project64/Project64.vcxproj.filters b/Source/Project64/Project64.vcxproj.filters index 1ae4ebd97..437ae1cbf 100644 --- a/Source/Project64/Project64.vcxproj.filters +++ b/Source/Project64/Project64.vcxproj.filters @@ -464,9 +464,6 @@ Header Files - - Header Files - Header Files @@ -833,5 +830,8 @@ Header Files + + Header Files\Settings Headers + \ No newline at end of file diff --git a/Source/Project64/Settings.h b/Source/Project64/Settings/Settings.h similarity index 100% rename from Source/Project64/Settings.h rename to Source/Project64/Settings/Settings.h diff --git a/Source/Project64/User Interface.h b/Source/Project64/User Interface.h index 9eaa923c0..1479e1d56 100644 --- a/Source/Project64/User Interface.h +++ b/Source/Project64/User Interface.h @@ -13,8 +13,8 @@ #pragma warning(disable:4786) #include "Support.h" -#include "Multilanguage.h" -#include "Settings.h" +#include +#include typedef unsigned char BYTE; typedef unsigned short WORD; From 51c89388c74d1944c07c9c0bfc7c2335306c4ad6 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 22:00:47 +1100 Subject: [PATCH 040/102] [Project64] Cleanup Settings.h --- .../N64 System/Mips/Register Class.h | 1 + Source/Project64/N64 System/Profiling Class.h | 1 + .../N64 System/Recompiler/Recompiler Ops.h | 2 + .../N64 System/Speed Limitor Class.h | 2 + Source/Project64/Plugins/Plugin Class.h | 2 +- Source/Project64/Settings/Settings.h | 468 +++++++++--------- Source/Project64/User Interface/Gui Class.h | 1 + 7 files changed, 238 insertions(+), 239 deletions(-) diff --git a/Source/Project64/N64 System/Mips/Register Class.h b/Source/Project64/N64 System/Mips/Register Class.h index c2715c579..f782c6ceb 100644 --- a/Source/Project64/N64 System/Mips/Register Class.h +++ b/Source/Project64/N64 System/Mips/Register Class.h @@ -10,6 +10,7 @@ ****************************************************************************/ #pragma once +#include //CPO registers by name class CP0registers { diff --git a/Source/Project64/N64 System/Profiling Class.h b/Source/Project64/N64 System/Profiling Class.h index 0bf5d392e..daa3bf40d 100644 --- a/Source/Project64/N64 System/Profiling Class.h +++ b/Source/Project64/N64 System/Profiling Class.h @@ -9,6 +9,7 @@ * * ****************************************************************************/ #pragma once +#include "N64 Types.h" typedef std::map PROFILE_ENRTIES; typedef PROFILE_ENRTIES::iterator PROFILE_ENRTY; diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h index e7cce48a6..ed231e850 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h @@ -10,6 +10,8 @@ ****************************************************************************/ #pragma once +#include +#include class CCodeSection; diff --git a/Source/Project64/N64 System/Speed Limitor Class.h b/Source/Project64/N64 System/Speed Limitor Class.h index 375d6bd82..7352d0c4d 100644 --- a/Source/Project64/N64 System/Speed Limitor Class.h +++ b/Source/Project64/N64 System/Speed Limitor Class.h @@ -10,6 +10,8 @@ ****************************************************************************/ #pragma once +#include "../Settings/Game Settings.h" + class CSpeedLimitor : private CGameSettings { diff --git a/Source/Project64/Plugins/Plugin Class.h b/Source/Project64/Plugins/Plugin Class.h index f0acbc5de..0ce075a91 100644 --- a/Source/Project64/Plugins/Plugin Class.h +++ b/Source/Project64/Plugins/Plugin Class.h @@ -10,7 +10,7 @@ ****************************************************************************/ #pragma once #include - +#include #ifndef PLUGIN_INFO_STRUCT #define PLUGIN_INFO_STRUCT diff --git a/Source/Project64/Settings/Settings.h b/Source/Project64/Settings/Settings.h index f4d74296b..f51b9700c 100644 --- a/Source/Project64/Settings/Settings.h +++ b/Source/Project64/Settings/Settings.h @@ -12,261 +12,253 @@ enum { - MaxPluginSetting = 65535 + MaxPluginSetting = 65535 }; enum SettingID { - //Default values - Default_None, - Default_Constant, + //Default values + Default_None, + Default_Constant, - //information - temp keys - Info_ShortCutsChanged, + //information - temp keys + Info_ShortCutsChanged, - //Support Files - SupportFile_Settings, - SupportFile_SettingsDefault, - SupportFile_RomDatabase, - SupportFile_RomDatabaseDefault, - SupportFile_Glide64RDB, - SupportFile_Glide64RDBDefault, - SupportFile_Cheats, - SupportFile_CheatsDefault, - SupportFile_Notes, - SupportFile_NotesDefault, - SupportFile_ExtInfo, - SupportFile_ExtInfoDefault, - SupportFile_ShortCuts, - SupportFile_ShortCutsDefault, - SupportFile_RomListCache, - SupportFile_RomListCacheDefault, - SupportFile_7zipCache, - SupportFile_7zipCacheDefault, + //Support Files + SupportFile_Settings, + SupportFile_SettingsDefault, + SupportFile_RomDatabase, + SupportFile_RomDatabaseDefault, + SupportFile_Glide64RDB, + SupportFile_Glide64RDBDefault, + SupportFile_Cheats, + SupportFile_CheatsDefault, + SupportFile_Notes, + SupportFile_NotesDefault, + SupportFile_ExtInfo, + SupportFile_ExtInfoDefault, + SupportFile_ShortCuts, + SupportFile_ShortCutsDefault, + SupportFile_RomListCache, + SupportFile_RomListCacheDefault, + SupportFile_7zipCache, + SupportFile_7zipCacheDefault, - //Settings - Setting_ApplicationName, - Setting_UseFromRegistry, - Setting_RdbEditor, - Setting_PluginPageFirst, - Setting_DisableScrSaver, - Setting_AutoSleep, - Setting_AutoStart, - Setting_AutoFullscreen, - Setting_CheckEmuRunning, - Setting_EraseGameDefaults, + //Settings + Setting_ApplicationName, + Setting_UseFromRegistry, + Setting_RdbEditor, + Setting_PluginPageFirst, + Setting_DisableScrSaver, + Setting_AutoSleep, + Setting_AutoStart, + Setting_AutoFullscreen, + Setting_CheckEmuRunning, + Setting_EraseGameDefaults, - Setting_AutoZipInstantSave, - Setting_RememberCheats, - Setting_LanguageDir, - Setting_LanguageDirDefault, - Setting_CurrentLanguage, + Setting_AutoZipInstantSave, + Setting_RememberCheats, + Setting_LanguageDir, + Setting_LanguageDirDefault, + Setting_CurrentLanguage, - //RDB TLB Settings - Rdb_GoodName, - Rdb_SaveChip, - Rdb_CpuType, - Rdb_RDRamSize, - Rdb_CounterFactor, - Rdb_UseTlb, - Rdb_DelayDP, - Rdb_DelaySi, - Rdb_32Bit, - Rdb_FastSP, - Rdb_Status, - Rdb_NotesCore, - Rdb_NotesPlugin, - Rdb_FixedAudio, - Rdb_SyncViaAudio, - Rdb_RspAudioSignal, - Rdb_TLB_VAddrStart, - Rdb_TLB_VAddrLen, - Rdb_TLB_PAddrStart, - Rdb_UseHleGfx, - Rdb_UseHleAudio, - Rdb_LoadRomToMemory, - Rdb_ScreenHertz, - Rdb_FuncLookupMode, - Rdb_RegCache, - Rdb_BlockLinking, - Rdb_SMM_StoreInstruc, - Rdb_SMM_Cache, - Rdb_SMM_PIDMA, - Rdb_SMM_TLB, - Rdb_SMM_Protect, - Rdb_SMM_ValidFunc, - Rdb_GameCheatFix, - Rdb_GameCheatFixPlugin, - Rdb_ViRefreshRate, - Rdb_AiCountPerBytes, - Rdb_AudioResetOnLoad, - Rdb_AllowROMWrites, - Rdb_CRC_Recalc, + //RDB TLB Settings + Rdb_GoodName, + Rdb_SaveChip, + Rdb_CpuType, + Rdb_RDRamSize, + Rdb_CounterFactor, + Rdb_UseTlb, + Rdb_DelayDP, + Rdb_DelaySi, + Rdb_32Bit, + Rdb_FastSP, + Rdb_Status, + Rdb_NotesCore, + Rdb_NotesPlugin, + Rdb_FixedAudio, + Rdb_SyncViaAudio, + Rdb_RspAudioSignal, + Rdb_TLB_VAddrStart, + Rdb_TLB_VAddrLen, + Rdb_TLB_PAddrStart, + Rdb_UseHleGfx, + Rdb_UseHleAudio, + Rdb_LoadRomToMemory, + Rdb_ScreenHertz, + Rdb_FuncLookupMode, + Rdb_RegCache, + Rdb_BlockLinking, + Rdb_SMM_StoreInstruc, + Rdb_SMM_Cache, + Rdb_SMM_PIDMA, + Rdb_SMM_TLB, + Rdb_SMM_Protect, + Rdb_SMM_ValidFunc, + Rdb_GameCheatFix, + Rdb_GameCheatFixPlugin, + Rdb_ViRefreshRate, + Rdb_AiCountPerBytes, + Rdb_AudioResetOnLoad, + Rdb_AllowROMWrites, + Rdb_CRC_Recalc, - //Individual Game Settings - Game_IniKey, - Game_GameName, - Game_GoodName, - Game_TempLoaded, - Game_SystemType, - Game_EditPlugin_Gfx, - Game_EditPlugin_Audio, - Game_EditPlugin_Contr, - Game_EditPlugin_RSP, - Game_Plugin_Gfx, - Game_Plugin_Audio, - Game_Plugin_Controller, - Game_Plugin_RSP, - Game_SaveChip, - Game_CpuType, - Game_LastSaveSlot, - Game_FixedAudio, - Game_SyncViaAudio, - Game_32Bit, - Game_SMM_Cache, - Game_SMM_Protect, - Game_SMM_ValidFunc, - Game_SMM_PIDMA, - Game_SMM_TLB, - Game_SMM_StoreInstruc, - Game_CurrentSaveState, - Game_RDRamSize, - Game_CounterFactor, - Game_UseTlb, - Game_DelayDP, - Game_DelaySI, - Game_FastSP, - Game_FuncLookupMode, - Game_RegCache, - Game_BlockLinking, - Game_ScreenHertz, - Game_RspAudioSignal, - Game_UseHleGfx, - Game_UseHleAudio, - Game_LoadRomToMemory, - Game_ViRefreshRate, - Game_AiCountPerBytes, - Game_AudioResetOnLoad, - Game_AllowROMWrites, - Game_CRC_Recalc, + //Individual Game Settings + Game_IniKey, + Game_GameName, + Game_GoodName, + Game_TempLoaded, + Game_SystemType, + Game_EditPlugin_Gfx, + Game_EditPlugin_Audio, + Game_EditPlugin_Contr, + Game_EditPlugin_RSP, + Game_Plugin_Gfx, + Game_Plugin_Audio, + Game_Plugin_Controller, + Game_Plugin_RSP, + Game_SaveChip, + Game_CpuType, + Game_LastSaveSlot, + Game_FixedAudio, + Game_SyncViaAudio, + Game_32Bit, + Game_SMM_Cache, + Game_SMM_Protect, + Game_SMM_ValidFunc, + Game_SMM_PIDMA, + Game_SMM_TLB, + Game_SMM_StoreInstruc, + Game_CurrentSaveState, + Game_RDRamSize, + Game_CounterFactor, + Game_UseTlb, + Game_DelayDP, + Game_DelaySI, + Game_FastSP, + Game_FuncLookupMode, + Game_RegCache, + Game_BlockLinking, + Game_ScreenHertz, + Game_RspAudioSignal, + Game_UseHleGfx, + Game_UseHleAudio, + Game_LoadRomToMemory, + Game_ViRefreshRate, + Game_AiCountPerBytes, + Game_AudioResetOnLoad, + Game_AllowROMWrites, + Game_CRC_Recalc, - // General Game running info - GameRunning_LoadingInProgress, - GameRunning_CPU_Running, - GameRunning_CPU_Paused, - GameRunning_CPU_PausedType, - GameRunning_InstantSaveFile, - GameRunning_LimitFPS, - GameRunning_ScreenHertz, - GameRunning_InReset, + // General Game running info + GameRunning_LoadingInProgress, + GameRunning_CPU_Running, + GameRunning_CPU_Paused, + GameRunning_CPU_PausedType, + GameRunning_InstantSaveFile, + GameRunning_LimitFPS, + GameRunning_ScreenHertz, + GameRunning_InReset, - //User Interface - UserInterface_BasicMode, - UserInterface_ShowCPUPer, - UserInterface_DisplayFrameRate, - UserInterface_InFullScreen, - UserInterface_FrameDisplayType, - UserInterface_MainWindowTop, - UserInterface_MainWindowLeft, - UserInterface_AlwaysOnTop, + //User Interface + UserInterface_BasicMode, + UserInterface_ShowCPUPer, + UserInterface_DisplayFrameRate, + UserInterface_InFullScreen, + UserInterface_FrameDisplayType, + UserInterface_MainWindowTop, + UserInterface_MainWindowLeft, + UserInterface_AlwaysOnTop, - RomBrowser_Enabled, - RomBrowser_ColoumnsChanged, - RomBrowser_Top, - RomBrowser_Left, - RomBrowser_Width, - RomBrowser_Height, - RomBrowser_PosIndex, - RomBrowser_WidthIndex, - RomBrowser_SortFieldIndex, - RomBrowser_SortAscendingIndex, - RomBrowser_Recursive, - RomBrowser_Maximized, + RomBrowser_Enabled, + RomBrowser_ColoumnsChanged, + RomBrowser_Top, + RomBrowser_Left, + RomBrowser_Width, + RomBrowser_Height, + RomBrowser_PosIndex, + RomBrowser_WidthIndex, + RomBrowser_SortFieldIndex, + RomBrowser_SortAscendingIndex, + RomBrowser_Recursive, + RomBrowser_Maximized, - //Directory Info - Directory_LastSave, - Directory_RecentGameDirCount, - Directory_RecentGameDirIndex, - Directory_Game, - Directory_GameInitial, - Directory_GameSelected, - Directory_GameUseSelected, - Directory_Plugin, - Directory_PluginInitial, - Directory_PluginSelected, - Directory_PluginUseSelected, - Directory_PluginSync, - Directory_SnapShot, - Directory_SnapShotInitial, - Directory_SnapShotSelected, - Directory_SnapShotUseSelected, - Directory_NativeSave, - Directory_NativeSaveInitial, - Directory_NativeSaveSelected, - Directory_NativeSaveUseSelected, - Directory_InstantSave, - Directory_InstantSaveInitial, - Directory_InstantSaveSelected, - Directory_InstantSaveUseSelected, - Directory_Texture, - Directory_TextureInitial, - Directory_TextureSelected, - Directory_TextureUseSelected, + //Directory Info + Directory_LastSave, + Directory_RecentGameDirCount, + Directory_RecentGameDirIndex, + Directory_Game, + Directory_GameInitial, + Directory_GameSelected, + Directory_GameUseSelected, + Directory_Plugin, + Directory_PluginInitial, + Directory_PluginSelected, + Directory_PluginUseSelected, + Directory_PluginSync, + Directory_SnapShot, + Directory_SnapShotInitial, + Directory_SnapShotSelected, + Directory_SnapShotUseSelected, + Directory_NativeSave, + Directory_NativeSaveInitial, + Directory_NativeSaveSelected, + Directory_NativeSaveUseSelected, + Directory_InstantSave, + Directory_InstantSaveInitial, + Directory_InstantSaveSelected, + Directory_InstantSaveUseSelected, + Directory_Texture, + Directory_TextureInitial, + Directory_TextureSelected, + Directory_TextureUseSelected, - //File Info - File_RecentGameFileCount, - File_RecentGameFileIndex, + //File Info + File_RecentGameFileCount, + File_RecentGameFileIndex, - //Debugger - Debugger_Enabled, - Debugger_ShowTLBMisses, - Debugger_ShowUnhandledMemory, - Debugger_ShowPifErrors, - Debugger_ShowDivByZero, - Debugger_GenerateLogFiles, - Debugger_ProfileCode, - Debugger_DisableGameFixes, - Debugger_AppLogLevel, - Debugger_AppLogFlush, - Debugger_GenerateDebugLog, - Debugger_ShowDListAListCount, - Debugger_ShowRecompMemSize, + //Debugger + Debugger_Enabled, + Debugger_ShowTLBMisses, + Debugger_ShowUnhandledMemory, + Debugger_ShowPifErrors, + Debugger_ShowDivByZero, + Debugger_GenerateLogFiles, + Debugger_ProfileCode, + Debugger_DisableGameFixes, + Debugger_AppLogLevel, + Debugger_AppLogFlush, + Debugger_GenerateDebugLog, + Debugger_ShowDListAListCount, + Debugger_ShowRecompMemSize, - //Plugins - Plugin_RSP_Current, - Plugin_RSP_CurVer, - Plugin_GFX_Current, - Plugin_GFX_CurVer, - Plugin_AUDIO_Current, - Plugin_AUDIO_CurVer, - Plugin_CONT_Current, - Plugin_CONT_CurVer, - Plugin_UseHleGfx, - Plugin_UseHleAudio, + //Plugins + Plugin_RSP_Current, + Plugin_RSP_CurVer, + Plugin_GFX_Current, + Plugin_GFX_CurVer, + Plugin_AUDIO_Current, + Plugin_AUDIO_CurVer, + Plugin_CONT_Current, + Plugin_CONT_CurVer, + Plugin_UseHleGfx, + Plugin_UseHleAudio, - //Cheats - Cheat_Entry, - Cheat_Active, - Cheat_Extension, - Cheat_Notes, - Cheat_Options, - Cheat_Range, - Cheat_RangeNotes, + //Cheats + Cheat_Entry, + Cheat_Active, + Cheat_Extension, + Cheat_Notes, + Cheat_Options, + Cheat_Range, + Cheat_RangeNotes, - FirstRSPDefaultSet, LastRSPDefaultSet = FirstRSPDefaultSet + MaxPluginSetting, - FirstRSPSettings, LastRSPSettings = FirstRSPSettings + MaxPluginSetting, - FirstGfxDefaultSet, LastGfxDefaultSet = FirstGfxDefaultSet + MaxPluginSetting, - FirstGfxSettings, LastGfxSettings = FirstGfxSettings + MaxPluginSetting, - FirstAudioDefaultSet, LastAudioDefaultSet = FirstAudioDefaultSet + MaxPluginSetting, - FirstAudioSettings, LastAudioSettings = FirstAudioSettings + MaxPluginSetting, - FirstCtrlDefaultSet, LastCtrlDefaultSet = FirstCtrlDefaultSet + MaxPluginSetting, - FirstCtrlSettings, LastCtrlSettings = FirstCtrlSettings + MaxPluginSetting, + FirstRSPDefaultSet, LastRSPDefaultSet = FirstRSPDefaultSet + MaxPluginSetting, + FirstRSPSettings, LastRSPSettings = FirstRSPSettings + MaxPluginSetting, + FirstGfxDefaultSet, LastGfxDefaultSet = FirstGfxDefaultSet + MaxPluginSetting, + FirstGfxSettings, LastGfxSettings = FirstGfxSettings + MaxPluginSetting, + FirstAudioDefaultSet, LastAudioDefaultSet = FirstAudioDefaultSet + MaxPluginSetting, + FirstAudioSettings, LastAudioSettings = FirstAudioSettings + MaxPluginSetting, + FirstCtrlDefaultSet, LastCtrlDefaultSet = FirstCtrlDefaultSet + MaxPluginSetting, + FirstCtrlSettings, LastCtrlSettings = FirstCtrlSettings + MaxPluginSetting, }; - -#include "Support.h" -#include "./Settings/Settings Class.h" -#include "./Settings/Debug Settings.h" -#include "./Settings/Game Settings.h" -#include "./Settings/Recompiler Settings.h" -#include "./Settings/N64System Settings.h" -#include "./Settings/Gui Settings.h" diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index 6d06c4fb1..6cbdc625f 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -10,6 +10,7 @@ ****************************************************************************/ #pragma once +#include "../Settings/Gui Settings.h" #include #include From 73d7263de0f7ad368abff84d881005b0e9a0b3a0 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 22:27:19 +1100 Subject: [PATCH 041/102] [Project64] Add GameLoaded setting --- Source/Project64/N64 System/N64 Class.cpp | 11 +- Source/Project64/Settings/Settings Class.cpp | 852 +++++++++--------- Source/Project64/Settings/Settings.h | 1 + Source/Project64/User Interface/Gui Class.cpp | 15 + Source/Project64/User Interface/Gui Class.h | 1 + 5 files changed, 463 insertions(+), 417 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 9bfe6bdf3..6b4b9c732 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -181,6 +181,7 @@ bool CN64System::RunFileImage(const char * FileLoc) return false; } WriteTrace(TraceDebug, __FUNCTION__ ": Mark Rom as loading"); + g_Settings->SaveString(Game_File, ""); //Mark the rom as loading g_Settings->SaveBool(GameRunning_LoadingInProgress, true); @@ -201,10 +202,7 @@ bool CN64System::RunFileImage(const char * FileLoc) { g_System->RefreshGameSettings(); - WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); - Notify().AddRecentRom(FileLoc); - Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); - + g_Settings->SaveString(Game_File, FileLoc); g_Settings->SaveBool(GameRunning_LoadingInProgress, false); if (g_Settings->LoadDword(Setting_AutoStart) != 0) @@ -275,9 +273,6 @@ void CN64System::StartEmulation2(bool NewThread) if (NewThread) { WriteTrace(TraceDebug, __FUNCTION__ ": Starting"); - - Notify().HideRomBrowser(); - if (bHaveDebugger()) { g_LogOptions.GenerateLog = g_Settings->LoadBool(Debugger_GenerateDebugLog); @@ -1805,7 +1800,7 @@ bool CN64System::LoadState(LPCSTR FileName) SetActiveSystem(true); SyncCPU(m_SyncCPU); } - } +} WriteTrace(TraceDebug, __FUNCTION__ ": 13"); std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE); g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str()); diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index 6e1e943c2..b6a4a6400 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -35,7 +35,7 @@ CSettings * g_Settings = NULL; CSettings::CSettings() : - m_NextAutoSettingId(0x200000) +m_NextAutoSettingId(0x200000) { } @@ -63,14 +63,14 @@ CSettings::~CSettings() } } -void CSettings::AddHandler ( SettingID TypeID, CSettingType * Handler ) +void CSettings::AddHandler(SettingID TypeID, CSettingType * Handler) { - SETTING_MAP::_Pairib res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID,Handler)); + SETTING_MAP::_Pairib res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID, Handler)); if (!res.second) { delete res.first->second; m_SettingInfo.erase(res.first); - res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID,Handler)); + res = m_SettingInfo.insert(SETTING_MAP::value_type(TypeID, Handler)); if (!res.second) { delete Handler; @@ -78,183 +78,184 @@ void CSettings::AddHandler ( SettingID TypeID, CSettingType * Handler ) } } -void CSettings::AddHowToHandleSetting () +void CSettings::AddHowToHandleSetting() { //information - temp keys - AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false)); + AddHandler(Info_ShortCutsChanged, new CSettingTypeTempBool(false)); //Support Files - AddHandler(SupportFile_Settings, new CSettingTypeApplicationPath("","ConfigFile",SupportFile_SettingsDefault)); - AddHandler(SupportFile_SettingsDefault, new CSettingTypeRelativePath("Config","Project64.cfg")); - AddHandler(SupportFile_RomDatabase, new CSettingTypeApplicationPath("","RomDatabase",SupportFile_RomDatabaseDefault)); - AddHandler(SupportFile_RomDatabaseDefault, new CSettingTypeRelativePath("Config","Project64.rdb")); - AddHandler(SupportFile_Glide64RDB, new CSettingTypeApplicationPath("","Glide64RDB",SupportFile_Glide64RDBDefault)); - AddHandler(SupportFile_Glide64RDBDefault, new CSettingTypeRelativePath("Config","Glide64.rdb")); - AddHandler(SupportFile_Cheats, new CSettingTypeApplicationPath("","Cheats",SupportFile_CheatsDefault)); - AddHandler(SupportFile_CheatsDefault, new CSettingTypeRelativePath("Config","Project64.cht")); - AddHandler(SupportFile_Notes, new CSettingTypeApplicationPath("","Notes",SupportFile_NotesDefault)); - AddHandler(SupportFile_NotesDefault, new CSettingTypeRelativePath("Config","Project64.rdn")); - AddHandler(SupportFile_ExtInfo, new CSettingTypeApplicationPath("","ExtInfo",SupportFile_ExtInfoDefault)); - AddHandler(SupportFile_ExtInfoDefault, new CSettingTypeRelativePath("Config","Project64.rdx")); - AddHandler(SupportFile_ShortCuts, new CSettingTypeApplicationPath("","ShortCuts",SupportFile_ShortCutsDefault)); - AddHandler(SupportFile_ShortCutsDefault, new CSettingTypeRelativePath("Config","Project64.sc3")); - AddHandler(SupportFile_RomListCache, new CSettingTypeApplicationPath("","RomListCache",SupportFile_RomListCacheDefault)); - AddHandler(SupportFile_RomListCacheDefault,new CSettingTypeRelativePath("Config","Project64.cache3")); - AddHandler(SupportFile_7zipCache, new CSettingTypeApplicationPath("","7zipCache",SupportFile_7zipCacheDefault)); - AddHandler(SupportFile_7zipCacheDefault, new CSettingTypeRelativePath("Config","Project64.zcache")); + AddHandler(SupportFile_Settings, new CSettingTypeApplicationPath("", "ConfigFile", SupportFile_SettingsDefault)); + AddHandler(SupportFile_SettingsDefault, new CSettingTypeRelativePath("Config", "Project64.cfg")); + AddHandler(SupportFile_RomDatabase, new CSettingTypeApplicationPath("", "RomDatabase", SupportFile_RomDatabaseDefault)); + AddHandler(SupportFile_RomDatabaseDefault, new CSettingTypeRelativePath("Config", "Project64.rdb")); + AddHandler(SupportFile_Glide64RDB, new CSettingTypeApplicationPath("", "Glide64RDB", SupportFile_Glide64RDBDefault)); + AddHandler(SupportFile_Glide64RDBDefault, new CSettingTypeRelativePath("Config", "Glide64.rdb")); + AddHandler(SupportFile_Cheats, new CSettingTypeApplicationPath("", "Cheats", SupportFile_CheatsDefault)); + AddHandler(SupportFile_CheatsDefault, new CSettingTypeRelativePath("Config", "Project64.cht")); + AddHandler(SupportFile_Notes, new CSettingTypeApplicationPath("", "Notes", SupportFile_NotesDefault)); + AddHandler(SupportFile_NotesDefault, new CSettingTypeRelativePath("Config", "Project64.rdn")); + AddHandler(SupportFile_ExtInfo, new CSettingTypeApplicationPath("", "ExtInfo", SupportFile_ExtInfoDefault)); + AddHandler(SupportFile_ExtInfoDefault, new CSettingTypeRelativePath("Config", "Project64.rdx")); + AddHandler(SupportFile_ShortCuts, new CSettingTypeApplicationPath("", "ShortCuts", SupportFile_ShortCutsDefault)); + AddHandler(SupportFile_ShortCutsDefault, new CSettingTypeRelativePath("Config", "Project64.sc3")); + AddHandler(SupportFile_RomListCache, new CSettingTypeApplicationPath("", "RomListCache", SupportFile_RomListCacheDefault)); + AddHandler(SupportFile_RomListCacheDefault, new CSettingTypeRelativePath("Config", "Project64.cache3")); + AddHandler(SupportFile_7zipCache, new CSettingTypeApplicationPath("", "7zipCache", SupportFile_7zipCacheDefault)); + AddHandler(SupportFile_7zipCacheDefault, new CSettingTypeRelativePath("Config", "Project64.zcache")); //AddHandler(SyncPluginDir, new CSettingTypeRelativePath("SyncPlugin","")); //Settings location AddHandler(Setting_ApplicationName, new CSettingTypeTempString("")); - AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings","Use Registry",(uint32_t)false)); - AddHandler(Setting_RdbEditor, new CSettingTypeApplication("","Rdb Editor", false)); - AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("","Plugin Page First", false)); - AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("","Disable Screen Saver",(uint32_t)true)); - AddHandler(Setting_AutoSleep, new CSettingTypeApplication("","Auto Sleep", (uint32_t)true)); - AddHandler(Setting_AutoStart, new CSettingTypeApplication("","Auto Start", (uint32_t)true)); - AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("","Auto Full Screen", (uint32_t)false)); - AddHandler(Setting_AutoZipInstantSave,new CSettingTypeApplication("","Auto Zip Saves", (uint32_t)true)); - AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("","Erase on default", (uint32_t)true)); - AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("","Check Running", (uint32_t)true)); + AddHandler(Setting_UseFromRegistry, new CSettingTypeApplication("Settings", "Use Registry", (uint32_t)false)); + AddHandler(Setting_RdbEditor, new CSettingTypeApplication("", "Rdb Editor", false)); + AddHandler(Setting_PluginPageFirst, new CSettingTypeApplication("", "Plugin Page First", false)); + AddHandler(Setting_DisableScrSaver, new CSettingTypeApplication("", "Disable Screen Saver", (uint32_t)true)); + AddHandler(Setting_AutoSleep, new CSettingTypeApplication("", "Auto Sleep", (uint32_t)true)); + AddHandler(Setting_AutoStart, new CSettingTypeApplication("", "Auto Start", (uint32_t)true)); + AddHandler(Setting_AutoFullscreen, new CSettingTypeApplication("", "Auto Full Screen", (uint32_t)false)); + AddHandler(Setting_AutoZipInstantSave, new CSettingTypeApplication("", "Auto Zip Saves", (uint32_t)true)); + AddHandler(Setting_EraseGameDefaults, new CSettingTypeApplication("", "Erase on default", (uint32_t)true)); + AddHandler(Setting_CheckEmuRunning, new CSettingTypeApplication("", "Check Running", (uint32_t)true)); - AddHandler(Setting_RememberCheats, new CSettingTypeApplication("","Remember Cheats", (uint32_t)false)); - AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("","Current Language","")); - AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang","")); - AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Directory","Lang",Setting_LanguageDirDefault)); + AddHandler(Setting_RememberCheats, new CSettingTypeApplication("", "Remember Cheats", (uint32_t)false)); + AddHandler(Setting_CurrentLanguage, new CSettingTypeApplication("", "Current Language", "")); + AddHandler(Setting_LanguageDirDefault, new CSettingTypeRelativePath("Lang", "")); + AddHandler(Setting_LanguageDir, new CSettingTypeApplicationPath("Directory", "Lang", Setting_LanguageDirDefault)); - AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name",Game_GameName)); - AddHandler(Rdb_SaveChip, new CSettingTypeRDBSaveChip("Save Type",SaveChip_Auto)); + AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name", Game_GameName)); + AddHandler(Rdb_SaveChip, new CSettingTypeRDBSaveChip("Save Type", SaveChip_Auto)); #ifdef _DEBUG - AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type",CPU_SyncCores)); + AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_SyncCores)); #else - AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type",CPU_Recompiler)); + AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type", CPU_Recompiler)); #endif - AddHandler(Rdb_RDRamSize, new CSettingTypeRDBRDRamSize("RDRAM Size",0x400000)); - AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor",2)); - AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB",true)); - AddHandler(Rdb_DelayDP, new CSettingTypeRDBYesNo("Delay DP",true)); - AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI",false)); - AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit",true)); - AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP",true)); - AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status","Unknown")); - AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note","")); - AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note","")); + AddHandler(Rdb_RDRamSize, new CSettingTypeRDBRDRamSize("RDRAM Size", 0x400000)); + AddHandler(Rdb_CounterFactor, new CSettingTypeRomDatabase("Counter Factor", 2)); + AddHandler(Rdb_UseTlb, new CSettingTypeRDBYesNo("Use TLB", true)); + AddHandler(Rdb_DelayDP, new CSettingTypeRDBYesNo("Delay DP", true)); + AddHandler(Rdb_DelaySi, new CSettingTypeRDBYesNo("Delay SI", false)); + AddHandler(Rdb_32Bit, new CSettingTypeRDBYesNo("32bit", true)); + AddHandler(Rdb_FastSP, new CSettingTypeRDBYesNo("Fast SP", true)); + AddHandler(Rdb_Status, new CSettingTypeRomDatabase("Status", "Unknown")); + AddHandler(Rdb_NotesCore, new CSettingTypeRomDatabase("Core Note", "")); + AddHandler(Rdb_NotesPlugin, new CSettingTypeRomDatabase("Plugin Note", "")); #ifdef _DEBUG - AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio",true)); + AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", true)); #else - AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio",false)); + AddHandler(Rdb_FixedAudio, new CSettingTypeRomDatabase("Fixed Audio", false)); #endif - AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio",true)); - AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal",false)); - AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start",0)); - AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len",0)); - AddHandler(Rdb_TLB_PAddrStart, new CSettingTypeRomDatabase("TLB: PAddr Start",0)); - AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX",Plugin_UseHleGfx)); - AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio",Plugin_UseHleAudio)); - AddHandler(Rdb_LoadRomToMemory, new CSettingTypeRomDatabase("Rom In Memory",false)); - AddHandler(Rdb_ScreenHertz, new CSettingTypeRomDatabase("ScreenHertz",0)); - AddHandler(Rdb_FuncLookupMode, new CSettingTypeRomDatabase("FuncFind",FuncFind_PhysicalLookup)); - AddHandler(Rdb_RegCache, new CSettingTypeRDBYesNo("Reg Cache",true)); - AddHandler(Rdb_BlockLinking, new CSettingTypeRDBOnOff("Linking",true)); - AddHandler(Rdb_SMM_Cache, new CSettingTypeRomDatabase("SMM-Cache",true)); - AddHandler(Rdb_SMM_StoreInstruc, new CSettingTypeRomDatabase("SMM-StoreInstr",false)); - AddHandler(Rdb_SMM_PIDMA, new CSettingTypeRomDatabase("SMM-PI DMA",true)); - AddHandler(Rdb_SMM_TLB, new CSettingTypeRomDatabase("SMM-TLB",true)); - AddHandler(Rdb_SMM_Protect, new CSettingTypeRomDatabase("SMM-Protect",false)); - AddHandler(Rdb_SMM_ValidFunc, new CSettingTypeRomDatabase("SMM-FUNC",true)); - AddHandler(Rdb_GameCheatFix, new CSettingTypeRomDatabaseIndex("Cheat","","")); - AddHandler(Rdb_GameCheatFixPlugin, new CSettingTypeRomDatabaseIndex("CheatPlugin","","")); - AddHandler(Rdb_ViRefreshRate, new CSettingTypeRomDatabase("ViRefresh",1500)); - AddHandler(Rdb_AiCountPerBytes, new CSettingTypeRomDatabase("AiCountPerBytes",400)); - AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false)); - AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false)); - AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false)); + AddHandler(Rdb_SyncViaAudio, new CSettingTypeRomDatabase("Sync Audio", true)); + AddHandler(Rdb_RspAudioSignal, new CSettingTypeRDBYesNo("Audio Signal", false)); + AddHandler(Rdb_TLB_VAddrStart, new CSettingTypeRomDatabase("TLB: Vaddr Start", 0)); + AddHandler(Rdb_TLB_VAddrLen, new CSettingTypeRomDatabase("TLB: Vaddr Len", 0)); + AddHandler(Rdb_TLB_PAddrStart, new CSettingTypeRomDatabase("TLB: PAddr Start", 0)); + AddHandler(Rdb_UseHleGfx, new CSettingTypeRomDatabase("HLE GFX", Plugin_UseHleGfx)); + AddHandler(Rdb_UseHleAudio, new CSettingTypeRomDatabase("HLE Audio", Plugin_UseHleAudio)); + AddHandler(Rdb_LoadRomToMemory, new CSettingTypeRomDatabase("Rom In Memory", false)); + AddHandler(Rdb_ScreenHertz, new CSettingTypeRomDatabase("ScreenHertz", 0)); + AddHandler(Rdb_FuncLookupMode, new CSettingTypeRomDatabase("FuncFind", FuncFind_PhysicalLookup)); + AddHandler(Rdb_RegCache, new CSettingTypeRDBYesNo("Reg Cache", true)); + AddHandler(Rdb_BlockLinking, new CSettingTypeRDBOnOff("Linking", true)); + AddHandler(Rdb_SMM_Cache, new CSettingTypeRomDatabase("SMM-Cache", true)); + AddHandler(Rdb_SMM_StoreInstruc, new CSettingTypeRomDatabase("SMM-StoreInstr", false)); + AddHandler(Rdb_SMM_PIDMA, new CSettingTypeRomDatabase("SMM-PI DMA", true)); + AddHandler(Rdb_SMM_TLB, new CSettingTypeRomDatabase("SMM-TLB", true)); + AddHandler(Rdb_SMM_Protect, new CSettingTypeRomDatabase("SMM-Protect", false)); + AddHandler(Rdb_SMM_ValidFunc, new CSettingTypeRomDatabase("SMM-FUNC", true)); + AddHandler(Rdb_GameCheatFix, new CSettingTypeRomDatabaseIndex("Cheat", "", "")); + AddHandler(Rdb_GameCheatFixPlugin, new CSettingTypeRomDatabaseIndex("CheatPlugin", "", "")); + AddHandler(Rdb_ViRefreshRate, new CSettingTypeRomDatabase("ViRefresh", 1500)); + AddHandler(Rdb_AiCountPerBytes, new CSettingTypeRomDatabase("AiCountPerBytes", 400)); + AddHandler(Rdb_AudioResetOnLoad, new CSettingTypeRDBYesNo("AudioResetOnLoad", false)); + AddHandler(Rdb_AllowROMWrites, new CSettingTypeRDBYesNo("AllowROMWrites", false)); + AddHandler(Rdb_CRC_Recalc, new CSettingTypeRDBYesNo("CRC-Recalc", false)); - AddHandler(Game_IniKey, new CSettingTypeTempString("")); - AddHandler(Game_GameName, new CSettingTypeTempString("")); - AddHandler(Game_GoodName, new CSettingTypeGame("Good Name",Rdb_GoodName)); - AddHandler(Game_TempLoaded, new CSettingTypeTempBool(false)); - AddHandler(Game_SystemType, new CSettingTypeTempNumber(SYSTEM_NTSC)); - AddHandler(Game_EditPlugin_Gfx, new CSettingTypeGame("Plugin-Gfx",Default_None)); - AddHandler(Game_EditPlugin_Audio, new CSettingTypeGame("Plugin-Audio",Default_None)); - AddHandler(Game_EditPlugin_Contr, new CSettingTypeGame("Plugin-Controller",Default_None)); - AddHandler(Game_EditPlugin_RSP, new CSettingTypeGame("Plugin-RSP",Default_None)); - AddHandler(Game_Plugin_Gfx, new CSettingTypeGame("Plugin-Gfx",Plugin_GFX_Current)); - AddHandler(Game_Plugin_Audio, new CSettingTypeGame("Plugin-Audio",Plugin_AUDIO_Current)); - AddHandler(Game_Plugin_Controller, new CSettingTypeGame("Plugin-Controller",Plugin_CONT_Current)); - AddHandler(Game_Plugin_RSP, new CSettingTypeGame("Plugin-RSP",Plugin_RSP_Current)); - AddHandler(Game_SaveChip, new CSettingTypeGame("SaveChip",Rdb_SaveChip)); - AddHandler(Game_CpuType, new CSettingTypeGame("CpuType",Rdb_CpuType)); - AddHandler(Game_LastSaveSlot, new CSettingTypeGame("Last Used Save Slot",(uint32_t)0)); - AddHandler(Game_FixedAudio, new CSettingTypeGame("Fixed Audio",Rdb_FixedAudio)); - AddHandler(Game_RDRamSize, new CSettingTypeGame("RDRamSize",Rdb_RDRamSize)); - AddHandler(Game_CounterFactor, new CSettingTypeGame("Counter Factor",Rdb_CounterFactor)); - AddHandler(Game_UseTlb, new CSettingTypeGame("Use TLB",Rdb_UseTlb)); - AddHandler(Game_DelayDP, new CSettingTypeGame("Delay DP",Rdb_DelayDP)); - AddHandler(Game_DelaySI, new CSettingTypeGame("Delay SI",Rdb_DelaySi)); - AddHandler(Game_RspAudioSignal, new CSettingTypeGame("Audio Signal",Rdb_RspAudioSignal)); - AddHandler(Game_32Bit, new CSettingTypeGame("32bit",Rdb_32Bit)); - AddHandler(Game_FastSP, new CSettingTypeGame("Fast SP",Rdb_FastSP)); - AddHandler(Game_CurrentSaveState, new CSettingTypeTempNumber(0)); - AddHandler(Game_SyncViaAudio, new CSettingTypeGame("Sync Audio",Rdb_SyncViaAudio)); - AddHandler(Game_UseHleGfx, new CSettingTypeGame("HLE GFX",Rdb_UseHleGfx)); - AddHandler(Game_UseHleAudio, new CSettingTypeGame("HLE Audio",Rdb_UseHleAudio)); - AddHandler(Game_LoadRomToMemory, new CSettingTypeGame("Rom In Memory",Rdb_LoadRomToMemory)); - AddHandler(Game_ScreenHertz, new CSettingTypeGame("ScreenHertz",Rdb_ScreenHertz)); - AddHandler(Game_FuncLookupMode, new CSettingTypeGame("FuncFind",Rdb_FuncLookupMode)); - AddHandler(Game_RegCache, new CSettingTypeGame("Reg Cache",Rdb_RegCache)); - AddHandler(Game_BlockLinking, new CSettingTypeGame("Linking",Rdb_BlockLinking)); - AddHandler(Game_SMM_StoreInstruc, new CSettingTypeGame("SMM-StoreInst",Rdb_SMM_StoreInstruc)); - AddHandler(Game_SMM_Cache, new CSettingTypeGame("SMM-Cache",Rdb_SMM_Cache)); - AddHandler(Game_SMM_PIDMA, new CSettingTypeGame("SMM-PI DMA",Rdb_SMM_PIDMA)); - AddHandler(Game_SMM_TLB, new CSettingTypeGame("SMM-TLB",Rdb_SMM_TLB)); - AddHandler(Game_SMM_Protect, new CSettingTypeGame("SMM-Protect",Rdb_SMM_Protect)); - AddHandler(Game_SMM_ValidFunc, new CSettingTypeGame("SMM-FUNC",Rdb_SMM_ValidFunc)); - AddHandler(Game_ViRefreshRate, new CSettingTypeGame("ViRefresh",Rdb_ViRefreshRate)); - AddHandler(Game_AiCountPerBytes, new CSettingTypeGame("AiCountPerBytes",Rdb_AiCountPerBytes)); - AddHandler(Game_AudioResetOnLoad, new CSettingTypeGame("AudioResetOnLoad", Rdb_AudioResetOnLoad)); - AddHandler(Game_AllowROMWrites, new CSettingTypeGame("AllowROMWrites", Rdb_AllowROMWrites)); - AddHandler(Game_CRC_Recalc, new CSettingTypeGame("CRC-Recalc", Rdb_CRC_Recalc)); + AddHandler(Game_IniKey, new CSettingTypeTempString("")); + AddHandler(Game_File, new CSettingTypeTempString("")); + AddHandler(Game_GameName, new CSettingTypeTempString("")); + AddHandler(Game_GoodName, new CSettingTypeGame("Good Name", Rdb_GoodName)); + AddHandler(Game_TempLoaded, new CSettingTypeTempBool(false)); + AddHandler(Game_SystemType, new CSettingTypeTempNumber(SYSTEM_NTSC)); + AddHandler(Game_EditPlugin_Gfx, new CSettingTypeGame("Plugin-Gfx", Default_None)); + AddHandler(Game_EditPlugin_Audio, new CSettingTypeGame("Plugin-Audio", Default_None)); + AddHandler(Game_EditPlugin_Contr, new CSettingTypeGame("Plugin-Controller", Default_None)); + AddHandler(Game_EditPlugin_RSP, new CSettingTypeGame("Plugin-RSP", Default_None)); + AddHandler(Game_Plugin_Gfx, new CSettingTypeGame("Plugin-Gfx", Plugin_GFX_Current)); + AddHandler(Game_Plugin_Audio, new CSettingTypeGame("Plugin-Audio", Plugin_AUDIO_Current)); + AddHandler(Game_Plugin_Controller, new CSettingTypeGame("Plugin-Controller", Plugin_CONT_Current)); + AddHandler(Game_Plugin_RSP, new CSettingTypeGame("Plugin-RSP", Plugin_RSP_Current)); + AddHandler(Game_SaveChip, new CSettingTypeGame("SaveChip", Rdb_SaveChip)); + AddHandler(Game_CpuType, new CSettingTypeGame("CpuType", Rdb_CpuType)); + AddHandler(Game_LastSaveSlot, new CSettingTypeGame("Last Used Save Slot", (uint32_t)0)); + AddHandler(Game_FixedAudio, new CSettingTypeGame("Fixed Audio", Rdb_FixedAudio)); + AddHandler(Game_RDRamSize, new CSettingTypeGame("RDRamSize", Rdb_RDRamSize)); + AddHandler(Game_CounterFactor, new CSettingTypeGame("Counter Factor", Rdb_CounterFactor)); + AddHandler(Game_UseTlb, new CSettingTypeGame("Use TLB", Rdb_UseTlb)); + AddHandler(Game_DelayDP, new CSettingTypeGame("Delay DP", Rdb_DelayDP)); + AddHandler(Game_DelaySI, new CSettingTypeGame("Delay SI", Rdb_DelaySi)); + AddHandler(Game_RspAudioSignal, new CSettingTypeGame("Audio Signal", Rdb_RspAudioSignal)); + AddHandler(Game_32Bit, new CSettingTypeGame("32bit", Rdb_32Bit)); + AddHandler(Game_FastSP, new CSettingTypeGame("Fast SP", Rdb_FastSP)); + AddHandler(Game_CurrentSaveState, new CSettingTypeTempNumber(0)); + AddHandler(Game_SyncViaAudio, new CSettingTypeGame("Sync Audio", Rdb_SyncViaAudio)); + AddHandler(Game_UseHleGfx, new CSettingTypeGame("HLE GFX", Rdb_UseHleGfx)); + AddHandler(Game_UseHleAudio, new CSettingTypeGame("HLE Audio", Rdb_UseHleAudio)); + AddHandler(Game_LoadRomToMemory, new CSettingTypeGame("Rom In Memory", Rdb_LoadRomToMemory)); + AddHandler(Game_ScreenHertz, new CSettingTypeGame("ScreenHertz", Rdb_ScreenHertz)); + AddHandler(Game_FuncLookupMode, new CSettingTypeGame("FuncFind", Rdb_FuncLookupMode)); + AddHandler(Game_RegCache, new CSettingTypeGame("Reg Cache", Rdb_RegCache)); + AddHandler(Game_BlockLinking, new CSettingTypeGame("Linking", Rdb_BlockLinking)); + AddHandler(Game_SMM_StoreInstruc, new CSettingTypeGame("SMM-StoreInst", Rdb_SMM_StoreInstruc)); + AddHandler(Game_SMM_Cache, new CSettingTypeGame("SMM-Cache", Rdb_SMM_Cache)); + AddHandler(Game_SMM_PIDMA, new CSettingTypeGame("SMM-PI DMA", Rdb_SMM_PIDMA)); + AddHandler(Game_SMM_TLB, new CSettingTypeGame("SMM-TLB", Rdb_SMM_TLB)); + AddHandler(Game_SMM_Protect, new CSettingTypeGame("SMM-Protect", Rdb_SMM_Protect)); + AddHandler(Game_SMM_ValidFunc, new CSettingTypeGame("SMM-FUNC", Rdb_SMM_ValidFunc)); + AddHandler(Game_ViRefreshRate, new CSettingTypeGame("ViRefresh", Rdb_ViRefreshRate)); + AddHandler(Game_AiCountPerBytes, new CSettingTypeGame("AiCountPerBytes", Rdb_AiCountPerBytes)); + AddHandler(Game_AudioResetOnLoad, new CSettingTypeGame("AudioResetOnLoad", Rdb_AudioResetOnLoad)); + AddHandler(Game_AllowROMWrites, new CSettingTypeGame("AllowROMWrites", Rdb_AllowROMWrites)); + AddHandler(Game_CRC_Recalc, new CSettingTypeGame("CRC-Recalc", Rdb_CRC_Recalc)); //User Interface - AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("","Basic Mode", (uint32_t)true)); - AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("","Display CPU Usage", (uint32_t)false)); - AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("","Display Frame Rate", (uint32_t)true)); - AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false)); - AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("","Frame Rate Display Type", (uint32_t)FR_VIs)); - AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window","Top" ,Default_None)); - AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window","Left" ,Default_None)); - AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("","Always on top", (uint32_t)false)); + AddHandler(UserInterface_BasicMode, new CSettingTypeApplication("", "Basic Mode", (uint32_t)true)); + AddHandler(UserInterface_ShowCPUPer, new CSettingTypeApplication("", "Display CPU Usage", (uint32_t)false)); + AddHandler(UserInterface_DisplayFrameRate, new CSettingTypeApplication("", "Display Frame Rate", (uint32_t)true)); + AddHandler(UserInterface_InFullScreen, new CSettingTypeTempBool(false)); + AddHandler(UserInterface_FrameDisplayType, new CSettingTypeApplication("", "Frame Rate Display Type", (uint32_t)FR_VIs)); + AddHandler(UserInterface_MainWindowTop, new CSettingTypeApplication("Main Window", "Top", Default_None)); + AddHandler(UserInterface_MainWindowLeft, new CSettingTypeApplication("Main Window", "Left", Default_None)); + AddHandler(UserInterface_AlwaysOnTop, new CSettingTypeApplication("", "Always on top", (uint32_t)false)); - AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser","Rom Browser",true)); - AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false)); - AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser","Top" ,Default_None)); - AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser","Left" ,Default_None)); - AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser","Width", (uint32_t)640)); - AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser","Height", (uint32_t)480)); - AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos","Field",Default_None)); - AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width","Field",Default_None)); - AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None)); - AddHandler(RomBrowser_SortAscendingIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None)); - AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser","Recursive", false)); - AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser","Maximized", false)); + AddHandler(RomBrowser_Enabled, new CSettingTypeApplication("Rom Browser", "Rom Browser", true)); + AddHandler(RomBrowser_ColoumnsChanged, new CSettingTypeTempBool(false)); + AddHandler(RomBrowser_Top, new CSettingTypeApplication("Rom Browser", "Top", Default_None)); + AddHandler(RomBrowser_Left, new CSettingTypeApplication("Rom Browser", "Left", Default_None)); + AddHandler(RomBrowser_Width, new CSettingTypeApplication("Rom Browser", "Width", (uint32_t)640)); + AddHandler(RomBrowser_Height, new CSettingTypeApplication("Rom Browser", "Height", (uint32_t)480)); + AddHandler(RomBrowser_PosIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Pos", "Field", Default_None)); + AddHandler(RomBrowser_WidthIndex, new CSettingTypeApplicationIndex("Rom Browser\\Field Width", "Field", Default_None)); + AddHandler(RomBrowser_SortFieldIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Field", Default_None)); + AddHandler(RomBrowser_SortAscendingIndex, new CSettingTypeApplicationIndex("Rom Browser", "Sort Ascending", Default_None)); + AddHandler(RomBrowser_Recursive, new CSettingTypeApplication("Rom Browser", "Recursive", false)); + AddHandler(RomBrowser_Maximized, new CSettingTypeApplication("Rom Browser", "Maximized", false)); - AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("","Remembered Rom Dirs",(uint32_t)10)); - AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir","Recent Dir",Default_None)); + AddHandler(Directory_RecentGameDirCount, new CSettingTypeApplication("", "Remembered Rom Dirs", (uint32_t)10)); + AddHandler(Directory_RecentGameDirIndex, new CSettingTypeApplicationIndex("Recent Dir", "Recent Dir", Default_None)); //Directory_Game, - AddHandler(Directory_Game, new CSettingTypeSelectedDirectory("Dir:Game",Directory_GameInitial,Directory_GameSelected,Directory_GameUseSelected)); - AddHandler(Directory_GameInitial, new CSettingTypeRelativePath("Game Directory","")); - AddHandler(Directory_GameSelected, new CSettingTypeApplication("Directory","Game",Directory_GameInitial)); - AddHandler(Directory_GameUseSelected, new CSettingTypeApplication("Directory","Game - Use Selected",false)); + AddHandler(Directory_Game, new CSettingTypeSelectedDirectory("Dir:Game", Directory_GameInitial, Directory_GameSelected, Directory_GameUseSelected)); + AddHandler(Directory_GameInitial, new CSettingTypeRelativePath("Game Directory", "")); + AddHandler(Directory_GameSelected, new CSettingTypeApplication("Directory", "Game", Directory_GameInitial)); + AddHandler(Directory_GameUseSelected, new CSettingTypeApplication("Directory", "Game - Use Selected", false)); - AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin",Directory_PluginInitial,Directory_PluginSelected,Directory_PluginUseSelected)); + AddHandler(Directory_Plugin, new CSettingTypeSelectedDirectory("Dir:Plugin", Directory_PluginInitial, Directory_PluginSelected, Directory_PluginUseSelected)); #ifdef _M_IX86 - AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", "")); - AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory","Plugin",Directory_PluginInitial)); - AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory","Plugin - Use Selected",false)); - AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin","")); + AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin", "")); + AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin", Directory_PluginInitial)); + AddHandler(Directory_PluginUseSelected, new CSettingTypeApplication("Directory", "Plugin - Use Selected", false)); + AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin", "")); #else AddHandler(Directory_PluginInitial, new CSettingTypeRelativePath("Plugin64", "")); AddHandler(Directory_PluginSelected, new CSettingTypeApplicationPath("Directory", "Plugin64", Directory_PluginInitial)); @@ -262,79 +263,79 @@ void CSettings::AddHowToHandleSetting () AddHandler(Directory_PluginSync, new CSettingTypeRelativePath("SyncPlugin64", "")); #endif - AddHandler(Directory_SnapShot, new CSettingTypeSelectedDirectory("Dir:Snapshot",Directory_SnapShotInitial,Directory_SnapShotSelected,Directory_SnapShotUseSelected)); - AddHandler(Directory_SnapShotInitial, new CSettingTypeRelativePath("Screenshots","")); - AddHandler(Directory_SnapShotSelected, new CSettingTypeApplicationPath("Directory","Snap Shot",Directory_SnapShotInitial)); - AddHandler(Directory_SnapShotUseSelected, new CSettingTypeApplication("Directory","Snap Shot - Use Selected",false)); + AddHandler(Directory_SnapShot, new CSettingTypeSelectedDirectory("Dir:Snapshot", Directory_SnapShotInitial, Directory_SnapShotSelected, Directory_SnapShotUseSelected)); + AddHandler(Directory_SnapShotInitial, new CSettingTypeRelativePath("Screenshots", "")); + AddHandler(Directory_SnapShotSelected, new CSettingTypeApplicationPath("Directory", "Snap Shot", Directory_SnapShotInitial)); + AddHandler(Directory_SnapShotUseSelected, new CSettingTypeApplication("Directory", "Snap Shot - Use Selected", false)); - AddHandler(Directory_NativeSave, new CSettingTypeSelectedDirectory("Dir:NativeSave",Directory_NativeSaveInitial,Directory_NativeSaveSelected,Directory_NativeSaveUseSelected)); - AddHandler(Directory_NativeSaveInitial, new CSettingTypeRelativePath("Save","")); - AddHandler(Directory_NativeSaveSelected, new CSettingTypeApplicationPath("Directory","Save",Directory_NativeSaveInitial)); - AddHandler(Directory_NativeSaveUseSelected,new CSettingTypeApplication("Directory","Save - Use Selected",false)); + AddHandler(Directory_NativeSave, new CSettingTypeSelectedDirectory("Dir:NativeSave", Directory_NativeSaveInitial, Directory_NativeSaveSelected, Directory_NativeSaveUseSelected)); + AddHandler(Directory_NativeSaveInitial, new CSettingTypeRelativePath("Save", "")); + AddHandler(Directory_NativeSaveSelected, new CSettingTypeApplicationPath("Directory", "Save", Directory_NativeSaveInitial)); + AddHandler(Directory_NativeSaveUseSelected, new CSettingTypeApplication("Directory", "Save - Use Selected", false)); - AddHandler(Directory_InstantSave, new CSettingTypeSelectedDirectory("Dir:InstantSave",Directory_InstantSaveInitial,Directory_InstantSaveSelected,Directory_InstantSaveUseSelected)); - AddHandler(Directory_InstantSaveInitial, new CSettingTypeRelativePath("Save","")); - AddHandler(Directory_InstantSaveSelected, new CSettingTypeApplicationPath("Directory","Instant Save",Directory_InstantSaveInitial)); - AddHandler(Directory_InstantSaveUseSelected,new CSettingTypeApplication("Directory","Instant Save - Use Selected",false)); + AddHandler(Directory_InstantSave, new CSettingTypeSelectedDirectory("Dir:InstantSave", Directory_InstantSaveInitial, Directory_InstantSaveSelected, Directory_InstantSaveUseSelected)); + AddHandler(Directory_InstantSaveInitial, new CSettingTypeRelativePath("Save", "")); + AddHandler(Directory_InstantSaveSelected, new CSettingTypeApplicationPath("Directory", "Instant Save", Directory_InstantSaveInitial)); + AddHandler(Directory_InstantSaveUseSelected, new CSettingTypeApplication("Directory", "Instant Save - Use Selected", false)); - AddHandler(Directory_Texture, new CSettingTypeSelectedDirectory("Dir:Texture",Directory_TextureInitial,Directory_TextureSelected,Directory_TextureUseSelected)); - AddHandler(Directory_TextureInitial, new CSettingTypeRelativePath("Textures","")); - AddHandler(Directory_TextureSelected, new CSettingTypeApplicationPath("Directory","Texture Dir",Directory_InstantSaveInitial)); - AddHandler(Directory_TextureUseSelected, new CSettingTypeApplication("Directory","Texture Dir - Use Selected",false)); + AddHandler(Directory_Texture, new CSettingTypeSelectedDirectory("Dir:Texture", Directory_TextureInitial, Directory_TextureSelected, Directory_TextureUseSelected)); + AddHandler(Directory_TextureInitial, new CSettingTypeRelativePath("Textures", "")); + AddHandler(Directory_TextureSelected, new CSettingTypeApplicationPath("Directory", "Texture Dir", Directory_InstantSaveInitial)); + AddHandler(Directory_TextureUseSelected, new CSettingTypeApplication("Directory", "Texture Dir - Use Selected", false)); - AddHandler(Directory_LastSave, new CSettingTypeApplication("Directory","Last Save Directory", Directory_InstantSave)); + AddHandler(Directory_LastSave, new CSettingTypeApplication("Directory", "Last Save Directory", Directory_InstantSave)); - AddHandler(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false)); - AddHandler(GameRunning_CPU_Running, new CSettingTypeTempBool(false)); - AddHandler(GameRunning_CPU_Paused, new CSettingTypeTempBool(false)); - AddHandler(GameRunning_CPU_PausedType, new CSettingTypeTempNumber(Default_None)); - AddHandler(GameRunning_InstantSaveFile, new CSettingTypeTempString("")); - AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true)); - AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60)); - AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_LoadingInProgress, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_CPU_Running, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_CPU_Paused, new CSettingTypeTempBool(false)); + AddHandler(GameRunning_CPU_PausedType, new CSettingTypeTempNumber(Default_None)); + AddHandler(GameRunning_InstantSaveFile, new CSettingTypeTempString("")); + AddHandler(GameRunning_LimitFPS, new CSettingTypeTempBool(true)); + AddHandler(GameRunning_ScreenHertz, new CSettingTypeTempNumber(60)); + AddHandler(GameRunning_InReset, new CSettingTypeTempBool(false)); - AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("","Remembered Rom Files",(uint32_t)10)); - AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File","Recent Rom",Default_None)); + AddHandler(File_RecentGameFileCount, new CSettingTypeApplication("", "Remembered Rom Files", (uint32_t)10)); + AddHandler(File_RecentGameFileIndex, new CSettingTypeApplicationIndex("Recent File", "Recent Rom", Default_None)); - AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger","Debugger",false)); - AddHandler(Debugger_ShowTLBMisses, new CSettingTypeApplication("Debugger","Show TLB Misses",false)); - AddHandler(Debugger_ShowUnhandledMemory, new CSettingTypeApplication("Debugger","Show Unhandled Memory",false)); - AddHandler(Debugger_ShowPifErrors, new CSettingTypeApplication("Debugger","Show Pif Errors",false)); - AddHandler(Debugger_DisableGameFixes, new CSettingTypeApplication("Debugger","Disable Game Fixes",false)); - AddHandler(Debugger_ShowDListAListCount, new CSettingTypeApplication("Debugger","Show Dlist Alist Count",false)); - AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger","Show Recompiler Memory size",false)); - AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger","Show Div by zero",false)); - AddHandler(Debugger_GenerateDebugLog, new CSettingTypeApplication("Debugger","Generate Debug Code",false)); - AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger","Profile Code",(uint32_t)false)); - AddHandler(Debugger_AppLogLevel, new CSettingTypeApplication("Logging","Log Level",(uint32_t)TraceError)); - AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging","Log Auto Flush",(uint32_t)false)); - AddHandler(Debugger_GenerateLogFiles, new CSettingTypeApplication("Debugger","Generate Log Files", false)); + AddHandler(Debugger_Enabled, new CSettingTypeApplication("Debugger", "Debugger", false)); + AddHandler(Debugger_ShowTLBMisses, new CSettingTypeApplication("Debugger", "Show TLB Misses", false)); + AddHandler(Debugger_ShowUnhandledMemory, new CSettingTypeApplication("Debugger", "Show Unhandled Memory", false)); + AddHandler(Debugger_ShowPifErrors, new CSettingTypeApplication("Debugger", "Show Pif Errors", false)); + AddHandler(Debugger_DisableGameFixes, new CSettingTypeApplication("Debugger", "Disable Game Fixes", false)); + AddHandler(Debugger_ShowDListAListCount, new CSettingTypeApplication("Debugger", "Show Dlist Alist Count", false)); + AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger", "Show Recompiler Memory size", false)); + AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger", "Show Div by zero", false)); + AddHandler(Debugger_GenerateDebugLog, new CSettingTypeApplication("Debugger", "Generate Debug Code", false)); + AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger", "Profile Code", (uint32_t)false)); + AddHandler(Debugger_AppLogLevel, new CSettingTypeApplication("Logging", "Log Level", (uint32_t)TraceError)); + AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging", "Log Auto Flush", (uint32_t)false)); + AddHandler(Debugger_GenerateLogFiles, new CSettingTypeApplication("Debugger", "Generate Log Files", false)); //Plugin - AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin","RSP Dll", "RSP\\RSP 1.7.dll")); - AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin","Graphics Dll", "GFX\\Jabo_Direct3D8.dll")); - AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin","Audio Dll", "Audio\\Jabo_Dsound.dll")); - AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin","Controller Dll","Input\\PJ64_NRage.dll")); + AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin", "RSP Dll", "RSP\\RSP 1.7.dll")); + AddHandler(Plugin_GFX_Current, new CSettingTypeApplication("Plugin", "Graphics Dll", "GFX\\Jabo_Direct3D8.dll")); + AddHandler(Plugin_AUDIO_Current, new CSettingTypeApplication("Plugin", "Audio Dll", "Audio\\Jabo_Dsound.dll")); + AddHandler(Plugin_CONT_Current, new CSettingTypeApplication("Plugin", "Controller Dll", "Input\\PJ64_NRage.dll")); - AddHandler(Plugin_RSP_CurVer, new CSettingTypeApplication("Plugin","RSP Dll Ver", "")); - AddHandler(Plugin_GFX_CurVer, new CSettingTypeApplication("Plugin","Graphics Dll Ver", "")); - AddHandler(Plugin_AUDIO_CurVer, new CSettingTypeApplication("Plugin","Audio Dll Ver", "")); - AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin","Controller Dll Ver", "")); + AddHandler(Plugin_RSP_CurVer, new CSettingTypeApplication("Plugin", "RSP Dll Ver", "")); + AddHandler(Plugin_GFX_CurVer, new CSettingTypeApplication("Plugin", "Graphics Dll Ver", "")); + AddHandler(Plugin_AUDIO_CurVer, new CSettingTypeApplication("Plugin", "Audio Dll Ver", "")); + AddHandler(Plugin_CONT_CurVer, new CSettingTypeApplication("Plugin", "Controller Dll Ver", "")); - AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP","HLE GFX",true)); - AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP","HLE Audio",false)); + AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX", true)); + AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false)); // cheats - AddHandler(Cheat_Entry, new CSettingTypeCheats("")); - AddHandler(Cheat_Active, new CSettingTypeGameIndex("Cheat","",(uint32_t)false)); - AddHandler(Cheat_Extension, new CSettingTypeGameIndex("Cheat",".exten","??? - Not Set")); - AddHandler(Cheat_Notes, new CSettingTypeCheats("_N")); - AddHandler(Cheat_Options, new CSettingTypeCheats("_O")); - AddHandler(Cheat_Range, new CSettingTypeCheats("_R")); - AddHandler(Cheat_RangeNotes, new CSettingTypeCheats("_RN")); + AddHandler(Cheat_Entry, new CSettingTypeCheats("")); + AddHandler(Cheat_Active, new CSettingTypeGameIndex("Cheat", "", (uint32_t)false)); + AddHandler(Cheat_Extension, new CSettingTypeGameIndex("Cheat", ".exten", "??? - Not Set")); + AddHandler(Cheat_Notes, new CSettingTypeCheats("_N")); + AddHandler(Cheat_Options, new CSettingTypeCheats("_O")); + AddHandler(Cheat_Range, new CSettingTypeCheats("_R")); + AddHandler(Cheat_RangeNotes, new CSettingTypeCheats("_RN")); } -uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) +uint32_t CSettings::FindSetting(CSettings * _this, const char * Name) { for (SETTING_MAP::iterator iter = _this->m_SettingInfo.begin(); iter != _this->m_SettingInfo.end(); iter++) { @@ -342,7 +343,7 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) if (Setting->GetSettingType() == SettingType_GameSetting) { CSettingTypeGame * GameSetting = (CSettingTypeGame *)Setting; - if (_stricmp(GameSetting->GetKeyName(),Name) != 0) + if (_stricmp(GameSetting->GetKeyName(), Name) != 0) { continue; } @@ -351,7 +352,7 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) if (Setting->GetSettingType() == SettingType_CfgFile) { CSettingTypeApplication * CfgSetting = (CSettingTypeApplication *)Setting; - if (_stricmp(CfgSetting->GetKeyName(),Name) != 0) + if (_stricmp(CfgSetting->GetKeyName(), Name) != 0) { continue; } @@ -360,7 +361,7 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) if (Setting->GetSettingType() == SettingType_SelectedDirectory) { CSettingTypeSelectedDirectory * SelectedDirectory = (CSettingTypeSelectedDirectory *)Setting; - if (_stricmp(SelectedDirectory->GetName(),Name) != 0) + if (_stricmp(SelectedDirectory->GetName(), Name) != 0) { continue; } @@ -370,58 +371,58 @@ uint32_t CSettings::FindSetting ( CSettings * _this, const char * Name ) return 0; } -void CSettings::FlushSettings ( CSettings * /*_this*/ ) +void CSettings::FlushSettings(CSettings * /*_this*/) { CSettingTypeCheats::FlushChanges(); CSettingTypeApplication::Flush(); } -uint32_t CSettings::GetSetting ( CSettings * _this, SettingID Type ) +uint32_t CSettings::GetSetting(CSettings * _this, SettingID Type) { return _this->LoadDword(Type); } -const char * CSettings::GetSettingSz ( CSettings * _this, SettingID Type, char * Buffer, int BufferSize ) +const char * CSettings::GetSettingSz(CSettings * _this, SettingID Type, char * Buffer, int BufferSize) { if (Buffer && BufferSize > 0) { Buffer[0] = 0; - _this->LoadStringVal(Type, Buffer,BufferSize); + _this->LoadStringVal(Type, Buffer, BufferSize); } return Buffer; } -void CSettings::SetSetting ( CSettings * _this, SettingID ID, unsigned int Value ) +void CSettings::SetSetting(CSettings * _this, SettingID ID, unsigned int Value) { - _this->SaveDword(ID,Value); + _this->SaveDword(ID, Value); } -void CSettings::SetSettingSz ( CSettings * _this, SettingID ID, const char * Value ) +void CSettings::SetSettingSz(CSettings * _this, SettingID ID, const char * Value) { - _this->SaveString(ID,Value); + _this->SaveString(ID, Value); } -void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType, - SettingType Type, const char * Category, const char * DefaultStr, - uint32_t Value ) +void CSettings::RegisterSetting(CSettings * _this, SettingID ID, SettingID DefaultID, SettingDataType DataType, + SettingType Type, const char * Category, const char * DefaultStr, + uint32_t Value) { switch (Type) { case SettingType_ConstValue: if (DataType != Data_DWORD) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return; } - _this->AddHandler(ID,new CSettingTypeTempNumber(Value)); + _this->AddHandler(ID, new CSettingTypeTempNumber(Value)); break; case SettingType_ConstString: if (DataType != Data_String) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return; } - _this->AddHandler(ID,new CSettingTypeTempString(DefaultStr)); + _this->AddHandler(ID, new CSettingTypeTempString(DefaultStr)); break; case SettingType_CfgFile: case SettingType_Registry: @@ -430,73 +431,79 @@ void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID Def case Data_DWORD: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,Value)); - } else { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,DefaultID)); + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, Value)); + } + else { + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); } break; case Data_String: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,"")); - } else { - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,DefaultID)); + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, "")); + } + else { + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, DefaultID)); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } break; case SettingType_GameSetting: + { + stdstr_f Name("%s-%s", Category, DefaultStr); + switch (DataType) { - stdstr_f Name("%s-%s",Category,DefaultStr); - switch (DataType) + case Data_DWORD: + if (DefaultID == Default_None) { - case Data_DWORD: - if (DefaultID == Default_None) - { - SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; - _this->m_NextAutoSettingId += 1; - _this->AddHandler(RdbSetting,new CSettingTypeRomDatabase(Name.c_str(),(int)Value)); - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),RdbSetting)); - } else { - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),DefaultID)); - } - break; - case Data_String: - if (DefaultID == Default_None) - { - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),"")); - } else { - _this->AddHandler(ID,new CSettingTypeGame(Name.c_str(),DefaultID)); - } - break; - default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; + _this->m_NextAutoSettingId += 1; + _this->AddHandler(RdbSetting, new CSettingTypeRomDatabase(Name.c_str(), (int)Value)); + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), RdbSetting)); } + else { + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); + } + break; + case Data_String: + if (DefaultID == Default_None) + { + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), "")); + } + else { + _this->AddHandler(ID, new CSettingTypeGame(Name.c_str(), DefaultID)); + } + break; + default: + g_Notify->BreakPoint(__FILEW__, __LINE__); } - break; + } + break; case SettingType_RomDatabase: switch (DataType) { case Data_DWORD: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,(int)Value,true)); - } else { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,(SettingID)Value,true)); + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (int)Value, true)); + } + else { + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, (SettingID)Value, true)); } break; case Data_String: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,"",true)); - } else { - _this->AddHandler(ID,new CSettingTypeRomDatabase(DefaultStr,DefaultID,true)); + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, "", true)); + } + else { + _this->AddHandler(ID, new CSettingTypeRomDatabase(DefaultStr, DefaultID, true)); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } break; case SettingType_RdbSetting: @@ -505,24 +512,25 @@ void CSettings::RegisterSetting ( CSettings * _this, SettingID ID, SettingID Def case Data_DWORD: if (DefaultID == Default_None) { - _this->AddHandler(ID,new CSettingTypeRomDatabaseSetting(Category, DefaultStr,(int)Value,true)); - } else { + _this->AddHandler(ID, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, (int)Value, true)); + } + else { SettingID RdbSetting = (SettingID)_this->m_NextAutoSettingId; _this->m_NextAutoSettingId += 1; - _this->AddHandler(RdbSetting,new CSettingTypeRomDatabaseSetting(Category, DefaultStr,DefaultID,true)); - _this->AddHandler(ID,new CSettingTypeApplication(Category,DefaultStr,RdbSetting)); + _this->AddHandler(RdbSetting, new CSettingTypeRomDatabaseSetting(Category, DefaultStr, DefaultID, true)); + _this->AddHandler(ID, new CSettingTypeApplication(Category, DefaultStr, RdbSetting)); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } break; default: - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } } -bool CSettings::Initialize( const char * AppName ) +bool CSettings::Initialize(const char * AppName) { AddHowToHandleSetting(); CSettingTypeApplication::Initialize(AppName); @@ -530,18 +538,18 @@ bool CSettings::Initialize( const char * AppName ) CSettingTypeGame::Initialize(); CSettingTypeCheats::Initialize(); - g_Settings->SaveString(Setting_ApplicationName,AppName); + g_Settings->SaveString(Setting_ApplicationName, AppName); return true; } -bool CSettings::LoadBool ( SettingID Type ) +bool CSettings::LoadBool(SettingID Type) { bool Value = false; - LoadBool(Type,Value); + LoadBool(Type, Value); return Value; } -bool CSettings::LoadBool ( SettingID Type, bool & Value ) +bool CSettings::LoadBool(SettingID Type, bool & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -552,21 +560,22 @@ bool CSettings::LoadBool ( SettingID Type, bool & Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - return FindInfo->second->Load(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + return FindInfo->second->Load(0, Value); } return false; } -bool CSettings::LoadBoolIndex( SettingID Type, int index ) +bool CSettings::LoadBoolIndex(SettingID Type, int index) { bool Value = false; - LoadBoolIndex(Type,index,Value); + LoadBoolIndex(Type, index, Value); return Value; } -bool CSettings::LoadBoolIndex( SettingID Type, int index , bool & Value ) +bool CSettings::LoadBoolIndex(SettingID Type, int index, bool & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -577,21 +586,22 @@ bool CSettings::LoadBoolIndex( SettingID Type, int index , bool & Value ) } if (FindInfo->second->IndexBasedSetting()) { - return FindInfo->second->Load(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + return FindInfo->second->Load(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; } -uint32_t CSettings::LoadDword ( SettingID Type ) +uint32_t CSettings::LoadDword(SettingID Type) { uint32_t Value = 0; - LoadDword(Type,Value); + LoadDword(Type, Value); return Value; } -bool CSettings::LoadDword ( SettingID Type, uint32_t & Value) +bool CSettings::LoadDword(SettingID Type, uint32_t & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -602,21 +612,22 @@ bool CSettings::LoadDword ( SettingID Type, uint32_t & Value) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - return FindInfo->second->Load(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + return FindInfo->second->Load(0, Value); } return false; } -uint32_t CSettings::LoadDwordIndex( SettingID Type, int index) +uint32_t CSettings::LoadDwordIndex(SettingID Type, int index) { uint32_t Value; - LoadDwordIndex(Type,index,Value); + LoadDwordIndex(Type, index, Value); return Value; } -bool CSettings::LoadDwordIndex( SettingID Type, int index, uint32_t & Value) +bool CSettings::LoadDwordIndex(SettingID Type, int index, uint32_t & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -627,21 +638,22 @@ bool CSettings::LoadDwordIndex( SettingID Type, int index, uint32_t & Value) } if (FindInfo->second->IndexBasedSetting()) { - return FindInfo->second->Load(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + return FindInfo->second->Load(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; } -stdstr CSettings::LoadStringVal ( SettingID Type ) +stdstr CSettings::LoadStringVal(SettingID Type) { stdstr Value; - LoadStringVal(Type,Value); + LoadStringVal(Type, Value); return Value; } -bool CSettings::LoadStringVal ( SettingID Type, stdstr & Value ) +bool CSettings::LoadStringVal(SettingID Type, stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -652,14 +664,15 @@ bool CSettings::LoadStringVal ( SettingID Type, stdstr & Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - return FindInfo->second->Load(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + return FindInfo->second->Load(0, Value); } return false; } -bool CSettings::LoadStringVal ( SettingID Type, char * Buffer, int BufferSize ) +bool CSettings::LoadStringVal(SettingID Type, char * Buffer, int BufferSize) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -671,28 +684,29 @@ bool CSettings::LoadStringVal ( SettingID Type, char * Buffer, int BufferSize ) bool bRes = false; if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { stdstr Value; - bRes = FindInfo->second->Load(0,Value); + bRes = FindInfo->second->Load(0, Value); int len = BufferSize; if ((Value.length() + 1) < (size_t)len) { len = Value.length() + 1; } - strncpy(Buffer,Value.c_str(),len); + strncpy(Buffer, Value.c_str(), len); } return bRes; } -stdstr CSettings::LoadStringIndex ( SettingID Type, int index ) +stdstr CSettings::LoadStringIndex(SettingID Type, int index) { stdstr Value; - LoadStringIndex(Type,index,Value); + LoadStringIndex(Type, index, Value); return Value; } -bool CSettings::LoadStringIndex ( SettingID Type, int index, stdstr & Value ) +bool CSettings::LoadStringIndex(SettingID Type, int index, stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -703,136 +717,143 @@ bool CSettings::LoadStringIndex ( SettingID Type, int index, stdstr & Value ) } if (FindInfo->second->IndexBasedSetting()) { - return FindInfo->second->Load(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + return FindInfo->second->Load(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } return false; } -bool CSettings::LoadStringIndex ( SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/ ) +bool CSettings::LoadStringIndex(SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } //Load the default value for the setting -bool CSettings::LoadDefaultBool ( SettingID Type ) +bool CSettings::LoadDefaultBool(SettingID Type) { bool Value = false; - LoadDefaultBool(Type,Value); + LoadDefaultBool(Type, Value); return Value; } -void CSettings::LoadDefaultBool ( SettingID Type, bool & Value ) +void CSettings::LoadDefaultBool(SettingID Type, bool & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) { //if not found do nothing UnknownSetting(Type); - } else { + } + else { if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->LoadDefault(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->LoadDefault(0, Value); } } } -bool CSettings::LoadDefaultBoolIndex ( SettingID /*Type*/, int /*index*/ ) +bool CSettings::LoadDefaultBoolIndex(SettingID /*Type*/, int /*index*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } -void CSettings::LoadDefaultBoolIndex ( SettingID /*Type*/, int /*index*/, bool & /*Value*/ ) +void CSettings::LoadDefaultBoolIndex(SettingID /*Type*/, int /*index*/, bool & /*Value*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -uint32_t CSettings::LoadDefaultDword ( SettingID Type ) +uint32_t CSettings::LoadDefaultDword(SettingID Type) { uint32_t Value = 0; - LoadDefaultDword(Type,Value); + LoadDefaultDword(Type, Value); return Value; } -void CSettings::LoadDefaultDword ( SettingID Type, uint32_t & Value) +void CSettings::LoadDefaultDword(SettingID Type, uint32_t & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) { //if not found do nothing UnknownSetting(Type); - } else { + } + else { if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->LoadDefault(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->LoadDefault(0, Value); } } } -uint32_t CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/ ) +uint32_t CSettings::LoadDefaultDwordIndex(SettingID /*Type*/, int /*index*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } -void CSettings::LoadDefaultDwordIndex ( SettingID /*Type*/, int /*index*/, uint32_t & /*Value*/) +void CSettings::LoadDefaultDwordIndex(SettingID /*Type*/, int /*index*/, uint32_t & /*Value*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -stdstr CSettings::LoadDefaultString ( SettingID Type ) +stdstr CSettings::LoadDefaultString(SettingID Type) { stdstr Value; - LoadDefaultString(Type,Value); + LoadDefaultString(Type, Value); return Value; } -void CSettings::LoadDefaultString ( SettingID Type, stdstr & Value ) +void CSettings::LoadDefaultString(SettingID Type, stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) { //if not found do nothing UnknownSetting(Type); - } else { + } + else { if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->LoadDefault(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->LoadDefault(0, Value); } } } -void CSettings::LoadDefaultString ( SettingID /*Type*/, char * /*Buffer*/, int /*BufferSize*/ ) +void CSettings::LoadDefaultString(SettingID /*Type*/, char * /*Buffer*/, int /*BufferSize*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -stdstr CSettings::LoadDefaultStringIndex ( SettingID /*Type*/, int /*index*/ ) +stdstr CSettings::LoadDefaultStringIndex(SettingID /*Type*/, int /*index*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); return false; } -void CSettings::LoadDefaultStringIndex ( SettingID /*Type*/, int /*index*/, stdstr & /*Value*/ ) +void CSettings::LoadDefaultStringIndex(SettingID /*Type*/, int /*index*/, stdstr & /*Value*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -void CSettings::LoadDefaultStringIndex ( SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/ ) +void CSettings::LoadDefaultStringIndex(SettingID /*Type*/, int /*index*/, char * /*Buffer*/, int /*BufferSize*/) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -void CSettings::SaveBool ( SettingID Type, bool Value ) +void CSettings::SaveBool(SettingID Type, bool Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -843,14 +864,15 @@ void CSettings::SaveBool ( SettingID Type, bool Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); } -void CSettings::SaveBoolIndex( SettingID Type, int index, bool Value ) +void CSettings::SaveBoolIndex(SettingID Type, int index, bool Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -861,14 +883,15 @@ void CSettings::SaveBoolIndex( SettingID Type, int index, bool Value ) } if (FindInfo->second->IndexBasedSetting()) { - FindInfo->second->Save(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + FindInfo->second->Save(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -void CSettings::SaveDword ( SettingID Type, uint32_t Value ) +void CSettings::SaveDword(SettingID Type, uint32_t Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -879,14 +902,15 @@ void CSettings::SaveDword ( SettingID Type, uint32_t Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); } -void CSettings::SaveDwordIndex ( SettingID Type, int index, uint32_t Value ) +void CSettings::SaveDwordIndex(SettingID Type, int index, uint32_t Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -897,14 +921,15 @@ void CSettings::SaveDwordIndex ( SettingID Type, int index, uint32_t Value ) } if (FindInfo->second->IndexBasedSetting()) { - FindInfo->second->Save(index,Value); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + FindInfo->second->Save(index, Value); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -void CSettings::SaveString ( SettingID Type, const stdstr & Value ) +void CSettings::SaveString(SettingID Type, const stdstr & Value) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -915,14 +940,15 @@ void CSettings::SaveString ( SettingID Type, const stdstr & Value ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Value); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Value); } NotifyCallBacks(Type); } -void CSettings::SaveString ( SettingID Type, const char * Buffer ) +void CSettings::SaveString(SettingID Type, const char * Buffer) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -932,14 +958,15 @@ void CSettings::SaveString ( SettingID Type, const char * Buffer ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { - FindInfo->second->Save(0,Buffer); + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { + FindInfo->second->Save(0, Buffer); } NotifyCallBacks(Type); } -void CSettings::SaveStringIndex( SettingID Type, int index, const char * Buffer ) +void CSettings::SaveStringIndex(SettingID Type, int index, const char * Buffer) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -949,19 +976,20 @@ void CSettings::SaveStringIndex( SettingID Type, int index, const char * Buffer } if (FindInfo->second->IndexBasedSetting()) { - FindInfo->second->Save(index,Buffer); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + FindInfo->second->Save(index, Buffer); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -void CSettings::SaveStringIndex( SettingID Type, int index, const stdstr & Value ) +void CSettings::SaveStringIndex(SettingID Type, int index, const stdstr & Value) { - SaveStringIndex(Type,index,Value.c_str()); + SaveStringIndex(Type, index, Value.c_str()); } -void CSettings::DeleteSetting( SettingID Type ) +void CSettings::DeleteSetting(SettingID Type) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -971,14 +999,15 @@ void CSettings::DeleteSetting( SettingID Type ) } if (FindInfo->second->IndexBasedSetting()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } else { + g_Notify->BreakPoint(__FILEW__, __LINE__); + } + else { FindInfo->second->Delete(0); } NotifyCallBacks(Type); } -void CSettings::DeleteSettingIndex( SettingID Type, int index ) +void CSettings::DeleteSettingIndex(SettingID Type, int index) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -989,13 +1018,14 @@ void CSettings::DeleteSettingIndex( SettingID Type, int index ) if (FindInfo->second->IndexBasedSetting()) { FindInfo->second->Delete(index); - } else { - g_Notify->BreakPoint(__FILEW__,__LINE__); + } + else { + g_Notify->BreakPoint(__FILEW__, __LINE__); } NotifyCallBacks(Type); } -SettingType CSettings::GetSettingType ( SettingID Type ) +SettingType CSettings::GetSettingType(SettingID Type) { if (Type == Default_None || Type == Default_Constant) { @@ -1010,7 +1040,7 @@ SettingType CSettings::GetSettingType ( SettingID Type ) return FindInfo->second->GetSettingType(); } -bool CSettings::IndexBasedSetting ( SettingID Type ) +bool CSettings::IndexBasedSetting(SettingID Type) { SETTING_HANDLER FindInfo = m_SettingInfo.find(Type); if (FindInfo == m_SettingInfo.end()) @@ -1020,7 +1050,7 @@ bool CSettings::IndexBasedSetting ( SettingID Type ) return FindInfo->second->IndexBasedSetting(); } -void CSettings::SettingTypeChanged( SettingType Type ) +void CSettings::SettingTypeChanged(SettingType Type) { for (SETTING_MAP::iterator iter = m_SettingInfo.begin(); iter != m_SettingInfo.end(); iter++) { @@ -1030,14 +1060,14 @@ void CSettings::SettingTypeChanged( SettingType Type ) } } } -void CSettings::UnknownSetting (SettingID /*Type*/) +void CSettings::UnknownSetting(SettingID /*Type*/) { #ifdef _DEBUG - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); #endif } -void CSettings::NotifyCallBacks( SettingID Type ) +void CSettings::NotifyCallBacks(SettingID Type) { SETTING_CALLBACK::iterator Callback = m_Callback.find(Type); if (Callback == m_Callback.end()) @@ -1051,7 +1081,7 @@ void CSettings::NotifyCallBacks( SettingID Type ) } } -void CSettings::RegisterChangeCB(SettingID Type,void * Data, SettingChangedFunc Func) +void CSettings::RegisterChangeCB(SettingID Type, void * Data, SettingChangedFunc Func) { SETTING_CHANGED_CB * new_item = new SETTING_CHANGED_CB; new_item->Data = Data; @@ -1067,12 +1097,13 @@ void CSettings::RegisterChangeCB(SettingID Type,void * Data, SettingChangedFunc item = item->Next; } item->Next = new_item; - } else { - m_Callback.insert(SETTING_CALLBACK::value_type(Type,new_item)); + } + else { + m_Callback.insert(SETTING_CALLBACK::value_type(Type, new_item)); } } -void CSettings::UnregisterChangeCB(SettingID Type,void * Data, SettingChangedFunc Func) +void CSettings::UnregisterChangeCB(SettingID Type, void * Data, SettingChangedFunc Func) { bool bRemoved = false; @@ -1095,11 +1126,13 @@ void CSettings::UnregisterChangeCB(SettingID Type,void * Data, SettingChangedFun SettingID Type = Callback->first; SETTING_CHANGED_CB * Next = item->Next; m_Callback.erase(Callback); - m_Callback.insert(SETTING_CALLBACK::value_type(Type,Next)); - } else { + m_Callback.insert(SETTING_CALLBACK::value_type(Type, Next)); + } + else { m_Callback.erase(Callback); } - } else { + } + else { PrevItem->Next = item->Next; } delete item; @@ -1109,13 +1142,14 @@ void CSettings::UnregisterChangeCB(SettingID Type,void * Data, SettingChangedFun PrevItem = item; item = item->Next; } - } else { + } + else { UnknownSetting(Type); return; } if (!bRemoved) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } -} +} \ No newline at end of file diff --git a/Source/Project64/Settings/Settings.h b/Source/Project64/Settings/Settings.h index f51b9700c..24b241421 100644 --- a/Source/Project64/Settings/Settings.h +++ b/Source/Project64/Settings/Settings.h @@ -105,6 +105,7 @@ enum SettingID //Individual Game Settings Game_IniKey, + Game_File, Game_GameName, Game_GoodName, Game_TempLoaded, diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 843a8d89c..49e5ca6f8 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -50,6 +50,7 @@ m_ResetInfo(NULL) g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); + g_Settings->RegisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded); } //if this fails then it has already been created @@ -66,6 +67,7 @@ CMainGui::~CMainGui(void) g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); + g_Settings->UnregisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded); } if (m_hMainWindow) { @@ -118,6 +120,19 @@ void CMainGui::LoadingInProgressChanged(CMainGui * Gui) Gui->RefreshMenu(); } +void CMainGui::GameLoaded(CMainGui * Gui) +{ + stdstr FileLoc = g_Settings->LoadStringVal(Game_File); + if (FileLoc.length() > 0) + { + WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); + Notify().AddRecentRom(FileLoc.c_str()); + Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); + + Gui->HideRomList(); + } +} + void RomBowserColoumnsChanged(CMainGui * Gui) { Gui->ResetRomBrowserColomuns(); diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index 6cbdc625f..0032a1327 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -112,6 +112,7 @@ private: friend void RomBowserColoumnsChanged(CMainGui * Gui); friend void RomBrowserRecursiveChanged(CMainGui * Gui); static void LoadingInProgressChanged(CMainGui * Gui); + static void GameLoaded(CMainGui * Gui); CBaseMenu * m_Menu; From e25fedcae28dee123d600ca5a410b9a44297d60e Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 22:34:55 +1100 Subject: [PATCH 042/102] [Project64] Move AddRecentRom from Notification Class to gui class --- Source/Project64/User Interface/Gui Class.cpp | 43 ++++++++++++++++++- Source/Project64/User Interface/Gui Class.h | 1 + .../User Interface/Notification Class.cpp | 41 ------------------ .../User Interface/Notification Class.h | 1 - 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 49e5ca6f8..81ad227f3 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -97,6 +97,47 @@ bool CMainGui::RegisterWinClass(void) return true; } +void CMainGui::AddRecentRom(const char * ImagePath) +{ + if (HIWORD(ImagePath) == NULL) { return; } + + //Get Information about the stored rom list + size_t MaxRememberedFiles = g_Settings->LoadDword(File_RecentGameFileCount); + strlist RecentGames; + size_t i; + for (i = 0; i < MaxRememberedFiles; i++) + { + stdstr RecentGame = g_Settings->LoadStringIndex(File_RecentGameFileIndex, i); + if (RecentGame.empty()) + { + break; + } + RecentGames.push_back(RecentGame); + } + + //See if the dir is already in the list if so then move it to the top of the list + strlist::iterator iter; + for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++) + { + if (_stricmp(ImagePath, iter->c_str()) != 0) + { + continue; + } + RecentGames.erase(iter); + break; + } + RecentGames.push_front(ImagePath); + if (RecentGames.size() > MaxRememberedFiles) + { + RecentGames.pop_back(); + } + + for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++) + { + g_Settings->SaveStringIndex(File_RecentGameFileIndex, i, *iter); + } +} + void RomBowserEnabledChanged(CMainGui * Gui) { if (Gui && g_Settings->LoadBool(RomBrowser_Enabled)) @@ -126,7 +167,7 @@ void CMainGui::GameLoaded(CMainGui * Gui) if (FileLoc.length() > 0) { WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); - Notify().AddRecentRom(FileLoc.c_str()); + Gui->AddRecentRom(FileLoc.c_str()); Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); Gui->HideRomList(); diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index 0032a1327..fc8ed9a23 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -103,6 +103,7 @@ private: void Create(const char * WindowTitle); void CreateStatusBar(void); void Resize(DWORD fwSizeType, WORD nWidth, WORD nHeight); //responding to WM_SIZE + void AddRecentRom(const char * ImagePath); friend DWORD CALLBACK AboutBoxProc(HWND, DWORD, DWORD, DWORD); friend DWORD CALLBACK AboutIniBoxProc(HWND, DWORD, DWORD, DWORD); diff --git a/Source/Project64/User Interface/Notification Class.cpp b/Source/Project64/User Interface/Notification Class.cpp index 764ea07ba..858b36556 100644 --- a/Source/Project64/User Interface/Notification Class.cpp +++ b/Source/Project64/User Interface/Notification Class.cpp @@ -196,47 +196,6 @@ void CNotification::AddRecentDir(const char * RomDir) } } -void CNotification::AddRecentRom(const char * ImagePath) -{ - if (HIWORD(ImagePath) == NULL) { return; } - - //Get Information about the stored rom list - size_t MaxRememberedFiles = g_Settings->LoadDword(File_RecentGameFileCount); - strlist RecentGames; - size_t i; - for (i = 0; i < MaxRememberedFiles; i++) - { - stdstr RecentGame = g_Settings->LoadStringIndex(File_RecentGameFileIndex, i); - if (RecentGame.empty()) - { - break; - } - RecentGames.push_back(RecentGame); - } - - //See if the dir is already in the list if so then move it to the top of the list - strlist::iterator iter; - for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++) - { - if (_stricmp(ImagePath, iter->c_str()) != 0) - { - continue; - } - RecentGames.erase(iter); - break; - } - RecentGames.push_front(ImagePath); - if (RecentGames.size() > MaxRememberedFiles) - { - RecentGames.pop_back(); - } - - for (i = 0, iter = RecentGames.begin(); iter != RecentGames.end(); iter++, i++) - { - g_Settings->SaveStringIndex(File_RecentGameFileIndex, i, *iter); - } -} - void CNotification::RefreshMenu(void) { if (m_hWnd == NULL) { return; } diff --git a/Source/Project64/User Interface/Notification Class.h b/Source/Project64/User Interface/Notification Class.h index b125e8481..c8b76833b 100644 --- a/Source/Project64/User Interface/Notification Class.h +++ b/Source/Project64/User Interface/Notification Class.h @@ -43,7 +43,6 @@ public: //Remember roms loaded and Rom Dir selected void AddRecentDir ( const char * RomDir ); - void AddRecentRom ( const char * ImagePath ); //Gui for responses void SetMainWindow ( CMainGui * Gui ); From e4bd5eae745f4d95f3e8e47796c2ba28938b7a77 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 22:38:20 +1100 Subject: [PATCH 043/102] [Project64] Move SetWindowCaption from Notification Class to Gui Class --- Source/Project64/User Interface/Gui Class.cpp | 12 +++++++++++- Source/Project64/User Interface/Gui Class.h | 1 + .../User Interface/Notification Class.cpp | 14 -------------- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 81ad227f3..17e87d875 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -138,6 +138,16 @@ void CMainGui::AddRecentRom(const char * ImagePath) } } +void CMainGui::SetWindowCaption(const wchar_t * title) +{ + static const size_t TITLE_SIZE = 256; + wchar_t WinTitle[TITLE_SIZE]; + + _snwprintf(WinTitle, TITLE_SIZE, L"%s - %s", title, g_Settings->LoadStringVal(Setting_ApplicationName).ToUTF16().c_str()); + WinTitle[TITLE_SIZE - 1] = 0; + Caption(WinTitle); +} + void RomBowserEnabledChanged(CMainGui * Gui) { if (Gui && g_Settings->LoadBool(RomBrowser_Enabled)) @@ -168,7 +178,7 @@ void CMainGui::GameLoaded(CMainGui * Gui) { WriteTrace(TraceDebug, __FUNCTION__ ": Add Recent Rom"); Gui->AddRecentRom(FileLoc.c_str()); - Notify().SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); + Gui->SetWindowCaption(g_Settings->LoadStringVal(Game_GoodName).ToUTF16().c_str()); Gui->HideRomList(); } diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index fc8ed9a23..a98293a0e 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -104,6 +104,7 @@ private: void CreateStatusBar(void); void Resize(DWORD fwSizeType, WORD nWidth, WORD nHeight); //responding to WM_SIZE void AddRecentRom(const char * ImagePath); + void SetWindowCaption(const wchar_t * Caption); friend DWORD CALLBACK AboutBoxProc(HWND, DWORD, DWORD, DWORD); friend DWORD CALLBACK AboutIniBoxProc(HWND, DWORD, DWORD, DWORD); diff --git a/Source/Project64/User Interface/Notification Class.cpp b/Source/Project64/User Interface/Notification Class.cpp index 858b36556..097adf98f 100644 --- a/Source/Project64/User Interface/Notification Class.cpp +++ b/Source/Project64/User Interface/Notification Class.cpp @@ -125,20 +125,6 @@ void CNotification::SetGfxPlugin(CGfxPlugin * Plugin) m_gfxPlugin = 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->LoadStringVal(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(LanguageStringID StringID) const { FatalError(g_Lang->GetString(StringID).c_str()); From 3b74fef76c0a800f085b3fcf948f7881c1eae6db Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 22:45:24 +1100 Subject: [PATCH 044/102] [Project64] Create gui callback on paused --- Source/Project64/N64 System/N64 Class.cpp | 10 ++++------ Source/Project64/User Interface/Gui Class.cpp | 7 +++++++ Source/Project64/User Interface/Gui Class.h | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 6b4b9c732..9fa059785 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -452,12 +452,10 @@ void CN64System::Pause() } m_hPauseEvent.Reset(); g_Settings->SaveBool(GameRunning_CPU_Paused, true); - Notify().RefreshMenu(); g_Notify->DisplayMessage(5, MSG_CPU_PAUSED); m_hPauseEvent.IsTriggered(SyncEvent::INFINITE_TIMEOUT); m_hPauseEvent.Reset(); - g_Settings->SaveBool(GameRunning_CPU_Paused, (DWORD)false); - Notify().RefreshMenu(); + g_Settings->SaveBool(GameRunning_CPU_Paused, false); Notify().DisplayMessage(5, MSG_CPU_RESUMED); } @@ -1107,7 +1105,7 @@ void CN64System::SyncCPU(CN64System * const SecondCPU) // if (PROGRAM_COUNTER == 0x8009BBD8) { // g_Notify->BreakPoint(__FILEW__,__LINE__); // } -} + } void CN64System::SyncSystem() { @@ -1800,7 +1798,7 @@ bool CN64System::LoadState(LPCSTR FileName) SetActiveSystem(true); SyncCPU(m_SyncCPU); } -} + } WriteTrace(TraceDebug, __FUNCTION__ ": 13"); std::wstring LoadMsg = g_Lang->GetString(MSG_LOADED_STATE); g_Notify->DisplayMessage(5, stdstr_f("%s %s", LoadMsg.c_str(), CPath(FileNameStr).GetNameExtension()).ToUTF16().c_str()); @@ -2038,7 +2036,7 @@ bool CN64System::WriteToProtectedMemory(uint32_t Address, int length) #endif } return false; -} + } void CN64System::TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly) { diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 17e87d875..79ccc8513 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -50,6 +50,7 @@ m_ResetInfo(NULL) g_Settings->RegisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->RegisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); g_Settings->RegisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); + g_Settings->RegisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused); g_Settings->RegisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded); } @@ -67,6 +68,7 @@ CMainGui::~CMainGui(void) g_Settings->UnregisterChangeCB(RomBrowser_ColoumnsChanged, this, (CSettings::SettingChangedFunc)RomBowserColoumnsChanged); g_Settings->UnregisterChangeCB(RomBrowser_Recursive, this, (CSettings::SettingChangedFunc)RomBrowserRecursiveChanged); g_Settings->UnregisterChangeCB(GameRunning_LoadingInProgress, this, (CSettings::SettingChangedFunc)LoadingInProgressChanged); + g_Settings->UnregisterChangeCB(GameRunning_CPU_Paused, this, (CSettings::SettingChangedFunc)GamePaused); g_Settings->UnregisterChangeCB(Game_File, this, (CSettings::SettingChangedFunc)GameLoaded); } if (m_hMainWindow) @@ -184,6 +186,11 @@ void CMainGui::GameLoaded(CMainGui * Gui) } } +void CMainGui::GamePaused(CMainGui * Gui) +{ + Gui->RefreshMenu(); +} + void RomBowserColoumnsChanged(CMainGui * Gui) { Gui->ResetRomBrowserColomuns(); diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index a98293a0e..11f93006f 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -115,6 +115,7 @@ private: friend void RomBrowserRecursiveChanged(CMainGui * Gui); static void LoadingInProgressChanged(CMainGui * Gui); static void GameLoaded(CMainGui * Gui); + static void GamePaused(CMainGui * Gui); CBaseMenu * m_Menu; From 24709944f31ab98485bada54d0ce6f5d8cdb7fd6 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 22:52:06 +1100 Subject: [PATCH 045/102] [Project64] Code cleanup of Main Menu Class.cpp --- Source/Project64/N64 System/N64 Class.cpp | 5 +- .../User Interface/Main Menu Class.cpp | 2345 ++++++++--------- .../User Interface/Main Menu Class.h | 130 +- 3 files changed, 1239 insertions(+), 1241 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 9fa059785..eef3d2e92 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -868,7 +868,6 @@ void CN64System::ExecuteCPU() g_Notify->DisplayMessage(5, MSG_EMULATION_STARTED); m_EndEmulation = false; - Notify().RefreshMenu(); m_Plugins->RomOpened(); if (m_SyncCPU) @@ -1105,7 +1104,7 @@ void CN64System::SyncCPU(CN64System * const SecondCPU) // if (PROGRAM_COUNTER == 0x8009BBD8) { // g_Notify->BreakPoint(__FILEW__,__LINE__); // } - } +} void CN64System::SyncSystem() { @@ -2036,7 +2035,7 @@ bool CN64System::WriteToProtectedMemory(uint32_t Address, int length) #endif } return false; - } +} void CN64System::TLB_Mapped(uint32_t VAddr, uint32_t Len, uint32_t PAddr, bool bReadOnly) { diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index 04b09572d..0fec51d61 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -4,1249 +4,1248 @@ #include #include -CMainMenu::CMainMenu ( CMainGui * hMainWindow ): - CBaseMenu(), - m_ResetAccelerators(true) +CMainMenu::CMainMenu(CMainGui * hMainWindow) : +CBaseMenu(), +m_ResetAccelerators(true) { - _Gui = hMainWindow; //Make a copy of the attatched window - ResetMenu(); + _Gui = hMainWindow; //Make a copy of the attatched window + ResetMenu(); - hMainWindow->SetWindowMenu(this); + hMainWindow->SetWindowMenu(this); - m_ChangeSettingList.push_back(Info_ShortCutsChanged); - m_ChangeSettingList.push_back(GameRunning_LimitFPS); - m_ChangeSettingList.push_back(UserInterface_InFullScreen); - m_ChangeSettingList.push_back(UserInterface_AlwaysOnTop); - m_ChangeSettingList.push_back(UserInterface_ShowCPUPer); - m_ChangeSettingList.push_back(Debugger_ProfileCode); - m_ChangeSettingList.push_back(Debugger_ShowTLBMisses); - m_ChangeSettingList.push_back(Debugger_ShowUnhandledMemory); - m_ChangeSettingList.push_back(Debugger_ShowPifErrors); - m_ChangeSettingList.push_back(Debugger_ShowDListAListCount); - m_ChangeSettingList.push_back(Debugger_ShowRecompMemSize); - m_ChangeSettingList.push_back(Debugger_ShowDivByZero); - m_ChangeSettingList.push_back(Debugger_GenerateLogFiles); - m_ChangeSettingList.push_back(Debugger_DisableGameFixes); - m_ChangeSettingList.push_back(Debugger_AppLogLevel); - m_ChangeSettingList.push_back(Debugger_AppLogFlush); - m_ChangeSettingList.push_back(Debugger_GenerateDebugLog); - m_ChangeSettingList.push_back(Game_CurrentSaveState); - m_ChangeSettingList.push_back(Setting_CurrentLanguage); + m_ChangeSettingList.push_back(Info_ShortCutsChanged); + m_ChangeSettingList.push_back(GameRunning_LimitFPS); + m_ChangeSettingList.push_back(UserInterface_InFullScreen); + m_ChangeSettingList.push_back(UserInterface_AlwaysOnTop); + m_ChangeSettingList.push_back(UserInterface_ShowCPUPer); + m_ChangeSettingList.push_back(Debugger_ProfileCode); + m_ChangeSettingList.push_back(Debugger_ShowTLBMisses); + m_ChangeSettingList.push_back(Debugger_ShowUnhandledMemory); + m_ChangeSettingList.push_back(Debugger_ShowPifErrors); + m_ChangeSettingList.push_back(Debugger_ShowDListAListCount); + m_ChangeSettingList.push_back(Debugger_ShowRecompMemSize); + m_ChangeSettingList.push_back(Debugger_ShowDivByZero); + m_ChangeSettingList.push_back(Debugger_GenerateLogFiles); + m_ChangeSettingList.push_back(Debugger_DisableGameFixes); + m_ChangeSettingList.push_back(Debugger_AppLogLevel); + m_ChangeSettingList.push_back(Debugger_AppLogFlush); + m_ChangeSettingList.push_back(Debugger_GenerateDebugLog); + m_ChangeSettingList.push_back(Game_CurrentSaveState); + m_ChangeSettingList.push_back(Setting_CurrentLanguage); - for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++) - { - g_Settings->RegisterChangeCB(*iter,this,(CSettings::SettingChangedFunc)SettingsChanged); - } + for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++) + { + g_Settings->RegisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged); + } } CMainMenu::~CMainMenu() { - for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++) - { - g_Settings->UnregisterChangeCB(*iter,this,(CSettings::SettingChangedFunc)SettingsChanged); - } + for (SettingList::const_iterator iter = m_ChangeSettingList.begin(); iter != m_ChangeSettingList.end(); iter++) + { + g_Settings->UnregisterChangeCB(*iter, this, (CSettings::SettingChangedFunc)SettingsChanged); + } } - -void CMainMenu::SettingsChanged (CMainMenu * _this ) +void CMainMenu::SettingsChanged(CMainMenu * _this) { - _this->ResetMenu(); + _this->ResetMenu(); } -int CMainMenu::ProcessAccelerator ( HWND hWnd, void * lpMsg ) +int CMainMenu::ProcessAccelerator(HWND hWnd, void * lpMsg) { - if (m_ResetAccelerators) - { - m_ResetAccelerators = false; - RebuildAccelerators(); - } - if (!m_AccelTable) { return false; } - return TranslateAccelerator((HWND)hWnd,(HACCEL)m_AccelTable,(LPMSG)lpMsg); + if (m_ResetAccelerators) + { + m_ResetAccelerators = false; + RebuildAccelerators(); + } + if (!m_AccelTable) { return false; } + return TranslateAccelerator((HWND)hWnd, (HACCEL)m_AccelTable, (LPMSG)lpMsg); } bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuID) { - switch (MenuID) { - case ID_FILE_OPEN_ROM: - { - stdstr File = g_BaseSystem->ChooseFileToOpen(hWnd); - if (File.length() > 0) { - g_BaseSystem->RunFileImage(File.c_str()); - } - } - break; - case ID_FILE_ROM_INFO: - { - g_BaseSystem->DisplayRomInfo(hWnd); - } - break; - case ID_FILE_STARTEMULATION: - _Gui->SaveWindowLoc(); - //Before we go and create the new system, ensure the previous one has been closed - CN64System::CloseSystem(); - //Ok now g_BaseSystem should definitely be clean for initialization - g_BaseSystem = new CN64System(g_Plugins, false); - //Now we have created again, we can start up emulation - g_BaseSystem->StartEmulation(true); - break; - case ID_FILE_ENDEMULATION: - WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ENDEMULATION"); - CN64System::CloseSystem(); - _Gui->SaveWindowLoc(); - break; - case ID_FILE_ROMDIRECTORY: - WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ROMDIRECTORY 1"); - _Gui->SelectRomDir(); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ROMDIRECTORY 2"); - _Gui->RefreshMenu(); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_FILE_ROMDIRECTORY 3"); - break; - case ID_FILE_REFRESHROMLIST: _Gui->RefreshRomBrowser(); break; - case ID_FILE_EXIT: DestroyWindow((HWND)hWnd); break; - case ID_SYSTEM_RESET_SOFT: - WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_RESET_SOFT"); - g_BaseSystem->ExternalEvent(SysEvent_ResetCPU_Soft); - break; - case ID_SYSTEM_RESET_HARD: - WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_RESET_HARD"); - g_BaseSystem->ExternalEvent(SysEvent_ResetCPU_Hard); - break; - case ID_SYSTEM_PAUSE: - _Gui->SaveWindowLoc(); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_PAUSE"); - if (g_Settings->LoadBool(GameRunning_CPU_Paused)) - { - g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_FromMenu); - } else { - g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_FromMenu); - } - WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_PAUSE 1"); - break; - case ID_SYSTEM_BITMAP: - { - stdstr Dir(g_Settings->LoadStringVal(Directory_SnapShot)); - WriteTraceF(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen(%s): Starting",Dir.c_str()); - g_Plugins->Gfx()->CaptureScreen(Dir.c_str()); - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": CaptureScreen: Done"); - } - break; - case ID_SYSTEM_LIMITFPS: - WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_LIMITFPS"); - g_Settings->SaveBool(GameRunning_LimitFPS,!g_Settings->LoadBool(GameRunning_LimitFPS)); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_LIMITFPS 1"); - break; - case ID_SYSTEM_SAVE: - WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_SAVE"); - g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState); - break; - case ID_SYSTEM_SAVEAS: - { - char drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT]; - char Directory[255], SaveFile[255]; - OPENFILENAME openfilename; + switch (MenuID) { + case ID_FILE_OPEN_ROM: + { + stdstr File = g_BaseSystem->ChooseFileToOpen(hWnd); + if (File.length() > 0) { + g_BaseSystem->RunFileImage(File.c_str()); + } + } + break; + case ID_FILE_ROM_INFO: + { + g_BaseSystem->DisplayRomInfo(hWnd); + } + break; + case ID_FILE_STARTEMULATION: + _Gui->SaveWindowLoc(); + //Before we go and create the new system, ensure the previous one has been closed + CN64System::CloseSystem(); + //Ok now g_BaseSystem should definitely be clean for initialization + g_BaseSystem = new CN64System(g_Plugins, false); + //Now we have created again, we can start up emulation + g_BaseSystem->StartEmulation(true); + break; + case ID_FILE_ENDEMULATION: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ENDEMULATION"); + CN64System::CloseSystem(); + _Gui->SaveWindowLoc(); + break; + case ID_FILE_ROMDIRECTORY: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ROMDIRECTORY 1"); + _Gui->SelectRomDir(); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ROMDIRECTORY 2"); + _Gui->RefreshMenu(); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ROMDIRECTORY 3"); + break; + case ID_FILE_REFRESHROMLIST: _Gui->RefreshRomBrowser(); break; + case ID_FILE_EXIT: DestroyWindow((HWND)hWnd); break; + case ID_SYSTEM_RESET_SOFT: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_RESET_SOFT"); + g_BaseSystem->ExternalEvent(SysEvent_ResetCPU_Soft); + break; + case ID_SYSTEM_RESET_HARD: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_RESET_HARD"); + g_BaseSystem->ExternalEvent(SysEvent_ResetCPU_Hard); + break; + case ID_SYSTEM_PAUSE: + _Gui->SaveWindowLoc(); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_PAUSE"); + if (g_Settings->LoadBool(GameRunning_CPU_Paused)) + { + g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_FromMenu); + } + else + { + g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_FromMenu); + } + WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_PAUSE 1"); + break; + case ID_SYSTEM_BITMAP: + { + stdstr Dir(g_Settings->LoadStringVal(Directory_SnapShot)); + WriteTraceF(TraceGfxPlugin, __FUNCTION__ ": CaptureScreen(%s): Starting", Dir.c_str()); + g_Plugins->Gfx()->CaptureScreen(Dir.c_str()); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": CaptureScreen: Done"); + } + break; + case ID_SYSTEM_LIMITFPS: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_LIMITFPS"); + g_Settings->SaveBool(GameRunning_LimitFPS, !g_Settings->LoadBool(GameRunning_LimitFPS)); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_LIMITFPS 1"); + break; + case ID_SYSTEM_SAVE: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_SAVE"); + g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState); + break; + case ID_SYSTEM_SAVEAS: + { + char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; + char Directory[255], SaveFile[255]; + OPENFILENAME openfilename; - memset(&SaveFile, 0, sizeof(SaveFile)); - memset(&openfilename, 0, sizeof(openfilename)); + memset(&SaveFile, 0, sizeof(SaveFile)); + memset(&openfilename, 0, sizeof(openfilename)); - g_Settings->LoadStringVal(Directory_LastSave, Directory,sizeof(Directory)); + g_Settings->LoadStringVal(Directory_LastSave, Directory, sizeof(Directory)); - openfilename.lStructSize = sizeof( openfilename ); - openfilename.hwndOwner = (HWND)hWnd; - openfilename.lpstrFilter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;"; - openfilename.lpstrFile = SaveFile; - openfilename.lpstrInitialDir = Directory; - openfilename.nMaxFile = MAX_PATH; - openfilename.Flags = OFN_HIDEREADONLY; + openfilename.lStructSize = sizeof(openfilename); + openfilename.hwndOwner = (HWND)hWnd; + openfilename.lpstrFilter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;"; + openfilename.lpstrFile = SaveFile; + openfilename.lpstrInitialDir = Directory; + openfilename.nMaxFile = MAX_PATH; + openfilename.Flags = OFN_HIDEREADONLY; - g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_SaveGame); - if (GetSaveFileName (&openfilename)) - { + g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_SaveGame); + if (GetSaveFileName(&openfilename)) + { + _splitpath(SaveFile, drive, dir, fname, ext); + if (_stricmp(ext, ".pj") == 0 || _stricmp(ext, ".zip") == 0) + { + _makepath(SaveFile, drive, dir, fname, NULL); + _splitpath(SaveFile, drive, dir, fname, ext); + if (_stricmp(ext, ".pj") == 0) + { + _makepath(SaveFile, drive, dir, fname, NULL); + } + } + g_Settings->SaveString(GameRunning_InstantSaveFile, SaveFile); - _splitpath( SaveFile, drive, dir, fname, ext ); - if (_stricmp(ext, ".pj") == 0 || _stricmp(ext, ".zip") == 0) - { - _makepath( SaveFile, drive, dir, fname, NULL ); - _splitpath( SaveFile, drive, dir, fname, ext ); - if (_stricmp(ext, ".pj") == 0) - { - _makepath( SaveFile, drive, dir, fname, NULL ); - } - } - g_Settings->SaveString(GameRunning_InstantSaveFile, SaveFile); + char SaveDir[MAX_PATH]; + _makepath(SaveDir, drive, dir, NULL, NULL); + g_Settings->SaveString(Directory_LastSave, SaveDir); + g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState); + } + g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SaveGame); + } + break; + case ID_SYSTEM_RESTORE: WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_RESTORE"); g_BaseSystem->ExternalEvent(SysEvent_LoadMachineState); break; + case ID_SYSTEM_LOAD: + { + char Directory[255], SaveFile[255]; + OPENFILENAME openfilename; - char SaveDir[MAX_PATH]; - _makepath( SaveDir, drive, dir, NULL, NULL ); - g_Settings->SaveString(Directory_LastSave,SaveDir); - g_BaseSystem->ExternalEvent(SysEvent_SaveMachineState); - } - g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_SaveGame); - } - break; - case ID_SYSTEM_RESTORE: WriteTrace(TraceDebug,__FUNCTION__ ": ID_SYSTEM_RESTORE"); g_BaseSystem->ExternalEvent(SysEvent_LoadMachineState); break; - case ID_SYSTEM_LOAD: - { - char Directory[255], SaveFile[255]; - OPENFILENAME openfilename; + memset(&SaveFile, 0, sizeof(SaveFile)); + memset(&openfilename, 0, sizeof(openfilename)); - memset(&SaveFile, 0, sizeof(SaveFile)); - memset(&openfilename, 0, sizeof(openfilename)); + g_Settings->LoadStringVal(Directory_LastSave, Directory, sizeof(Directory)); - g_Settings->LoadStringVal(Directory_LastSave, Directory,sizeof(Directory)); + openfilename.lStructSize = sizeof(openfilename); + openfilename.hwndOwner = (HWND)hWnd; + openfilename.lpstrFilter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;"; + openfilename.lpstrFile = SaveFile; + openfilename.lpstrInitialDir = Directory; + openfilename.nMaxFile = MAX_PATH; + openfilename.Flags = OFN_HIDEREADONLY; - openfilename.lStructSize = sizeof( openfilename ); - openfilename.hwndOwner = (HWND)hWnd; - openfilename.lpstrFilter = "PJ64 Saves (*.zip, *.pj)\0*.pj?;*.pj;*.zip;"; - openfilename.lpstrFile = SaveFile; - openfilename.lpstrInitialDir = Directory; - openfilename.nMaxFile = MAX_PATH; - openfilename.Flags = OFN_HIDEREADONLY; + g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_LoadGame); + if (GetOpenFileName(&openfilename)) + { + g_Settings->SaveString(GameRunning_InstantSaveFile, SaveFile); + char SaveDir[MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; + _splitpath(SaveFile, drive, dir, fname, ext); + _makepath(SaveDir, drive, dir, NULL, NULL); + g_Settings->SaveString(Directory_LastSave, SaveDir); + g_System->LoadState(); + } + g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame); + } + break; + case ID_SYSTEM_CHEAT: + { + CCheatsUI * cheatUI = new CCheatsUI; + g_cheatUI = cheatUI; + cheatUI->SelectCheats(hWnd, false); + } + break; + case ID_SYSTEM_GSBUTTON: + g_BaseSystem->ExternalEvent(SysEvent_GSButtonPressed); + break; + case ID_OPTIONS_DISPLAY_FR: + g_Settings->SaveBool(UserInterface_DisplayFrameRate, !g_Settings->LoadBool(UserInterface_DisplayFrameRate)); + break; + case ID_OPTIONS_CHANGE_FR: + switch (g_Settings->LoadDword(UserInterface_FrameDisplayType)) + { + case FR_VIs: + g_Settings->SaveDword(UserInterface_FrameDisplayType, FR_DLs); + break; + case FR_DLs: + g_Settings->SaveDword(UserInterface_FrameDisplayType, FR_PERCENT); + break; + default: + g_Settings->SaveDword(UserInterface_FrameDisplayType, FR_VIs); + } + break; + case ID_OPTIONS_INCREASE_SPEED: + g_BaseSystem->IncreaseSpeed(); + break; + case ID_OPTIONS_DECREASE_SPEED: + g_BaseSystem->DecreaseSpeed(); + break; + case ID_OPTIONS_FULLSCREEN: + g_BaseSystem->ExternalEvent(SysEvent_ChangingFullScreen); + break; + case ID_OPTIONS_FULLSCREEN2: + if (g_Settings->LoadBool(UserInterface_InFullScreen)) + { + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN a"); + _Gui->MakeWindowOnTop(false); + Notify().SetGfxPlugin(NULL); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": ChangeWindow: Starting"); + g_Plugins->Gfx()->ChangeWindow(); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": ChangeWindow: Done"); + ShowCursor(true); + _Gui->ShowStatusBar(true); + _Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); + g_Settings->SaveBool(UserInterface_InFullScreen, (DWORD)false); + } + else + { + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b"); + ShowCursor(false); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 1"); + _Gui->ShowStatusBar(false); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 2"); + try + { + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": ChangeWindow: Starting"); + g_Plugins->Gfx()->ChangeWindow(); + WriteTrace(TraceGfxPlugin, __FUNCTION__ ": ChangeWindow: Done"); + } + catch (...) + { + WriteTrace(TraceError, __FUNCTION__ ": Exception when going to full screen"); + char Message[600]; + sprintf(Message, "Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__); + MessageBox(NULL, Message, "Exception", MB_OK); + } + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 4"); + _Gui->MakeWindowOnTop(false); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 5"); + Notify().SetGfxPlugin(g_Plugins->Gfx()); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 3"); + g_Settings->SaveBool(UserInterface_InFullScreen, true); + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 6"); + } + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN 1"); + break; + case ID_OPTIONS_ALWAYSONTOP: + if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) + { + g_Settings->SaveBool(UserInterface_AlwaysOnTop, false); + _Gui->MakeWindowOnTop(false); + } + else + { + g_Settings->SaveBool(UserInterface_AlwaysOnTop, true); + _Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running)); + } + break; + case ID_OPTIONS_CONFIG_RSP: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_RSP"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_RSP); break; + case ID_OPTIONS_CONFIG_GFX: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_GFX"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_GFX); break; + case ID_OPTIONS_CONFIG_AUDIO:WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_AUDIO"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_AUDIO); break; + case ID_OPTIONS_CONFIG_CONT: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_CONT"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_CONTROLLER); break; + case ID_OPTIONS_CPU_USAGE: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CPU_USAGE"); + if (g_Settings->LoadBool(UserInterface_ShowCPUPer)) + { + g_Settings->SaveBool(UserInterface_ShowCPUPer, false); + g_Notify->DisplayMessage(0, L""); + } + else + { + g_Settings->SaveBool(UserInterface_ShowCPUPer, true); + } + break; + case ID_OPTIONS_SETTINGS: + { + CSettingConfig SettingConfig; + SettingConfig.Display(hWnd); + } + break; + case ID_PROFILE_PROFILE: + g_Settings->SaveBool(Debugger_ProfileCode, !g_Settings->LoadBool(Debugger_ProfileCode)); + g_BaseSystem->ExternalEvent(SysEvent_Profile_StartStop); + break; + case ID_PROFILE_RESETCOUNTER: g_BaseSystem->ExternalEvent(SysEvent_Profile_ResetLogs); break; + case ID_PROFILE_GENERATELOG: g_BaseSystem->ExternalEvent(SysEvent_Profile_GenerateLogs); break; + case ID_DEBUG_SHOW_TLB_MISSES: + g_Settings->SaveBool(Debugger_ShowTLBMisses, !g_Settings->LoadBool(Debugger_ShowTLBMisses)); + break; + case ID_DEBUG_SHOW_UNHANDLED_MEM: + g_Settings->SaveBool(Debugger_ShowUnhandledMemory, !g_Settings->LoadBool(Debugger_ShowUnhandledMemory)); + break; + case ID_DEBUG_SHOW_PIF_ERRORS: + g_Settings->SaveBool(Debugger_ShowPifErrors, !g_Settings->LoadBool(Debugger_ShowPifErrors)); + break; + case ID_DEBUG_SHOW_DLIST_COUNT: + g_Notify->DisplayMessage(0, L""); + g_Settings->SaveBool(Debugger_ShowDListAListCount, !g_Settings->LoadBool(Debugger_ShowDListAListCount)); + break; + case ID_DEBUG_SHOW_RECOMP_MEM_SIZE: + g_Notify->DisplayMessage(0, L""); + g_Settings->SaveBool(Debugger_ShowRecompMemSize, !g_Settings->LoadBool(Debugger_ShowRecompMemSize)); + break; + case ID_DEBUG_SHOW_DIV_BY_ZERO: + g_Settings->SaveBool(Debugger_ShowDivByZero, !g_Settings->LoadBool(Debugger_ShowDivByZero)); + break; + case ID_DEBUG_GENERATE_LOG_FILES: + g_Settings->SaveBool(Debugger_GenerateLogFiles, !g_Settings->LoadBool(Debugger_GenerateLogFiles)); + break; + case ID_DEBUG_DISABLE_GAMEFIX: + g_Settings->SaveBool(Debugger_DisableGameFixes, !g_Settings->LoadBool(Debugger_DisableGameFixes)); + break; + case ID_DEBUGGER_APPLOG_ERRORS: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceError) != 0) + { + LogLevel &= ~TraceError; + } + else + { + LogLevel |= TraceError; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_SETTINGS: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceSettings) != 0) + { + LogLevel &= ~TraceSettings; + } + else + { + LogLevel |= TraceSettings; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_RECOMPILER: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceRecompiler) != 0) + { + LogLevel &= ~TraceRecompiler; + } + else + { + LogLevel |= TraceRecompiler; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_RSP: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceRSP) != 0) + { + LogLevel &= ~TraceRSP; + } + else + { + LogLevel |= TraceRSP; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_TLB: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceTLB) != 0) + { + LogLevel &= ~TraceTLB; + } + else + { + LogLevel |= TraceTLB; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_GFX_PLUGIN: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceGfxPlugin) != 0) + { + LogLevel &= ~TraceGfxPlugin; + } + else + { + LogLevel |= TraceGfxPlugin; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_DEBUG: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceDebug) != 0) + { + LogLevel &= ~TraceDebug; + } + else + { + LogLevel |= TraceDebug; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_AUDIO_EMU: + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + if ((LogLevel & TraceAudio) != 0) + { + LogLevel &= ~TraceAudio; + } + else + { + LogLevel |= TraceAudio; + } + g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel); + } + break; + case ID_DEBUGGER_APPLOG_FLUSH: + g_Settings->SaveBool(Debugger_AppLogFlush, !g_Settings->LoadBool(Debugger_AppLogFlush)); + break; + case ID_DEBUGGER_LOGOPTIONS: _Gui->EnterLogOptions(); break; + case ID_DEBUGGER_GENERATELOG: + g_Settings->SaveBool(Debugger_GenerateDebugLog, !g_Settings->LoadBool(Debugger_GenerateDebugLog)); + break; + case ID_DEBUGGER_DUMPMEMORY: _Gui->Debug_ShowMemoryDump(); break; + case ID_DEBUGGER_SEARCHMEMORY: _Gui->Debug_ShowMemorySearch(); break; + case ID_DEBUGGER_MEMORY: _Gui->Debug_ShowMemoryWindow(); break; + case ID_DEBUGGER_TLBENTRIES: _Gui->Debug_ShowTLBWindow(); break; + case ID_DEBUGGER_INTERRUPT_SP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SP); break; + case ID_DEBUGGER_INTERRUPT_SI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SI); break; + case ID_DEBUGGER_INTERRUPT_AI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_AI); break; + case ID_DEBUGGER_INTERRUPT_VI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_VI); break; + case ID_DEBUGGER_INTERRUPT_PI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_PI); break; + case ID_DEBUGGER_INTERRUPT_DP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_DP); break; + case ID_CURRENT_SAVE_DEFAULT: + Notify().DisplayMessage(3, stdstr_f("Save Slot (%s) selected", GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str()).ToUTF16().c_str()); + g_Settings->SaveDword(Game_CurrentSaveState, (DWORD)(MenuID - ID_CURRENT_SAVE_DEFAULT)); + break; + case ID_CURRENT_SAVE_1: + case ID_CURRENT_SAVE_2: + case ID_CURRENT_SAVE_3: + case ID_CURRENT_SAVE_4: + case ID_CURRENT_SAVE_5: + case ID_CURRENT_SAVE_6: + case ID_CURRENT_SAVE_7: + case ID_CURRENT_SAVE_8: + case ID_CURRENT_SAVE_9: + case ID_CURRENT_SAVE_10: + Notify().DisplayMessage(3, stdstr_f("Save Slot (%s) selected", GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1)).ToUTF16().c_str()); + g_Settings->SaveDword(Game_CurrentSaveState, (DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1)); + break; + case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break; + case ID_HELP_HOMEPAGE: ShellExecute(NULL, "open", "http://www.pj64-emu.com", NULL, NULL, SW_SHOWMAXIMIZED); break; + case ID_HELP_ABOUT: _Gui->AboutBox(); break; + case ID_HELP_ABOUTSETTINGFILES: _Gui->AboutIniBox(); break; + default: + if (MenuID >= ID_RECENT_ROM_START && MenuID < ID_RECENT_ROM_END) + { + stdstr FileName; + if (g_Settings->LoadStringIndex(File_RecentGameFileIndex, MenuID - ID_RECENT_ROM_START, FileName) && + FileName.length() > 0) + { + g_BaseSystem->RunFileImage(FileName.c_str()); + } + } + if (MenuID >= ID_RECENT_DIR_START && MenuID < ID_RECENT_DIR_END) + { + int Offset = MenuID - ID_RECENT_DIR_START; + stdstr Dir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, Offset); + if (Dir.length() > 0) + { + g_Settings->SaveString(Directory_Game, Dir.c_str()); + Notify().AddRecentDir(Dir.c_str()); + _Gui->RefreshMenu(); + if (_Gui->RomBrowserVisible()) + { + _Gui->RefreshRomBrowser(); + } + } + } + if (MenuID >= ID_LANG_START && MenuID < ID_LANG_END) + { + MENUITEMINFOW menuinfo; + wchar_t String[300]; - g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_LoadGame); - if (GetOpenFileName (&openfilename)) { - g_Settings->SaveString(GameRunning_InstantSaveFile,SaveFile); - char SaveDir[MAX_PATH], drive[_MAX_DRIVE] ,dir[_MAX_DIR], fname[_MAX_FNAME],ext[_MAX_EXT]; - _splitpath( SaveFile, drive, dir, fname, ext ); - _makepath( SaveDir, drive, dir, NULL, NULL ); - g_Settings->SaveString(Directory_LastSave,SaveDir); - g_System->LoadState(); - } - g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_LoadGame); - } - break; - case ID_SYSTEM_CHEAT: - { - CCheatsUI * cheatUI = new CCheatsUI; - g_cheatUI = cheatUI; - cheatUI->SelectCheats(hWnd, false); - } - break; - case ID_SYSTEM_GSBUTTON: - g_BaseSystem->ExternalEvent(SysEvent_GSButtonPressed); - break; - case ID_OPTIONS_DISPLAY_FR: - g_Settings->SaveBool(UserInterface_DisplayFrameRate,!g_Settings->LoadBool(UserInterface_DisplayFrameRate)); - break; - case ID_OPTIONS_CHANGE_FR: - switch (g_Settings->LoadDword(UserInterface_FrameDisplayType)) - { - case FR_VIs: - g_Settings->SaveDword(UserInterface_FrameDisplayType,FR_DLs); - break; - case FR_DLs: - g_Settings->SaveDword(UserInterface_FrameDisplayType,FR_PERCENT); - break; - default: - g_Settings->SaveDword(UserInterface_FrameDisplayType,FR_VIs); - } - break; - case ID_OPTIONS_INCREASE_SPEED: - g_BaseSystem->IncreaseSpeed(); - break; - case ID_OPTIONS_DECREASE_SPEED: - g_BaseSystem->DecreaseSpeed(); - break; - case ID_OPTIONS_FULLSCREEN: - g_BaseSystem->ExternalEvent(SysEvent_ChangingFullScreen); - break; - case ID_OPTIONS_FULLSCREEN2: - if (g_Settings->LoadBool(UserInterface_InFullScreen)) - { - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN a"); - _Gui->MakeWindowOnTop(false); - Notify().SetGfxPlugin(NULL); - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Starting"); - g_Plugins->Gfx()->ChangeWindow(); - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Done"); - ShowCursor(true); - _Gui->ShowStatusBar(true); - _Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); - g_Settings->SaveBool(UserInterface_InFullScreen,(DWORD)false); - } else { - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b"); - ShowCursor(false); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 1"); - _Gui->ShowStatusBar(false); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 2"); - try { - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Starting"); - g_Plugins->Gfx()->ChangeWindow(); - WriteTrace(TraceGfxPlugin,__FUNCTION__ ": ChangeWindow: Done"); - } - catch (...) - { - WriteTrace(TraceError,__FUNCTION__ ": Exception when going to full screen"); - char Message[600]; - sprintf(Message,"Exception caught\nFile: %s\nLine: %d",__FILE__,__LINE__); - MessageBox(NULL,Message,"Exception",MB_OK); - } - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 4"); - _Gui->MakeWindowOnTop(false); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 5"); - Notify().SetGfxPlugin(g_Plugins->Gfx()); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 3"); - g_Settings->SaveBool(UserInterface_InFullScreen,true); - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 6"); - } - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_FULLSCREEN 1"); - break; - case ID_OPTIONS_ALWAYSONTOP: - if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { - g_Settings->SaveBool(UserInterface_AlwaysOnTop,false); - _Gui->MakeWindowOnTop(false); - } else { - g_Settings->SaveBool(UserInterface_AlwaysOnTop,true); - _Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running)); - } - break; - case ID_OPTIONS_CONFIG_RSP: WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_RSP"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_RSP); break; - case ID_OPTIONS_CONFIG_GFX: WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_GFX"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_GFX); break; - case ID_OPTIONS_CONFIG_AUDIO:WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_AUDIO"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_AUDIO); break; - case ID_OPTIONS_CONFIG_CONT: WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CONFIG_CONT"); g_Plugins->ConfigPlugin((DWORD)hWnd,PLUGIN_TYPE_CONTROLLER); break; - case ID_OPTIONS_CPU_USAGE: - WriteTrace(TraceDebug,__FUNCTION__ ": ID_OPTIONS_CPU_USAGE"); - if (g_Settings->LoadBool(UserInterface_ShowCPUPer)) - { - g_Settings->SaveBool(UserInterface_ShowCPUPer,false); - g_Notify->DisplayMessage(0,L""); - } else { - g_Settings->SaveBool(UserInterface_ShowCPUPer,true); - } - break; - case ID_OPTIONS_SETTINGS: - { - CSettingConfig SettingConfig; - SettingConfig.Display(hWnd); - } - break; - case ID_PROFILE_PROFILE: - g_Settings->SaveBool(Debugger_ProfileCode,!g_Settings->LoadBool(Debugger_ProfileCode)); - g_BaseSystem->ExternalEvent(SysEvent_Profile_StartStop); - break; - case ID_PROFILE_RESETCOUNTER: g_BaseSystem->ExternalEvent(SysEvent_Profile_ResetLogs); break; - case ID_PROFILE_GENERATELOG: g_BaseSystem->ExternalEvent(SysEvent_Profile_GenerateLogs); break; - case ID_DEBUG_SHOW_TLB_MISSES: - g_Settings->SaveBool(Debugger_ShowTLBMisses,!g_Settings->LoadBool(Debugger_ShowTLBMisses)); - break; - case ID_DEBUG_SHOW_UNHANDLED_MEM: - g_Settings->SaveBool(Debugger_ShowUnhandledMemory,!g_Settings->LoadBool(Debugger_ShowUnhandledMemory)); - break; - case ID_DEBUG_SHOW_PIF_ERRORS: - g_Settings->SaveBool(Debugger_ShowPifErrors,!g_Settings->LoadBool(Debugger_ShowPifErrors)); - break; - case ID_DEBUG_SHOW_DLIST_COUNT: - g_Notify->DisplayMessage(0,L""); - g_Settings->SaveBool(Debugger_ShowDListAListCount,!g_Settings->LoadBool(Debugger_ShowDListAListCount)); - break; - case ID_DEBUG_SHOW_RECOMP_MEM_SIZE: - g_Notify->DisplayMessage(0,L""); - g_Settings->SaveBool(Debugger_ShowRecompMemSize,!g_Settings->LoadBool(Debugger_ShowRecompMemSize)); - break; - case ID_DEBUG_SHOW_DIV_BY_ZERO: - g_Settings->SaveBool(Debugger_ShowDivByZero,!g_Settings->LoadBool(Debugger_ShowDivByZero)); - break; - case ID_DEBUG_GENERATE_LOG_FILES: - g_Settings->SaveBool(Debugger_GenerateLogFiles,!g_Settings->LoadBool(Debugger_GenerateLogFiles)); - break; - case ID_DEBUG_DISABLE_GAMEFIX: - g_Settings->SaveBool(Debugger_DisableGameFixes,!g_Settings->LoadBool(Debugger_DisableGameFixes)); - break; - case ID_DEBUGGER_APPLOG_ERRORS: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceError) != 0) - { - LogLevel &= ~TraceError; - } else { - LogLevel |= TraceError; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_SETTINGS: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceSettings) != 0) - { - LogLevel &= ~TraceSettings; - } else { + menuinfo.cbSize = sizeof(MENUITEMINFO); + menuinfo.fMask = MIIM_TYPE; + menuinfo.fType = MFT_STRING; + menuinfo.dwTypeData = String; + menuinfo.cch = sizeof(String); + GetMenuItemInfoW((HMENU)m_MenuHandle, MenuID, FALSE, &menuinfo); - LogLevel |= TraceSettings; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_RECOMPILER: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceRecompiler) != 0) - { - LogLevel &= ~TraceRecompiler; - } else { - - LogLevel |= TraceRecompiler; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_RSP: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceRSP) != 0) - { - LogLevel &= ~TraceRSP; - } else { - - LogLevel |= TraceRSP; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_TLB: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceTLB) != 0) - { - LogLevel &= ~TraceTLB; - } else { - - LogLevel |= TraceTLB; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_GFX_PLUGIN: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceGfxPlugin) != 0) - { - LogLevel &= ~TraceGfxPlugin; - } else { - - LogLevel |= TraceGfxPlugin; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_DEBUG: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceDebug) != 0) - { - LogLevel &= ~TraceDebug; - } else { - - LogLevel |= TraceDebug; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_AUDIO_EMU: - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - if ((LogLevel & TraceAudio) != 0) - { - LogLevel &= ~TraceAudio; - } else { - - LogLevel |= TraceAudio; - } - g_Settings->SaveDword(Debugger_AppLogLevel, LogLevel ); - } - break; - case ID_DEBUGGER_APPLOG_FLUSH: - g_Settings->SaveBool(Debugger_AppLogFlush,!g_Settings->LoadBool(Debugger_AppLogFlush)); - break; - case ID_DEBUGGER_LOGOPTIONS: _Gui->EnterLogOptions(); break; - case ID_DEBUGGER_GENERATELOG: - g_Settings->SaveBool(Debugger_GenerateDebugLog,!g_Settings->LoadBool(Debugger_GenerateDebugLog)); - break; - case ID_DEBUGGER_DUMPMEMORY: _Gui->Debug_ShowMemoryDump(); break; - case ID_DEBUGGER_SEARCHMEMORY: _Gui->Debug_ShowMemorySearch(); break; - case ID_DEBUGGER_MEMORY: _Gui->Debug_ShowMemoryWindow(); break; - case ID_DEBUGGER_TLBENTRIES: _Gui->Debug_ShowTLBWindow(); break; - case ID_DEBUGGER_INTERRUPT_SP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SP); break; - case ID_DEBUGGER_INTERRUPT_SI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SI); break; - case ID_DEBUGGER_INTERRUPT_AI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_AI); break; - case ID_DEBUGGER_INTERRUPT_VI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_VI); break; - case ID_DEBUGGER_INTERRUPT_PI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_PI); break; - case ID_DEBUGGER_INTERRUPT_DP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_DP); break; - case ID_CURRENT_SAVE_DEFAULT: - Notify().DisplayMessage(3,stdstr_f("Save Slot (%s) selected",GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str()).ToUTF16().c_str()); - g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)(MenuID - ID_CURRENT_SAVE_DEFAULT)); - break; - case ID_CURRENT_SAVE_1: - case ID_CURRENT_SAVE_2: - case ID_CURRENT_SAVE_3: - case ID_CURRENT_SAVE_4: - case ID_CURRENT_SAVE_5: - case ID_CURRENT_SAVE_6: - case ID_CURRENT_SAVE_7: - case ID_CURRENT_SAVE_8: - case ID_CURRENT_SAVE_9: - case ID_CURRENT_SAVE_10: - Notify().DisplayMessage(3,stdstr_f("Save Slot (%s) selected",GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1)).ToUTF16().c_str()); - g_Settings->SaveDword(Game_CurrentSaveState,(DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1)); - break; - case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break; - case ID_HELP_HOMEPAGE: ShellExecute(NULL, "open", "http://www.pj64-emu.com", NULL, NULL, SW_SHOWMAXIMIZED); break; - case ID_HELP_ABOUT: _Gui->AboutBox(); break; - case ID_HELP_ABOUTSETTINGFILES: _Gui->AboutIniBox(); break; - default: - if (MenuID >= ID_RECENT_ROM_START && MenuID < ID_RECENT_ROM_END) { - stdstr FileName; - if (g_Settings->LoadStringIndex(File_RecentGameFileIndex,MenuID - ID_RECENT_ROM_START,FileName) && - FileName.length() > 0) - { - g_BaseSystem->RunFileImage(FileName.c_str()); - } - } - if (MenuID >= ID_RECENT_DIR_START && MenuID < ID_RECENT_DIR_END) { - int Offset = MenuID - ID_RECENT_DIR_START; - stdstr Dir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex,Offset); - if (Dir.length() > 0) { - g_Settings->SaveString(Directory_Game,Dir.c_str()); - Notify().AddRecentDir(Dir.c_str()); - _Gui->RefreshMenu(); - if (_Gui->RomBrowserVisible()) { - _Gui->RefreshRomBrowser(); - } - } - } - if (MenuID >= ID_LANG_START && MenuID < ID_LANG_END) { - MENUITEMINFOW menuinfo; - wchar_t String[300]; - - menuinfo.cbSize = sizeof(MENUITEMINFO); - menuinfo.fMask = MIIM_TYPE; - menuinfo.fType = MFT_STRING; - menuinfo.dwTypeData = String; - menuinfo.cch = sizeof(String); - GetMenuItemInfoW((HMENU)m_MenuHandle,MenuID,FALSE,&menuinfo); - - //See if the language has changed, if not do nothing - //Set the language - g_Lang->SetLanguage(String); - _Gui->ResetRomBrowserColomuns(); - break; - } - return false; - } - return true; + //See if the language has changed, if not do nothing + //Set the language + g_Lang->SetLanguage(String); + _Gui->ResetRomBrowserColomuns(); + break; + } + return false; + } + return true; } -/*stdstr CMainMenu::ShortCutString(MSC_MAP & ShortCuts, int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel) { - Notify().BreakPoint(__FILEW__,__LINE__); - MSC_MAP::iterator MenuItem = ShortCuts.find(MenuID); - if (MenuItem == ShortCuts.end()) { return ""; } - - const SHORTCUT_KEY_LIST & ShortCutList = MenuItem->second.GetAccelItems(); - for (SHORTCUT_KEY_LIST::const_iterator item = ShortCutList.begin(); item != ShortCutList.end(); item++) - { - CMenuShortCutKey::ACCESS_MODE ItemMode = item->AccessMode(); - if ((ItemMode & AccessLevel) != AccessLevel ) - { - continue; - } - return item->Name(); - } - return ""; -}*/ - -stdstr CMainMenu::GetFileLastMod (stdstr FileName) +stdstr CMainMenu::GetFileLastMod(stdstr FileName) { - HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, FILE_SHARE_READ,NULL, - OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); - if (hFile == INVALID_HANDLE_VALUE) - { - return ""; - } - FILETIME CreationTime, LastAccessTime, LastWriteTime; - stdstr LastMod; - if (GetFileTime(hFile,&CreationTime,&LastAccessTime,&LastWriteTime)) - { - SYSTEMTIME stUTC, stLocal; + HANDLE hFile = CreateFile(FileName.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS, NULL); + if (hFile == INVALID_HANDLE_VALUE) + { + return ""; + } + FILETIME CreationTime, LastAccessTime, LastWriteTime; + stdstr LastMod; + if (GetFileTime(hFile, &CreationTime, &LastAccessTime, &LastWriteTime)) + { + SYSTEMTIME stUTC, stLocal; - // Convert the last-write time to local time. - FileTimeToSystemTime(&LastWriteTime, &stUTC); - SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal); - - LastMod.Format(" [%d/%02d/%02d %02d:%02d]", - stLocal.wYear, stLocal.wMonth, stLocal.wDay,stLocal.wHour, stLocal.wMinute); - } - CloseHandle(hFile); + // Convert the last-write time to local time. + FileTimeToSystemTime(&LastWriteTime, &stUTC); + SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal); - return LastMod; + LastMod.Format(" [%d/%02d/%02d %02d:%02d]", stLocal.wYear, stLocal.wMonth, stLocal.wDay, stLocal.wHour, stLocal.wMinute); + } + CloseHandle(hFile); + + return LastMod; } -std::wstring CMainMenu::GetSaveSlotString (int Slot) +std::wstring CMainMenu::GetSaveSlotString(int Slot) { - std::wstring SlotName; - switch (Slot) - { - case 0: SlotName = GS(MENU_SLOT_DEFAULT); break; - case 1: SlotName = GS(MENU_SLOT_1); break; - case 2: SlotName = GS(MENU_SLOT_2); break; - case 3: SlotName = GS(MENU_SLOT_3); break; - case 4: SlotName = GS(MENU_SLOT_4); break; - case 5: SlotName = GS(MENU_SLOT_5); break; - case 6: SlotName = GS(MENU_SLOT_6); break; - case 7: SlotName = GS(MENU_SLOT_7); break; - case 8: SlotName = GS(MENU_SLOT_8); break; - case 9: SlotName = GS(MENU_SLOT_9); break; - case 10: SlotName = GS(MENU_SLOT_10); break; - } + std::wstring SlotName; + switch (Slot) + { + case 0: SlotName = GS(MENU_SLOT_DEFAULT); break; + case 1: SlotName = GS(MENU_SLOT_1); break; + case 2: SlotName = GS(MENU_SLOT_2); break; + case 3: SlotName = GS(MENU_SLOT_3); break; + case 4: SlotName = GS(MENU_SLOT_4); break; + case 5: SlotName = GS(MENU_SLOT_5); break; + case 6: SlotName = GS(MENU_SLOT_6); break; + case 7: SlotName = GS(MENU_SLOT_7); break; + case 8: SlotName = GS(MENU_SLOT_8); break; + case 9: SlotName = GS(MENU_SLOT_9); break; + case 10: SlotName = GS(MENU_SLOT_10); break; + } - if (!g_Settings->LoadBool(GameRunning_CPU_Running)) { return SlotName; } + if (!g_Settings->LoadBool(GameRunning_CPU_Running)) { return SlotName; } - stdstr LastSaveTime; + stdstr LastSaveTime; - //check first save name - stdstr _GoodName = g_Settings->LoadStringVal(Game_GoodName); - stdstr _InstantSaveDirectory = g_Settings->LoadStringVal(Directory_InstantSave); - stdstr CurrentSaveName; - if (Slot != 0) - { - CurrentSaveName.Format("%s.pj%d",_GoodName.c_str(), Slot); - } - else - { - CurrentSaveName.Format("%s.pj",_GoodName.c_str()); - } - stdstr_f FileName("%s%s",_InstantSaveDirectory.c_str(),CurrentSaveName.c_str()); - - if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) - { - stdstr_f ZipFileName("%s.zip",FileName.c_str()); - LastSaveTime = GetFileLastMod(ZipFileName); - } - if (LastSaveTime.empty()) - { - LastSaveTime = GetFileLastMod(FileName); - } + //check first save name + stdstr _GoodName = g_Settings->LoadStringVal(Game_GoodName); + stdstr _InstantSaveDirectory = g_Settings->LoadStringVal(Directory_InstantSave); + stdstr CurrentSaveName; + if (Slot != 0) + { + CurrentSaveName.Format("%s.pj%d", _GoodName.c_str(), Slot); + } + else + { + CurrentSaveName.Format("%s.pj", _GoodName.c_str()); + } + stdstr_f FileName("%s%s", _InstantSaveDirectory.c_str(), CurrentSaveName.c_str()); - // Check old file name - if (LastSaveTime.empty()) - { - stdstr _RomName = g_Settings->LoadStringVal(Game_GameName); - if (Slot > 0) - { - FileName.Format("%s%s.pj%d", _InstantSaveDirectory.c_str(), _RomName.c_str(),Slot); - } - else - { - FileName.Format("%s%s.pj",_InstantSaveDirectory.c_str(),_RomName.c_str()); - } - - if (g_Settings->LoadBool(Setting_AutoZipInstantSave)) - { - stdstr_f ZipFileName("%s.zip",FileName.c_str()); - LastSaveTime = GetFileLastMod(ZipFileName); - } - if (LastSaveTime.empty()) - { - LastSaveTime = GetFileLastMod(FileName); - } - } - SlotName += LastSaveTime.ToUTF16(); - return SlotName; + if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) + { + stdstr_f ZipFileName("%s.zip", FileName.c_str()); + LastSaveTime = GetFileLastMod(ZipFileName); + } + if (LastSaveTime.empty()) + { + LastSaveTime = GetFileLastMod(FileName); + } + + // Check old file name + if (LastSaveTime.empty()) + { + stdstr _RomName = g_Settings->LoadStringVal(Game_GameName); + if (Slot > 0) + { + FileName.Format("%s%s.pj%d", _InstantSaveDirectory.c_str(), _RomName.c_str(), Slot); + } + else + { + FileName.Format("%s%s.pj", _InstantSaveDirectory.c_str(), _RomName.c_str()); + } + + if (g_Settings->LoadBool(Setting_AutoZipInstantSave)) + { + stdstr_f ZipFileName("%s.zip", FileName.c_str()); + LastSaveTime = GetFileLastMod(ZipFileName); + } + if (LastSaveTime.empty()) + { + LastSaveTime = GetFileLastMod(FileName); + } + } + SlotName += LastSaveTime.ToUTF16(); + return SlotName; } -void CMainMenu::FillOutMenu ( HMENU hMenu ) +void CMainMenu::FillOutMenu(HMENU hMenu) { - CGuard Guard(m_CS); + CGuard Guard(m_CS); - MENU_ITEM Item; + MENU_ITEM Item; - //Get all flags - bool inBasicMode = g_Settings->LoadBool(UserInterface_BasicMode); - bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running); - bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress); - bool RomLoaded = g_Settings->LoadStringVal(Game_GameName).length() > 0; - bool RomList = g_Settings->LoadBool(RomBrowser_Enabled) && !CPURunning; - - CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING; - if (g_Settings->LoadBool(GameRunning_CPU_Running)) - { - AccessLevel = g_Settings->LoadBool(UserInterface_InFullScreen) ? - CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : - CMenuShortCutKey::GAME_RUNNING_WINDOW; - } - - //Get the system information to make the menu - LanguageList LangList = g_Lang->GetLangList(); - - MenuItemList LangMenu; - int Offset = 0; - for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++) + //Get all flags + bool inBasicMode = g_Settings->LoadBool(UserInterface_BasicMode); + bool CPURunning = g_Settings->LoadBool(GameRunning_CPU_Running); + bool RomLoading = g_Settings->LoadBool(GameRunning_LoadingInProgress); + bool RomLoaded = g_Settings->LoadStringVal(Game_GameName).length() > 0; + bool RomList = g_Settings->LoadBool(RomBrowser_Enabled) && !CPURunning; + + CMenuShortCutKey::ACCESS_MODE AccessLevel = CMenuShortCutKey::GAME_NOT_RUNNING; + if (g_Settings->LoadBool(GameRunning_CPU_Running)) { - Item.Reset(ID_LANG_START + Offset++,EMPTY_STRING,EMPTY_STDSTR,NULL,Language->LanguageName.c_str()); - if (g_Lang->IsCurrentLang(*Language)) - { - Item.SetItemTicked(true); - } - LangMenu.push_back(Item); - } + AccessLevel = g_Settings->LoadBool(UserInterface_InFullScreen) ? CMenuShortCutKey::GAME_RUNNING_FULLSCREEN : CMenuShortCutKey::GAME_RUNNING_WINDOW; + } - //Go through the settings to create a list of Recent Roms - MenuItemList RecentRomMenu; - DWORD count, RomsToRemember = g_Settings->LoadDword(File_RecentGameFileCount); + //Get the system information to make the menu + LanguageList LangList = g_Lang->GetLangList(); - for (count = 0; count < RomsToRemember; count++) + MenuItemList LangMenu; + int Offset = 0; + for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++) { - stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex,count); - if (LastRom.empty()) - { - break; - } - stdstr_f MenuString("&%d %s",(count + 1) % 10,LastRom.c_str()); - - WCHAR *w_LastRom = new WCHAR[MenuString.length() + 1]; - ::mbstowcs(w_LastRom, MenuString.c_str(), MenuString.length() + 1); - RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastRom)); - delete[] w_LastRom; - } - - - /* Recent Dir - ****************/ - MenuItemList RecentDirMenu; - DWORD DirsToRemember = g_Settings->LoadDword(Directory_RecentGameDirCount); - - for (count = 0; count < DirsToRemember; count++) - { - stdstr LastDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex,count); - if (LastDir.empty()) - { - break; - } - - stdstr_f MenuString("&%d %s",(count + 1) % 10,LastDir.c_str()); - - WCHAR *w_LastDir = new WCHAR[MenuString.length() + 1]; - ::mbstowcs(w_LastDir, MenuString.c_str(), MenuString.length() + 1); - RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastDir)); - delete[] w_LastDir; - } - - /* File Menu - ****************/ - MenuItemList FileMenu; - Item.Reset(ID_FILE_OPEN_ROM, MENU_OPEN, m_ShortCuts.ShortCutString(ID_FILE_OPEN_ROM,AccessLevel)); - FileMenu.push_back(Item); - if (!inBasicMode) - { - Item.Reset(ID_FILE_ROM_INFO, MENU_ROM_INFO,m_ShortCuts.ShortCutString(ID_FILE_ROM_INFO,AccessLevel)); - Item.SetItemEnabled(RomLoaded); - FileMenu.push_back(Item); - FileMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(ID_FILE_STARTEMULATION,MENU_START, m_ShortCuts.ShortCutString(ID_FILE_STARTEMULATION,AccessLevel) ); - Item.SetItemEnabled(RomLoaded && !CPURunning); - FileMenu.push_back(Item); - } - Item.Reset(ID_FILE_ENDEMULATION, MENU_END, m_ShortCuts.ShortCutString(ID_FILE_ENDEMULATION,AccessLevel) ); - Item.SetItemEnabled(CPURunning); - FileMenu.push_back(Item); - FileMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(SUB_MENU, MENU_LANGUAGE, EMPTY_STDSTR, &LangMenu ); - FileMenu.push_back(Item); - if (RomList) - { - FileMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(ID_FILE_ROMDIRECTORY, MENU_CHOOSE_ROM,m_ShortCuts.ShortCutString(ID_FILE_ROMDIRECTORY,AccessLevel) ); - FileMenu.push_back(Item); - Item.Reset(ID_FILE_REFRESHROMLIST,MENU_REFRESH,m_ShortCuts.ShortCutString(ID_FILE_REFRESHROMLIST,AccessLevel) ); - FileMenu.push_back(Item); - } - - if (!inBasicMode && RomList) - { - FileMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(SUB_MENU, MENU_RECENT_ROM,EMPTY_STDSTR, &RecentRomMenu); - if (RecentRomMenu.size() == 0) + Item.Reset(ID_LANG_START + Offset++, EMPTY_STRING, EMPTY_STDSTR, NULL, Language->LanguageName.c_str()); + if (g_Lang->IsCurrentLang(*Language)) { - RecentRomMenu.push_back(MENU_ITEM(SPLITER)); - Item.SetItemEnabled(false); - } - FileMenu.push_back(Item); - Item.Reset(SUB_MENU, MENU_RECENT_DIR,EMPTY_STDSTR, &RecentDirMenu); - if (RecentDirMenu.size() == 0) - { - RecentDirMenu.push_back(MENU_ITEM(SPLITER)); - Item.SetItemEnabled(false); - } - FileMenu.push_back(Item); - } - else - { - if (RecentRomMenu.size() != 0) - { - FileMenu.push_back(MENU_ITEM(SPLITER)); - for (MenuItemList::iterator MenuItem = RecentRomMenu.begin(); MenuItem != RecentRomMenu.end(); MenuItem++) - { - FileMenu.push_back(*MenuItem); - } - } - } - FileMenu.push_back(MENU_ITEM(SPLITER)); - FileMenu.push_back(MENU_ITEM(ID_FILE_EXIT, MENU_EXIT,m_ShortCuts.ShortCutString(ID_FILE_EXIT,AccessLevel))); - - /* Current Save - ****************/ - MenuItemList CurrentSaveMenu; - DWORD _CurrentSaveState = g_Settings->LoadDword(Game_CurrentSaveState); - Item.Reset(ID_CURRENT_SAVE_DEFAULT, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_DEFAULT,AccessLevel),NULL,GetSaveSlotString(0)); - if (_CurrentSaveState == 0) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - CurrentSaveMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(ID_CURRENT_SAVE_1, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_1,AccessLevel),NULL,GetSaveSlotString(1)); - if (_CurrentSaveState == 1) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_2, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_2,AccessLevel),NULL,GetSaveSlotString(2)); - if (_CurrentSaveState == 2) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_3, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_3,AccessLevel),NULL,GetSaveSlotString(3)); - if (_CurrentSaveState == 3) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_4, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_4,AccessLevel),NULL,GetSaveSlotString(4)); - if (_CurrentSaveState == 4) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_5, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_5,AccessLevel),NULL,GetSaveSlotString(5)); - if (_CurrentSaveState == 5) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_6, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_6,AccessLevel),NULL,GetSaveSlotString(6)); - if (_CurrentSaveState == 6) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_7, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_7,AccessLevel),NULL,GetSaveSlotString(7)); - if (_CurrentSaveState == 7) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_8, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_8,AccessLevel),NULL,GetSaveSlotString(8)); - if (_CurrentSaveState == 8) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_9, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_9,AccessLevel),NULL,GetSaveSlotString(9)); - if (_CurrentSaveState == 9) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - Item.Reset(ID_CURRENT_SAVE_10, EMPTY_STRING,m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_10,AccessLevel),NULL,GetSaveSlotString(10)); - if (_CurrentSaveState == 10) { Item.SetItemTicked(true); } - CurrentSaveMenu.push_back(Item); - - /* System Menu - ****************/ - MenuItemList SystemMenu; - MenuItemList ResetMenu; - if (inBasicMode) - { - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT,AccessLevel) )); - } - else - { - ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET_SOFT, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT,AccessLevel) )); - ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_HARD, MENU_RESET_HARD, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_HARD,AccessLevel))); - SystemMenu.push_back(MENU_ITEM(SUB_MENU,MENU_RESET,EMPTY_STDSTR,&ResetMenu)); - } - if (g_Settings->LoadBool(GameRunning_CPU_Paused)) - { - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_RESUME, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE,AccessLevel))); - } - else - { - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_PAUSE, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE,AccessLevel))); - } - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_BITMAP, MENU_BITMAP, m_ShortCuts.ShortCutString(ID_SYSTEM_BITMAP,AccessLevel))); - SystemMenu.push_back(MENU_ITEM(SPLITER)); - if (!inBasicMode) - { - Item.Reset(ID_SYSTEM_LIMITFPS, MENU_LIMIT_FPS,m_ShortCuts.ShortCutString(ID_SYSTEM_LIMITFPS,AccessLevel) ); - if (g_Settings->LoadBool(GameRunning_LimitFPS)) { Item.SetItemTicked(true); } - SystemMenu.push_back(Item); - SystemMenu.push_back(MENU_ITEM(SPLITER)); - } - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVE, MENU_SAVE, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVE,AccessLevel))); - if (!inBasicMode) - { - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVEAS, MENU_SAVE_AS, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVEAS,AccessLevel))); - } - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESTORE, MENU_RESTORE, m_ShortCuts.ShortCutString(ID_SYSTEM_RESTORE,AccessLevel))); - if (!inBasicMode) - { - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_LOAD, MENU_LOAD, m_ShortCuts.ShortCutString(ID_SYSTEM_LOAD,AccessLevel))); - } - SystemMenu.push_back(MENU_ITEM(SPLITER)); - SystemMenu.push_back(MENU_ITEM(SUB_MENU, MENU_CURRENT_SAVE, EMPTY_STDSTR, &CurrentSaveMenu )); - SystemMenu.push_back(MENU_ITEM(SPLITER)); - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_CHEAT, MENU_CHEAT, m_ShortCuts.ShortCutString(ID_SYSTEM_CHEAT,AccessLevel))); - SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_GSBUTTON, MENU_GS_BUTTON, m_ShortCuts.ShortCutString(ID_SYSTEM_GSBUTTON,AccessLevel) )); - - /* Option Menu - ****************/ - MenuItemList OptionMenu; - Item.Reset(ID_OPTIONS_FULLSCREEN, MENU_FULL_SCREEN,m_ShortCuts.ShortCutString(ID_OPTIONS_FULLSCREEN,AccessLevel) ); - Item.SetItemEnabled(CPURunning); - if (g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL) - { - Item.SetItemEnabled(false); - } - OptionMenu.push_back(Item); - if (!inBasicMode) - { - Item.Reset(ID_OPTIONS_ALWAYSONTOP, MENU_ON_TOP,m_ShortCuts.ShortCutString(ID_OPTIONS_ALWAYSONTOP,AccessLevel) ); - if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { Item.SetItemTicked(true); } - Item.SetItemEnabled(CPURunning); - OptionMenu.push_back(Item); - } - OptionMenu.push_back(MENU_ITEM(SPLITER)); - - Item.Reset(ID_OPTIONS_CONFIG_GFX, MENU_CONFG_GFX,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_GFX,AccessLevel)); - if (g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->DllConfig == NULL) - { - Item.SetItemEnabled(false); - } - OptionMenu.push_back(Item); - Item.Reset(ID_OPTIONS_CONFIG_AUDIO, MENU_CONFG_AUDIO,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_AUDIO,AccessLevel)); - if (g_Plugins->Audio() == NULL || g_Plugins->Audio()->DllConfig == NULL) - { - Item.SetItemEnabled(false); - } - OptionMenu.push_back(Item); - if (!inBasicMode) - { - Item.Reset(ID_OPTIONS_CONFIG_RSP, MENU_CONFG_RSP,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_RSP,AccessLevel)); - if (g_Plugins->RSP() == NULL || g_Plugins->RSP()->DllConfig == NULL) - { - Item.SetItemEnabled(false); - } - OptionMenu.push_back(Item); - } - Item.Reset(ID_OPTIONS_CONFIG_CONT, MENU_CONFG_CTRL,m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_CONT,AccessLevel)); - if (g_Plugins->Control() == NULL || g_Plugins->Control()->DllConfig == NULL) - { - Item.SetItemEnabled(false); - } - OptionMenu.push_back(Item); - - OptionMenu.push_back(MENU_ITEM(SPLITER)); - if (!inBasicMode) - { - Item.Reset(ID_OPTIONS_CPU_USAGE, MENU_SHOW_CPU,m_ShortCuts.ShortCutString(ID_OPTIONS_CPU_USAGE,AccessLevel)); - if (g_Settings->LoadDword(UserInterface_ShowCPUPer)) { Item.SetItemTicked(true); } - OptionMenu.push_back(Item); - } - OptionMenu.push_back(MENU_ITEM(ID_OPTIONS_SETTINGS, MENU_SETTINGS,m_ShortCuts.ShortCutString(ID_OPTIONS_SETTINGS,AccessLevel) )); - - /* Profile Menu - ****************/ - MenuItemList DebugProfileMenu; - if (bHaveDebugger()) - { - Item.Reset(ID_PROFILE_PROFILE,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Profile Code"); - if (g_Settings->LoadBool(Debugger_ProfileCode)) { Item.SetItemTicked(true); } - DebugProfileMenu.push_back(Item); - Item.Reset(ID_PROFILE_RESETCOUNTER,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Reset Counters"); - if (!CPURunning) { Item.SetItemEnabled(false); } - DebugProfileMenu.push_back(Item); - Item.Reset(ID_PROFILE_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Generate Log File"); - if (!CPURunning) { Item.SetItemEnabled(false); } - DebugProfileMenu.push_back(Item); - } - - /* Debugger Menu - ****************/ - MenuItemList DebugMenu; - MenuItemList DebugLoggingMenu; - MenuItemList DebugAppLoggingMenu; - MenuItemList DebugR4300Menu; - MenuItemList DebugMemoryMenu; - MenuItemList DebugInterrupt; - MenuItemList DebugNotificationMenu; - if (bHaveDebugger()) - { - /* Debug - Interrupt - *******************/ - Item.Reset(ID_DEBUGGER_INTERRUPT_SP,EMPTY_STRING,EMPTY_STDSTR,NULL,L"SP Interrupt"); - Item.SetItemEnabled(CPURunning); - DebugInterrupt.push_back(Item); - Item.Reset(ID_DEBUGGER_INTERRUPT_SI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"SI Interrupt"); - Item.SetItemEnabled(CPURunning); - DebugInterrupt.push_back(Item); - Item.Reset(ID_DEBUGGER_INTERRUPT_AI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"AI Interrupt"); - Item.SetItemEnabled(CPURunning); - DebugInterrupt.push_back(Item); - Item.Reset(ID_DEBUGGER_INTERRUPT_VI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"VI Interrupt"); - Item.SetItemEnabled(CPURunning); - DebugInterrupt.push_back(Item); - Item.Reset(ID_DEBUGGER_INTERRUPT_PI,EMPTY_STRING,EMPTY_STDSTR,NULL,L"PI Interrupt"); - Item.SetItemEnabled(CPURunning); - DebugInterrupt.push_back(Item); - Item.Reset(ID_DEBUGGER_INTERRUPT_DP,EMPTY_STRING,EMPTY_STDSTR,NULL,L"DP Interrupt"); - Item.SetItemEnabled(CPURunning); - DebugInterrupt.push_back(Item); - - /* Debug - R4300i - *******************/ - Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"R4300i &Commands..."); - Item.SetItemEnabled(false); - DebugR4300Menu.push_back(Item); - Item.Reset(ID_DEBUGGER_R4300REGISTERS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"R4300i &Registers..."); - Item.SetItemEnabled(true); - DebugR4300Menu.push_back(Item); - Item.Reset(ID_DEBUG_DISABLE_GAMEFIX,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Disable Game Fixes"); - if (g_Settings->LoadBool(Debugger_DisableGameFixes)) - { - Item.SetItemTicked(true); - } - DebugR4300Menu.push_back(Item); - Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugInterrupt,L"&Generate Interrupt"); - DebugR4300Menu.push_back(Item); - - /* Debug - Memory - ****************/ - Item.Reset(ID_DEBUGGER_MEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,L"View..."); - DebugMemoryMenu.push_back(Item); - Item.Reset(ID_DEBUGGER_SEARCHMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Search..."); - DebugMemoryMenu.push_back(Item); - Item.Reset(ID_DEBUGGER_DUMPMEMORY,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Dump..."); - DebugMemoryMenu.push_back(Item); - Item.Reset(ID_DEBUGGER_TLBENTRIES,EMPTY_STRING,EMPTY_STDSTR,NULL,L"TLB Entries..."); - DebugMemoryMenu.push_back(Item); - - /* Debug - App logging - *******************/ - { - DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); - - Item.Reset(ID_DEBUGGER_APPLOG_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Error Messages"); - if ((LogLevel & TraceError) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - Item.Reset(ID_DEBUGGER_APPLOG_SETTINGS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Settings"); - if ((LogLevel & TraceSettings) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - Item.Reset(ID_DEBUGGER_APPLOG_RECOMPILER,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Recompiler"); - if ((LogLevel & TraceRecompiler) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - Item.Reset(ID_DEBUGGER_APPLOG_RSP,EMPTY_STRING,EMPTY_STDSTR,NULL,L"RSP"); - if ((LogLevel & TraceRSP) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - Item.Reset(ID_DEBUGGER_APPLOG_TLB,EMPTY_STRING,EMPTY_STDSTR,NULL,L"TLB"); - if ((LogLevel & TraceTLB) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - Item.Reset(ID_DEBUGGER_APPLOG_GFX_PLUGIN,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Gfx Plugin"); - if ((LogLevel & TraceGfxPlugin) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - Item.Reset(ID_DEBUGGER_APPLOG_AUDIO_EMU,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Audio Emulation"); - if ((LogLevel & TraceAudio) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - Item.Reset(ID_DEBUGGER_APPLOG_DEBUG,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Debug Messages"); - if ((LogLevel & TraceDebug) != 0) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - - DebugAppLoggingMenu.push_back(MENU_ITEM(SPLITER)); - - Item.Reset(ID_DEBUGGER_APPLOG_FLUSH,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Auto flush file"); - if (g_Settings->LoadBool(Debugger_AppLogFlush)) { Item.SetItemTicked(true); } - DebugAppLoggingMenu.push_back(Item); - } - - - /* Debug - Logging - *******************/ - Item.Reset(ID_DEBUGGER_LOGOPTIONS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Log Options..."); - DebugLoggingMenu.push_back(Item); - - - Item.Reset(ID_DEBUGGER_GENERATELOG,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Generate Log"); - if (g_Settings->LoadBool(Debugger_GenerateDebugLog)) { Item.SetItemTicked(true); } - DebugLoggingMenu.push_back(Item); - - /* Debugger Main Menu - ****************/ - Item.Reset(ID_DEBUGGER_BREAKPOINTS, EMPTY_STRING,EMPTY_STDSTR, NULL,L"Breakpoint..."); - Item.SetItemEnabled(CPURunning); - DebugMenu.push_back(Item); - DebugMenu.push_back(MENU_ITEM(SPLITER)); - - /* Debug - RSP - *******************/ - if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu())) - { - Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,EMPTY_STDSTR,g_Plugins->RSP()->GetDebugMenu(),L"&RSP"); - DebugMenu.push_back(Item); - } - - /* Debug - RDP - *******************/ - if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) - { - Item.Reset(ID_PLUGIN_MENU,EMPTY_STRING,EMPTY_STDSTR,g_Plugins->Gfx()->GetDebugMenu(),L"&RDP"); - DebugMenu.push_back(Item); - } - - /* Notification Menu - *******************/ - Item.Reset(ID_DEBUG_SHOW_UNHANDLED_MEM,EMPTY_STRING,EMPTY_STDSTR,NULL,L"On Unhandled Memory Actions"); - if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) - { - Item.SetItemTicked(true); - } - DebugNotificationMenu.push_back(Item); - Item.Reset(ID_DEBUG_SHOW_PIF_ERRORS,EMPTY_STRING,EMPTY_STDSTR,NULL,L"On PIF Errors"); - if (g_Settings->LoadBool(Debugger_ShowPifErrors)) - { - Item.SetItemTicked(true); - } - DebugNotificationMenu.push_back(Item); - Item.Reset(ID_DEBUG_SHOW_DIV_BY_ZERO,EMPTY_STRING,EMPTY_STDSTR,NULL,L"On Div By Zero"); - if (g_Settings->LoadBool(Debugger_ShowDivByZero)) - { - Item.SetItemTicked(true); - } - DebugNotificationMenu.push_back(Item); - - Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugR4300Menu,L"&R4300i"); - DebugMenu.push_back(Item); - Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugMemoryMenu,L"Memory"); - Item.SetItemEnabled(CPURunning); - DebugMenu.push_back(Item); - DebugMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugProfileMenu,L"Profile"); - DebugMenu.push_back(Item); - Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugAppLoggingMenu,L"App Logging"); - DebugMenu.push_back(Item); - Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugLoggingMenu,L"Logging"); - DebugMenu.push_back(Item); - Item.Reset(SUB_MENU, EMPTY_STRING,EMPTY_STDSTR, &DebugNotificationMenu,L"Notification"); - DebugMenu.push_back(Item); - DebugMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(ID_DEBUG_SHOW_TLB_MISSES,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Show TLB Misses"); - if (g_Settings->LoadBool(Debugger_ShowTLBMisses)) - { Item.SetItemTicked(true); - } - Item.Reset(ID_DEBUG_SHOW_DLIST_COUNT,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Display Alist/Dlist Count"); - if (g_Settings->LoadBool(Debugger_ShowDListAListCount)) - { - Item.SetItemTicked(true); - } - DebugMenu.push_back(Item); - Item.Reset(ID_DEBUG_SHOW_RECOMP_MEM_SIZE,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Display Recompiler Code Buffer Size"); - if (g_Settings->LoadBool(Debugger_ShowRecompMemSize)) - { - Item.SetItemTicked(true); - } - DebugMenu.push_back(Item); - DebugMenu.push_back(MENU_ITEM(SPLITER)); - Item.Reset(ID_DEBUG_GENERATE_LOG_FILES,EMPTY_STRING,EMPTY_STDSTR,NULL,L"Generate Log Files"); - if (g_Settings->LoadBool(Debugger_GenerateLogFiles)) - { - Item.SetItemTicked(true); - } - DebugMenu.push_back(Item); - } + } + LangMenu.push_back(Item); + } - /* Help Menu - ****************/ - MenuItemList HelpMenu; + //Go through the settings to create a list of Recent Roms + MenuItemList RecentRomMenu; + DWORD count, RomsToRemember = g_Settings->LoadDword(File_RecentGameFileCount); - HelpMenu.push_back(MENU_ITEM(ID_HELP_SUPPORTFORUM, MENU_FORUM)); - HelpMenu.push_back(MENU_ITEM(ID_HELP_HOMEPAGE, MENU_HOMEPAGE)); - HelpMenu.push_back(MENU_ITEM(SPLITER)); - if (!inBasicMode) + for (count = 0; count < RomsToRemember; count++) { - HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUTSETTINGFILES, MENU_ABOUT_INI)); - } - HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUT, MENU_ABOUT_PJ64)); - - /* Main Title bar Menu - ***********************/ - MenuItemList MainTitleMenu; - Item.Reset(SUB_MENU, MENU_FILE, EMPTY_STDSTR, &FileMenu); - if (RomLoading) { Item.SetItemEnabled(false); } - MainTitleMenu.push_back(Item); - if (CPURunning) - { - Item.Reset(SUB_MENU, MENU_SYSTEM, EMPTY_STDSTR, &SystemMenu); - if (RomLoading) { Item.SetItemEnabled(false); } - MainTitleMenu.push_back(Item); - } - Item.Reset(SUB_MENU, MENU_OPTIONS, EMPTY_STDSTR, &OptionMenu); - if (RomLoading) { Item.SetItemEnabled(false); } - MainTitleMenu.push_back(Item); - if (!inBasicMode) - { - if (bHaveDebugger()) + stdstr LastRom = g_Settings->LoadStringIndex(File_RecentGameFileIndex, count); + if (LastRom.empty()) { - Item.Reset(SUB_MENU, MENU_DEBUGGER, EMPTY_STDSTR, &DebugMenu); - if (RomLoading) { Item.SetItemEnabled(false); } - MainTitleMenu.push_back(Item); - } - } - Item.Reset(SUB_MENU, MENU_HELP, EMPTY_STDSTR, &HelpMenu); - if (RomLoading) { Item.SetItemEnabled(false); } - MainTitleMenu.push_back(Item); + break; + } + stdstr_f MenuString("&%d %s", (count + 1) % 10, LastRom.c_str()); - AddMenu(hMenu,MainTitleMenu); + WCHAR *w_LastRom = new WCHAR[MenuString.length() + 1]; + ::mbstowcs(w_LastRom, MenuString.c_str(), MenuString.length() + 1); + RecentRomMenu.push_back(MENU_ITEM(ID_RECENT_ROM_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastRom)); + delete[] w_LastRom; + } + + /* Recent Dir + ****************/ + MenuItemList RecentDirMenu; + DWORD DirsToRemember = g_Settings->LoadDword(Directory_RecentGameDirCount); + + for (count = 0; count < DirsToRemember; count++) + { + stdstr LastDir = g_Settings->LoadStringIndex(Directory_RecentGameDirIndex, count); + if (LastDir.empty()) + { + break; + } + + stdstr_f MenuString("&%d %s", (count + 1) % 10, LastDir.c_str()); + + WCHAR *w_LastDir = new WCHAR[MenuString.length() + 1]; + ::mbstowcs(w_LastDir, MenuString.c_str(), MenuString.length() + 1); + RecentDirMenu.push_back(MENU_ITEM(ID_RECENT_DIR_START + count, EMPTY_STRING, EMPTY_STDSTR, NULL, w_LastDir)); + delete[] w_LastDir; + } + + /* File Menu + ****************/ + MenuItemList FileMenu; + Item.Reset(ID_FILE_OPEN_ROM, MENU_OPEN, m_ShortCuts.ShortCutString(ID_FILE_OPEN_ROM, AccessLevel)); + FileMenu.push_back(Item); + if (!inBasicMode) + { + Item.Reset(ID_FILE_ROM_INFO, MENU_ROM_INFO, m_ShortCuts.ShortCutString(ID_FILE_ROM_INFO, AccessLevel)); + Item.SetItemEnabled(RomLoaded); + FileMenu.push_back(Item); + FileMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(ID_FILE_STARTEMULATION, MENU_START, m_ShortCuts.ShortCutString(ID_FILE_STARTEMULATION, AccessLevel)); + Item.SetItemEnabled(RomLoaded && !CPURunning); + FileMenu.push_back(Item); + } + Item.Reset(ID_FILE_ENDEMULATION, MENU_END, m_ShortCuts.ShortCutString(ID_FILE_ENDEMULATION, AccessLevel)); + Item.SetItemEnabled(CPURunning); + FileMenu.push_back(Item); + FileMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(SUB_MENU, MENU_LANGUAGE, EMPTY_STDSTR, &LangMenu); + FileMenu.push_back(Item); + if (RomList) + { + FileMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(ID_FILE_ROMDIRECTORY, MENU_CHOOSE_ROM, m_ShortCuts.ShortCutString(ID_FILE_ROMDIRECTORY, AccessLevel)); + FileMenu.push_back(Item); + Item.Reset(ID_FILE_REFRESHROMLIST, MENU_REFRESH, m_ShortCuts.ShortCutString(ID_FILE_REFRESHROMLIST, AccessLevel)); + FileMenu.push_back(Item); + } + + if (!inBasicMode && RomList) + { + FileMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(SUB_MENU, MENU_RECENT_ROM, EMPTY_STDSTR, &RecentRomMenu); + if (RecentRomMenu.size() == 0) + { + RecentRomMenu.push_back(MENU_ITEM(SPLITER)); + Item.SetItemEnabled(false); + } + FileMenu.push_back(Item); + Item.Reset(SUB_MENU, MENU_RECENT_DIR, EMPTY_STDSTR, &RecentDirMenu); + if (RecentDirMenu.size() == 0) + { + RecentDirMenu.push_back(MENU_ITEM(SPLITER)); + Item.SetItemEnabled(false); + } + FileMenu.push_back(Item); + } + else + { + if (RecentRomMenu.size() != 0) + { + FileMenu.push_back(MENU_ITEM(SPLITER)); + for (MenuItemList::iterator MenuItem = RecentRomMenu.begin(); MenuItem != RecentRomMenu.end(); MenuItem++) + { + FileMenu.push_back(*MenuItem); + } + } + } + FileMenu.push_back(MENU_ITEM(SPLITER)); + FileMenu.push_back(MENU_ITEM(ID_FILE_EXIT, MENU_EXIT, m_ShortCuts.ShortCutString(ID_FILE_EXIT, AccessLevel))); + + /* Current Save + ****************/ + MenuItemList CurrentSaveMenu; + DWORD _CurrentSaveState = g_Settings->LoadDword(Game_CurrentSaveState); + Item.Reset(ID_CURRENT_SAVE_DEFAULT, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_DEFAULT, AccessLevel), NULL, GetSaveSlotString(0)); + if (_CurrentSaveState == 0) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + CurrentSaveMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(ID_CURRENT_SAVE_1, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_1, AccessLevel), NULL, GetSaveSlotString(1)); + if (_CurrentSaveState == 1) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_2, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_2, AccessLevel), NULL, GetSaveSlotString(2)); + if (_CurrentSaveState == 2) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_3, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_3, AccessLevel), NULL, GetSaveSlotString(3)); + if (_CurrentSaveState == 3) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_4, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_4, AccessLevel), NULL, GetSaveSlotString(4)); + if (_CurrentSaveState == 4) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_5, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_5, AccessLevel), NULL, GetSaveSlotString(5)); + if (_CurrentSaveState == 5) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_6, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_6, AccessLevel), NULL, GetSaveSlotString(6)); + if (_CurrentSaveState == 6) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_7, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_7, AccessLevel), NULL, GetSaveSlotString(7)); + if (_CurrentSaveState == 7) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_8, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_8, AccessLevel), NULL, GetSaveSlotString(8)); + if (_CurrentSaveState == 8) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_9, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_9, AccessLevel), NULL, GetSaveSlotString(9)); + if (_CurrentSaveState == 9) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + Item.Reset(ID_CURRENT_SAVE_10, EMPTY_STRING, m_ShortCuts.ShortCutString(ID_CURRENT_SAVE_10, AccessLevel), NULL, GetSaveSlotString(10)); + if (_CurrentSaveState == 10) { Item.SetItemTicked(true); } + CurrentSaveMenu.push_back(Item); + + /* System Menu + ****************/ + MenuItemList SystemMenu; + MenuItemList ResetMenu; + if (inBasicMode) + { + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT, AccessLevel))); + } + else + { + ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_SOFT, MENU_RESET_SOFT, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_SOFT, AccessLevel))); + ResetMenu.push_back(MENU_ITEM(ID_SYSTEM_RESET_HARD, MENU_RESET_HARD, m_ShortCuts.ShortCutString(ID_SYSTEM_RESET_HARD, AccessLevel))); + SystemMenu.push_back(MENU_ITEM(SUB_MENU, MENU_RESET, EMPTY_STDSTR, &ResetMenu)); + } + if (g_Settings->LoadBool(GameRunning_CPU_Paused)) + { + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_RESUME, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE, AccessLevel))); + } + else + { + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_PAUSE, MENU_PAUSE, m_ShortCuts.ShortCutString(ID_SYSTEM_PAUSE, AccessLevel))); + } + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_BITMAP, MENU_BITMAP, m_ShortCuts.ShortCutString(ID_SYSTEM_BITMAP, AccessLevel))); + SystemMenu.push_back(MENU_ITEM(SPLITER)); + if (!inBasicMode) + { + Item.Reset(ID_SYSTEM_LIMITFPS, MENU_LIMIT_FPS, m_ShortCuts.ShortCutString(ID_SYSTEM_LIMITFPS, AccessLevel)); + if (g_Settings->LoadBool(GameRunning_LimitFPS)) { Item.SetItemTicked(true); } + SystemMenu.push_back(Item); + SystemMenu.push_back(MENU_ITEM(SPLITER)); + } + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVE, MENU_SAVE, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVE, AccessLevel))); + if (!inBasicMode) + { + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_SAVEAS, MENU_SAVE_AS, m_ShortCuts.ShortCutString(ID_SYSTEM_SAVEAS, AccessLevel))); + } + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_RESTORE, MENU_RESTORE, m_ShortCuts.ShortCutString(ID_SYSTEM_RESTORE, AccessLevel))); + if (!inBasicMode) + { + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_LOAD, MENU_LOAD, m_ShortCuts.ShortCutString(ID_SYSTEM_LOAD, AccessLevel))); + } + SystemMenu.push_back(MENU_ITEM(SPLITER)); + SystemMenu.push_back(MENU_ITEM(SUB_MENU, MENU_CURRENT_SAVE, EMPTY_STDSTR, &CurrentSaveMenu)); + SystemMenu.push_back(MENU_ITEM(SPLITER)); + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_CHEAT, MENU_CHEAT, m_ShortCuts.ShortCutString(ID_SYSTEM_CHEAT, AccessLevel))); + SystemMenu.push_back(MENU_ITEM(ID_SYSTEM_GSBUTTON, MENU_GS_BUTTON, m_ShortCuts.ShortCutString(ID_SYSTEM_GSBUTTON, AccessLevel))); + + /* Option Menu + ****************/ + MenuItemList OptionMenu; + Item.Reset(ID_OPTIONS_FULLSCREEN, MENU_FULL_SCREEN, m_ShortCuts.ShortCutString(ID_OPTIONS_FULLSCREEN, AccessLevel)); + Item.SetItemEnabled(CPURunning); + if (g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL) + { + Item.SetItemEnabled(false); + } + OptionMenu.push_back(Item); + if (!inBasicMode) + { + Item.Reset(ID_OPTIONS_ALWAYSONTOP, MENU_ON_TOP, m_ShortCuts.ShortCutString(ID_OPTIONS_ALWAYSONTOP, AccessLevel)); + if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { Item.SetItemTicked(true); } + Item.SetItemEnabled(CPURunning); + OptionMenu.push_back(Item); + } + OptionMenu.push_back(MENU_ITEM(SPLITER)); + + Item.Reset(ID_OPTIONS_CONFIG_GFX, MENU_CONFG_GFX, m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_GFX, AccessLevel)); + if (g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->DllConfig == NULL) + { + Item.SetItemEnabled(false); + } + OptionMenu.push_back(Item); + Item.Reset(ID_OPTIONS_CONFIG_AUDIO, MENU_CONFG_AUDIO, m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_AUDIO, AccessLevel)); + if (g_Plugins->Audio() == NULL || g_Plugins->Audio()->DllConfig == NULL) + { + Item.SetItemEnabled(false); + } + OptionMenu.push_back(Item); + if (!inBasicMode) + { + Item.Reset(ID_OPTIONS_CONFIG_RSP, MENU_CONFG_RSP, m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_RSP, AccessLevel)); + if (g_Plugins->RSP() == NULL || g_Plugins->RSP()->DllConfig == NULL) + { + Item.SetItemEnabled(false); + } + OptionMenu.push_back(Item); + } + Item.Reset(ID_OPTIONS_CONFIG_CONT, MENU_CONFG_CTRL, m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_CONT, AccessLevel)); + if (g_Plugins->Control() == NULL || g_Plugins->Control()->DllConfig == NULL) + { + Item.SetItemEnabled(false); + } + OptionMenu.push_back(Item); + + OptionMenu.push_back(MENU_ITEM(SPLITER)); + if (!inBasicMode) + { + Item.Reset(ID_OPTIONS_CPU_USAGE, MENU_SHOW_CPU, m_ShortCuts.ShortCutString(ID_OPTIONS_CPU_USAGE, AccessLevel)); + if (g_Settings->LoadDword(UserInterface_ShowCPUPer)) { Item.SetItemTicked(true); } + OptionMenu.push_back(Item); + } + OptionMenu.push_back(MENU_ITEM(ID_OPTIONS_SETTINGS, MENU_SETTINGS, m_ShortCuts.ShortCutString(ID_OPTIONS_SETTINGS, AccessLevel))); + + /* Profile Menu + ****************/ + MenuItemList DebugProfileMenu; + if (bHaveDebugger()) + { + Item.Reset(ID_PROFILE_PROFILE, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Profile Code"); + if (g_Settings->LoadBool(Debugger_ProfileCode)) { Item.SetItemTicked(true); } + DebugProfileMenu.push_back(Item); + Item.Reset(ID_PROFILE_RESETCOUNTER, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Reset Counters"); + if (!CPURunning) { Item.SetItemEnabled(false); } + DebugProfileMenu.push_back(Item); + Item.Reset(ID_PROFILE_GENERATELOG, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Generate Log File"); + if (!CPURunning) { Item.SetItemEnabled(false); } + DebugProfileMenu.push_back(Item); + } + + /* Debugger Menu + ****************/ + MenuItemList DebugMenu; + MenuItemList DebugLoggingMenu; + MenuItemList DebugAppLoggingMenu; + MenuItemList DebugR4300Menu; + MenuItemList DebugMemoryMenu; + MenuItemList DebugInterrupt; + MenuItemList DebugNotificationMenu; + if (bHaveDebugger()) + { + /* Debug - Interrupt + *******************/ + Item.Reset(ID_DEBUGGER_INTERRUPT_SP, EMPTY_STRING, EMPTY_STDSTR, NULL, L"SP Interrupt"); + Item.SetItemEnabled(CPURunning); + DebugInterrupt.push_back(Item); + Item.Reset(ID_DEBUGGER_INTERRUPT_SI, EMPTY_STRING, EMPTY_STDSTR, NULL, L"SI Interrupt"); + Item.SetItemEnabled(CPURunning); + DebugInterrupt.push_back(Item); + Item.Reset(ID_DEBUGGER_INTERRUPT_AI, EMPTY_STRING, EMPTY_STDSTR, NULL, L"AI Interrupt"); + Item.SetItemEnabled(CPURunning); + DebugInterrupt.push_back(Item); + Item.Reset(ID_DEBUGGER_INTERRUPT_VI, EMPTY_STRING, EMPTY_STDSTR, NULL, L"VI Interrupt"); + Item.SetItemEnabled(CPURunning); + DebugInterrupt.push_back(Item); + Item.Reset(ID_DEBUGGER_INTERRUPT_PI, EMPTY_STRING, EMPTY_STDSTR, NULL, L"PI Interrupt"); + Item.SetItemEnabled(CPURunning); + DebugInterrupt.push_back(Item); + Item.Reset(ID_DEBUGGER_INTERRUPT_DP, EMPTY_STRING, EMPTY_STDSTR, NULL, L"DP Interrupt"); + Item.SetItemEnabled(CPURunning); + DebugInterrupt.push_back(Item); + + /* Debug - R4300i + *******************/ + Item.Reset(ID_DEBUGGER_LOGOPTIONS, EMPTY_STRING, EMPTY_STDSTR, NULL, L"R4300i &Commands..."); + Item.SetItemEnabled(false); + DebugR4300Menu.push_back(Item); + Item.Reset(ID_DEBUGGER_R4300REGISTERS, EMPTY_STRING, EMPTY_STDSTR, NULL, L"R4300i &Registers..."); + Item.SetItemEnabled(true); + DebugR4300Menu.push_back(Item); + Item.Reset(ID_DEBUG_DISABLE_GAMEFIX, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Disable Game Fixes"); + if (g_Settings->LoadBool(Debugger_DisableGameFixes)) + { + Item.SetItemTicked(true); + } + DebugR4300Menu.push_back(Item); + Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugInterrupt, L"&Generate Interrupt"); + DebugR4300Menu.push_back(Item); + + /* Debug - Memory + ****************/ + Item.Reset(ID_DEBUGGER_MEMORY, EMPTY_STRING, EMPTY_STDSTR, NULL, L"View..."); + DebugMemoryMenu.push_back(Item); + Item.Reset(ID_DEBUGGER_SEARCHMEMORY, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Search..."); + DebugMemoryMenu.push_back(Item); + Item.Reset(ID_DEBUGGER_DUMPMEMORY, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Dump..."); + DebugMemoryMenu.push_back(Item); + Item.Reset(ID_DEBUGGER_TLBENTRIES, EMPTY_STRING, EMPTY_STDSTR, NULL, L"TLB Entries..."); + DebugMemoryMenu.push_back(Item); + + /* Debug - App logging + *******************/ + { + DWORD LogLevel = g_Settings->LoadDword(Debugger_AppLogLevel); + + Item.Reset(ID_DEBUGGER_APPLOG_ERRORS, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Error Messages"); + if ((LogLevel & TraceError) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_APPLOG_SETTINGS, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Settings"); + if ((LogLevel & TraceSettings) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_APPLOG_RECOMPILER, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Recompiler"); + if ((LogLevel & TraceRecompiler) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_APPLOG_RSP, EMPTY_STRING, EMPTY_STDSTR, NULL, L"RSP"); + if ((LogLevel & TraceRSP) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_APPLOG_TLB, EMPTY_STRING, EMPTY_STDSTR, NULL, L"TLB"); + if ((LogLevel & TraceTLB) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_APPLOG_GFX_PLUGIN, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Gfx Plugin"); + if ((LogLevel & TraceGfxPlugin) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_APPLOG_AUDIO_EMU, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Audio Emulation"); + if ((LogLevel & TraceAudio) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_APPLOG_DEBUG, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Debug Messages"); + if ((LogLevel & TraceDebug) != 0) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + + DebugAppLoggingMenu.push_back(MENU_ITEM(SPLITER)); + + Item.Reset(ID_DEBUGGER_APPLOG_FLUSH, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Auto flush file"); + if (g_Settings->LoadBool(Debugger_AppLogFlush)) { Item.SetItemTicked(true); } + DebugAppLoggingMenu.push_back(Item); + } + + /* Debug - Logging + *******************/ + Item.Reset(ID_DEBUGGER_LOGOPTIONS, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Log Options..."); + DebugLoggingMenu.push_back(Item); + + Item.Reset(ID_DEBUGGER_GENERATELOG, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Generate Log"); + if (g_Settings->LoadBool(Debugger_GenerateDebugLog)) { Item.SetItemTicked(true); } + DebugLoggingMenu.push_back(Item); + + /* Debugger Main Menu + ****************/ + Item.Reset(ID_DEBUGGER_BREAKPOINTS, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Breakpoint..."); + Item.SetItemEnabled(CPURunning); + DebugMenu.push_back(Item); + DebugMenu.push_back(MENU_ITEM(SPLITER)); + + /* Debug - RSP + *******************/ + if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu())) + { + Item.Reset(ID_PLUGIN_MENU, EMPTY_STRING, EMPTY_STDSTR, g_Plugins->RSP()->GetDebugMenu(), L"&RSP"); + DebugMenu.push_back(Item); + } + + /* Debug - RDP + *******************/ + if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) + { + Item.Reset(ID_PLUGIN_MENU, EMPTY_STRING, EMPTY_STDSTR, g_Plugins->Gfx()->GetDebugMenu(), L"&RDP"); + DebugMenu.push_back(Item); + } + + /* Notification Menu + *******************/ + Item.Reset(ID_DEBUG_SHOW_UNHANDLED_MEM, EMPTY_STRING, EMPTY_STDSTR, NULL, L"On Unhandled Memory Actions"); + if (g_Settings->LoadBool(Debugger_ShowUnhandledMemory)) + { + Item.SetItemTicked(true); + } + DebugNotificationMenu.push_back(Item); + Item.Reset(ID_DEBUG_SHOW_PIF_ERRORS, EMPTY_STRING, EMPTY_STDSTR, NULL, L"On PIF Errors"); + if (g_Settings->LoadBool(Debugger_ShowPifErrors)) + { + Item.SetItemTicked(true); + } + DebugNotificationMenu.push_back(Item); + Item.Reset(ID_DEBUG_SHOW_DIV_BY_ZERO, EMPTY_STRING, EMPTY_STDSTR, NULL, L"On Div By Zero"); + if (g_Settings->LoadBool(Debugger_ShowDivByZero)) + { + Item.SetItemTicked(true); + } + DebugNotificationMenu.push_back(Item); + + Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugR4300Menu, L"&R4300i"); + DebugMenu.push_back(Item); + Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugMemoryMenu, L"Memory"); + Item.SetItemEnabled(CPURunning); + DebugMenu.push_back(Item); + DebugMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugProfileMenu, L"Profile"); + DebugMenu.push_back(Item); + Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugAppLoggingMenu, L"App Logging"); + DebugMenu.push_back(Item); + Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugLoggingMenu, L"Logging"); + DebugMenu.push_back(Item); + Item.Reset(SUB_MENU, EMPTY_STRING, EMPTY_STDSTR, &DebugNotificationMenu, L"Notification"); + DebugMenu.push_back(Item); + DebugMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(ID_DEBUG_SHOW_TLB_MISSES, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Show TLB Misses"); + if (g_Settings->LoadBool(Debugger_ShowTLBMisses)) + { + Item.SetItemTicked(true); + } + Item.Reset(ID_DEBUG_SHOW_DLIST_COUNT, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Display Alist/Dlist Count"); + if (g_Settings->LoadBool(Debugger_ShowDListAListCount)) + { + Item.SetItemTicked(true); + } + DebugMenu.push_back(Item); + Item.Reset(ID_DEBUG_SHOW_RECOMP_MEM_SIZE, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Display Recompiler Code Buffer Size"); + if (g_Settings->LoadBool(Debugger_ShowRecompMemSize)) + { + Item.SetItemTicked(true); + } + DebugMenu.push_back(Item); + DebugMenu.push_back(MENU_ITEM(SPLITER)); + Item.Reset(ID_DEBUG_GENERATE_LOG_FILES, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Generate Log Files"); + if (g_Settings->LoadBool(Debugger_GenerateLogFiles)) + { + Item.SetItemTicked(true); + } + DebugMenu.push_back(Item); + } + + /* Help Menu + ****************/ + MenuItemList HelpMenu; + + HelpMenu.push_back(MENU_ITEM(ID_HELP_SUPPORTFORUM, MENU_FORUM)); + HelpMenu.push_back(MENU_ITEM(ID_HELP_HOMEPAGE, MENU_HOMEPAGE)); + HelpMenu.push_back(MENU_ITEM(SPLITER)); + if (!inBasicMode) + { + HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUTSETTINGFILES, MENU_ABOUT_INI)); + } + HelpMenu.push_back(MENU_ITEM(ID_HELP_ABOUT, MENU_ABOUT_PJ64)); + + /* Main Title bar Menu + ***********************/ + MenuItemList MainTitleMenu; + Item.Reset(SUB_MENU, MENU_FILE, EMPTY_STDSTR, &FileMenu); + if (RomLoading) { Item.SetItemEnabled(false); } + MainTitleMenu.push_back(Item); + if (CPURunning) + { + Item.Reset(SUB_MENU, MENU_SYSTEM, EMPTY_STDSTR, &SystemMenu); + if (RomLoading) { Item.SetItemEnabled(false); } + MainTitleMenu.push_back(Item); + } + Item.Reset(SUB_MENU, MENU_OPTIONS, EMPTY_STDSTR, &OptionMenu); + if (RomLoading) { Item.SetItemEnabled(false); } + MainTitleMenu.push_back(Item); + if (!inBasicMode) + { + if (bHaveDebugger()) + { + Item.Reset(SUB_MENU, MENU_DEBUGGER, EMPTY_STDSTR, &DebugMenu); + if (RomLoading) { Item.SetItemEnabled(false); } + MainTitleMenu.push_back(Item); + } + } + Item.Reset(SUB_MENU, MENU_HELP, EMPTY_STDSTR, &HelpMenu); + if (RomLoading) { Item.SetItemEnabled(false); } + MainTitleMenu.push_back(Item); + + AddMenu(hMenu, MainTitleMenu); } void CMainMenu::RebuildAccelerators(void) { - CGuard Guard(m_CS); + CGuard Guard(m_CS); - //Delete the old accel list - WriteTrace(TraceDebug,__FUNCTION__ ": Start"); + //Delete the old accel list + WriteTrace(TraceDebug, __FUNCTION__ ": Start"); - HACCEL m_OldAccelTable = (HACCEL)m_AccelTable; - m_AccelTable = m_ShortCuts.GetAcceleratorTable(); - if (m_OldAccelTable) { - DestroyAcceleratorTable(m_OldAccelTable); - } - WriteTrace(TraceDebug,__FUNCTION__ ": Done"); + HACCEL m_OldAccelTable = (HACCEL)m_AccelTable; + m_AccelTable = m_ShortCuts.GetAcceleratorTable(); + if (m_OldAccelTable) { + DestroyAcceleratorTable(m_OldAccelTable); + } + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); } -void CMainMenu::ResetMenu(void) +void CMainMenu::ResetMenu(void) { - WriteTrace(TraceDebug,__FUNCTION__ ": Start"); - if (!g_Settings->LoadBool(UserInterface_InFullScreen)) - { - //Create a new window with all the items - WriteTrace(TraceDebug,__FUNCTION__ ": Create Menu"); - HMENU hMenu = (HMENU)CreateMenu(); - FillOutMenu(hMenu); - WriteTrace(TraceDebug,__FUNCTION__ ": Create Menu Done"); + WriteTrace(TraceDebug, __FUNCTION__ ": Start"); + if (!g_Settings->LoadBool(UserInterface_InFullScreen)) + { + //Create a new window with all the items + WriteTrace(TraceDebug, __FUNCTION__ ": Create Menu"); + HMENU hMenu = (HMENU)CreateMenu(); + FillOutMenu(hMenu); + WriteTrace(TraceDebug, __FUNCTION__ ": Create Menu Done"); - //save old menu to destroy latter - HMENU OldMenuHandle; - { - CGuard Guard(m_CS); - OldMenuHandle = m_MenuHandle; + //save old menu to destroy latter + HMENU OldMenuHandle; + { + CGuard Guard(m_CS); + OldMenuHandle = m_MenuHandle; - //save handle and re-attach to a window - WriteTrace(TraceDebug,__FUNCTION__ ": Attach Menu"); - m_MenuHandle = hMenu; - } - _Gui->SetWindowMenu(this); + //save handle and re-attach to a window + WriteTrace(TraceDebug, __FUNCTION__ ": Attach Menu"); + m_MenuHandle = hMenu; + } + _Gui->SetWindowMenu(this); - WriteTrace(TraceDebug,__FUNCTION__ ": Remove plugin menu"); - if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) - { - RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->Gfx()->GetDebugMenu(), MF_BYCOMMAND); - } - if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu())) - { - RemoveMenu((HMENU)OldMenuHandle,(DWORD)g_Plugins->RSP()->GetDebugMenu(), MF_BYCOMMAND); - } - WriteTrace(TraceDebug,__FUNCTION__ ": Destroy Old Menu"); + WriteTrace(TraceDebug, __FUNCTION__ ": Remove plugin menu"); + if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) + { + RemoveMenu((HMENU)OldMenuHandle, (DWORD)g_Plugins->Gfx()->GetDebugMenu(), MF_BYCOMMAND); + } + if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu())) + { + RemoveMenu((HMENU)OldMenuHandle, (DWORD)g_Plugins->RSP()->GetDebugMenu(), MF_BYCOMMAND); + } + WriteTrace(TraceDebug, __FUNCTION__ ": Destroy Old Menu"); - //Destroy the old menu - DestroyMenu((HMENU)OldMenuHandle); - } + //Destroy the old menu + DestroyMenu((HMENU)OldMenuHandle); + } - ResetAccelerators(); + ResetAccelerators(); - WriteTrace(TraceDebug,__FUNCTION__ ": Done"); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); } -#endif +#endif \ No newline at end of file diff --git a/Source/Project64/User Interface/Main Menu Class.h b/Source/Project64/User Interface/Main Menu Class.h index 880c36208..bf382b57e 100644 --- a/Source/Project64/User Interface/Main Menu Class.h +++ b/Source/Project64/User Interface/Main Menu Class.h @@ -1,85 +1,85 @@ #pragma once -enum MainMenuID +enum MainMenuID { - //File Menu - ID_FILE_OPEN_ROM = 4000, ID_FILE_ROM_INFO, ID_FILE_STARTEMULATION, ID_FILE_ENDEMULATION, - ID_FILE_ROMDIRECTORY, ID_FILE_REFRESHROMLIST, ID_FILE_EXIT, + //File Menu + ID_FILE_OPEN_ROM = 4000, ID_FILE_ROM_INFO, ID_FILE_STARTEMULATION, ID_FILE_ENDEMULATION, + ID_FILE_ROMDIRECTORY, ID_FILE_REFRESHROMLIST, ID_FILE_EXIT, - //language - ID_LANG_START, ID_LANG_END = ID_LANG_START + 100, + //language + ID_LANG_START, ID_LANG_END = ID_LANG_START + 100, - //Recent Files - ID_RECENT_ROM_START, ID_RECENT_ROM_END = ID_RECENT_ROM_START + 20, - - //Recent Dir - ID_RECENT_DIR_START, ID_RECENT_DIR_END = ID_RECENT_DIR_START + 20, + //Recent Files + ID_RECENT_ROM_START, ID_RECENT_ROM_END = ID_RECENT_ROM_START + 20, - //System Menu - ID_SYSTEM_RESET_SOFT, ID_SYSTEM_RESET_HARD, ID_SYSTEM_PAUSE, ID_SYSTEM_BITMAP, - ID_SYSTEM_LIMITFPS, ID_SYSTEM_RESTORE, ID_SYSTEM_LOAD, ID_SYSTEM_SAVE, - ID_SYSTEM_SAVEAS, ID_SYSTEM_CHEAT, ID_SYSTEM_GSBUTTON, + //Recent Dir + ID_RECENT_DIR_START, ID_RECENT_DIR_END = ID_RECENT_DIR_START + 20, - //Current Save Slot - ID_CURRENT_SAVE_1,ID_CURRENT_SAVE_2,ID_CURRENT_SAVE_3,ID_CURRENT_SAVE_4,ID_CURRENT_SAVE_5, - ID_CURRENT_SAVE_6,ID_CURRENT_SAVE_7,ID_CURRENT_SAVE_8,ID_CURRENT_SAVE_9,ID_CURRENT_SAVE_10, - ID_CURRENT_SAVE_DEFAULT, - - //Option Menu - ID_OPTIONS_FULLSCREEN, ID_OPTIONS_FULLSCREEN2, ID_OPTIONS_ALWAYSONTOP, ID_OPTIONS_CONFIG_GFX, - ID_OPTIONS_CONFIG_AUDIO, ID_OPTIONS_CONFIG_CONT,ID_OPTIONS_CONFIG_RSP, ID_OPTIONS_CPU_USAGE, - ID_OPTIONS_SETTINGS, ID_OPTIONS_DISPLAY_FR, ID_OPTIONS_CHANGE_FR, ID_OPTIONS_INCREASE_SPEED, - ID_OPTIONS_DECREASE_SPEED, + //System Menu + ID_SYSTEM_RESET_SOFT, ID_SYSTEM_RESET_HARD, ID_SYSTEM_PAUSE, ID_SYSTEM_BITMAP, + ID_SYSTEM_LIMITFPS, ID_SYSTEM_RESTORE, ID_SYSTEM_LOAD, ID_SYSTEM_SAVE, + ID_SYSTEM_SAVEAS, ID_SYSTEM_CHEAT, ID_SYSTEM_GSBUTTON, - //Debugger Menu - ID_DEBUG_SHOW_TLB_MISSES, ID_DEBUG_SHOW_UNHANDLED_MEM, ID_DEBUG_SHOW_PIF_ERRORS, - ID_DEBUG_SHOW_DLIST_COUNT, ID_DEBUG_SHOW_RECOMP_MEM_SIZE,ID_DEBUG_SHOW_DIV_BY_ZERO, - ID_DEBUG_GENERATE_LOG_FILES, ID_DEBUG_DISABLE_GAMEFIX, - ID_DEBUGGER_LOGOPTIONS, ID_DEBUGGER_GENERATELOG, ID_DEBUGGER_DUMPMEMORY, ID_DEBUGGER_SEARCHMEMORY, - ID_DEBUGGER_TLBENTRIES, ID_DEBUGGER_BREAKPOINTS, ID_DEBUGGER_MEMORY, ID_DEBUGGER_R4300REGISTERS, - ID_DEBUGGER_INTERRUPT_SP, ID_DEBUGGER_INTERRUPT_SI, ID_DEBUGGER_INTERRUPT_AI, ID_DEBUGGER_INTERRUPT_VI, - ID_DEBUGGER_INTERRUPT_PI, ID_DEBUGGER_INTERRUPT_DP, + //Current Save Slot + ID_CURRENT_SAVE_1, ID_CURRENT_SAVE_2, ID_CURRENT_SAVE_3, ID_CURRENT_SAVE_4, ID_CURRENT_SAVE_5, + ID_CURRENT_SAVE_6, ID_CURRENT_SAVE_7, ID_CURRENT_SAVE_8, ID_CURRENT_SAVE_9, ID_CURRENT_SAVE_10, + ID_CURRENT_SAVE_DEFAULT, - // App logging - ID_DEBUGGER_APPLOG_ERRORS, ID_DEBUGGER_APPLOG_SETTINGS, ID_DEBUGGER_APPLOG_GFX_PLUGIN, - ID_DEBUGGER_APPLOG_DEBUG, ID_DEBUGGER_APPLOG_FLUSH, ID_DEBUGGER_APPLOG_RECOMPILER, - ID_DEBUGGER_APPLOG_RSP, ID_DEBUGGER_APPLOG_TLB, ID_DEBUGGER_APPLOG_AUDIO_EMU, + //Option Menu + ID_OPTIONS_FULLSCREEN, ID_OPTIONS_FULLSCREEN2, ID_OPTIONS_ALWAYSONTOP, ID_OPTIONS_CONFIG_GFX, + ID_OPTIONS_CONFIG_AUDIO, ID_OPTIONS_CONFIG_CONT, ID_OPTIONS_CONFIG_RSP, ID_OPTIONS_CPU_USAGE, + ID_OPTIONS_SETTINGS, ID_OPTIONS_DISPLAY_FR, ID_OPTIONS_CHANGE_FR, ID_OPTIONS_INCREASE_SPEED, + ID_OPTIONS_DECREASE_SPEED, - //Profile Menu - ID_PROFILE_PROFILE, ID_PROFILE_RESETCOUNTER, ID_PROFILE_GENERATELOG, + //Debugger Menu + ID_DEBUG_SHOW_TLB_MISSES, ID_DEBUG_SHOW_UNHANDLED_MEM, ID_DEBUG_SHOW_PIF_ERRORS, + ID_DEBUG_SHOW_DLIST_COUNT, ID_DEBUG_SHOW_RECOMP_MEM_SIZE, ID_DEBUG_SHOW_DIV_BY_ZERO, + ID_DEBUG_GENERATE_LOG_FILES, ID_DEBUG_DISABLE_GAMEFIX, + ID_DEBUGGER_LOGOPTIONS, ID_DEBUGGER_GENERATELOG, ID_DEBUGGER_DUMPMEMORY, ID_DEBUGGER_SEARCHMEMORY, + ID_DEBUGGER_TLBENTRIES, ID_DEBUGGER_BREAKPOINTS, ID_DEBUGGER_MEMORY, ID_DEBUGGER_R4300REGISTERS, + ID_DEBUGGER_INTERRUPT_SP, ID_DEBUGGER_INTERRUPT_SI, ID_DEBUGGER_INTERRUPT_AI, ID_DEBUGGER_INTERRUPT_VI, + ID_DEBUGGER_INTERRUPT_PI, ID_DEBUGGER_INTERRUPT_DP, - //Help Menu - ID_HELP_SUPPORTFORUM, ID_HELP_HOMEPAGE, ID_HELP_ABOUTSETTINGFILES, ID_HELP_ABOUT, + // App logging + ID_DEBUGGER_APPLOG_ERRORS, ID_DEBUGGER_APPLOG_SETTINGS, ID_DEBUGGER_APPLOG_GFX_PLUGIN, + ID_DEBUGGER_APPLOG_DEBUG, ID_DEBUGGER_APPLOG_FLUSH, ID_DEBUGGER_APPLOG_RECOMPILER, + ID_DEBUGGER_APPLOG_RSP, ID_DEBUGGER_APPLOG_TLB, ID_DEBUGGER_APPLOG_AUDIO_EMU, + + //Profile Menu + ID_PROFILE_PROFILE, ID_PROFILE_RESETCOUNTER, ID_PROFILE_GENERATELOG, + + //Help Menu + ID_HELP_SUPPORTFORUM, ID_HELP_HOMEPAGE, ID_HELP_ABOUTSETTINGFILES, ID_HELP_ABOUT, }; class CMainMenu : - public CBaseMenu, - private CDebugSettings + public CBaseMenu, + private CDebugSettings { - typedef std::list SettingList; + typedef std::list SettingList; - CMainGui * _Gui; + CMainGui * _Gui; - //MSC_MAP m_ShortCuts; - void * m_AccelTable; - bool m_ResetAccelerators; - CShortCuts m_ShortCuts; - SettingList m_ChangeSettingList; - CriticalSection m_CS; - - void FillOutMenu ( HMENU hMenu ); - //stdstr ShortCutString(MSC_MAP & ShortCuts, int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel); - std::wstring GetSaveSlotString ( int Slot ); - stdstr GetFileLastMod ( stdstr FileName ); - void RebuildAccelerators ( void ); + //MSC_MAP m_ShortCuts; + void * m_AccelTable; + bool m_ResetAccelerators; + CShortCuts m_ShortCuts; + SettingList m_ChangeSettingList; + CriticalSection m_CS; - static void SettingsChanged (CMainMenu * _this ); + void FillOutMenu(HMENU hMenu); + //stdstr ShortCutString(MSC_MAP & ShortCuts, int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel); + std::wstring GetSaveSlotString(int Slot); + stdstr GetFileLastMod(stdstr FileName); + void RebuildAccelerators(void); + + static void SettingsChanged(CMainMenu * _this); public: - CMainMenu ( CMainGui * Window ); - ~CMainMenu(); - - int ProcessAccelerator ( HWND hWnd, void * lpMsg ); - bool ProcessMessage ( HWND hWnd, DWORD wNotifyCode, DWORD wID); - void ResetMenu ( void ); - void ResetAccelerators ( void ) { m_ResetAccelerators = true; } + CMainMenu(CMainGui * Window); + ~CMainMenu(); + + int ProcessAccelerator(HWND hWnd, void * lpMsg); + bool ProcessMessage(HWND hWnd, DWORD wNotifyCode, DWORD wID); + void ResetMenu(void); + void ResetAccelerators(void) { m_ResetAccelerators = true; } }; From 6d38975b985049f6ba68397c73bbd5c83de8a397 Mon Sep 17 00:00:00 2001 From: zilmar Date: Thu, 12 Nov 2015 23:09:34 +1100 Subject: [PATCH 046/102] [Project64] More code cleanup of gui class --- Source/Project64/N64 System/N64 Class.cpp | 24 ---- Source/Project64/N64 System/N64 Class.h | 1 - .../User Interface/Main Menu Class.cpp | 115 ++++++++++-------- .../User Interface/Main Menu Class.h | 41 ++++--- 4 files changed, 88 insertions(+), 93 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index eef3d2e92..cd70b8a1a 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -459,30 +459,6 @@ void CN64System::Pause() Notify().DisplayMessage(5, MSG_CPU_RESUMED); } -stdstr CN64System::ChooseFileToOpen(HWND hParent) -{ - OPENFILENAME openfilename; - char FileName[_MAX_PATH], Directory[_MAX_PATH]; - - memset(&FileName, 0, sizeof(FileName)); - memset(&openfilename, 0, sizeof(openfilename)); - - strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str()); - - openfilename.lStructSize = sizeof(openfilename); - openfilename.hwndOwner = (HWND)hParent; - openfilename.lpstrFilter = "N64 ROMs (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0"; - openfilename.lpstrFile = FileName; - openfilename.lpstrInitialDir = Directory; - openfilename.nMaxFile = MAX_PATH; - openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - - if (GetOpenFileName(&openfilename)) - { - return stdstr(FileName); - } - return stdstr(""); -} void CN64System::GameReset() { diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index b703e1861..beb835c77 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -50,7 +50,6 @@ public: void CloseCpu(); void ExternalEvent(SystemEvent action); //covers gui interacting and timers etc.. - stdstr ChooseFileToOpen(HWND hParent); void DisplayRomInfo(HWND hParent); void StartEmulation(bool NewThread); void SyncToAudio(); diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index 0fec51d61..bfdf6baa4 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -1,14 +1,13 @@ #include "stdafx.h" -#ifdef WINDOWS_UI #include #include CMainMenu::CMainMenu(CMainGui * hMainWindow) : CBaseMenu(), -m_ResetAccelerators(true) +m_ResetAccelerators(true), +m_Gui(hMainWindow) { - _Gui = hMainWindow; //Make a copy of the attatched window ResetMenu(); hMainWindow->SetWindowMenu(this); @@ -63,13 +62,39 @@ int CMainMenu::ProcessAccelerator(HWND hWnd, void * lpMsg) return TranslateAccelerator((HWND)hWnd, (HACCEL)m_AccelTable, (LPMSG)lpMsg); } +stdstr CMainMenu::ChooseFileToOpen(HWND hParent) +{ + OPENFILENAME openfilename; + char FileName[_MAX_PATH], Directory[_MAX_PATH]; + + memset(&FileName, 0, sizeof(FileName)); + memset(&openfilename, 0, sizeof(openfilename)); + + strcpy(Directory, g_Settings->LoadStringVal(Directory_Game).c_str()); + + openfilename.lStructSize = sizeof(openfilename); + openfilename.hwndOwner = (HWND)hParent; + openfilename.lpstrFilter = "N64 ROMs (*.zip, *.7z, *.?64, *.rom, *.usa, *.jap, *.pal, *.bin)\0*.?64;*.zip;*.7z;*.bin;*.rom;*.usa;*.jap;*.pal\0All files (*.*)\0*.*\0"; + openfilename.lpstrFile = FileName; + openfilename.lpstrInitialDir = Directory; + openfilename.nMaxFile = MAX_PATH; + openfilename.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + + if (GetOpenFileName(&openfilename)) + { + return stdstr(FileName); + } + return stdstr(""); +} + bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuID) { switch (MenuID) { case ID_FILE_OPEN_ROM: { - stdstr File = g_BaseSystem->ChooseFileToOpen(hWnd); - if (File.length() > 0) { + stdstr File = ChooseFileToOpen(hWnd); + if (File.length() > 0) + { g_BaseSystem->RunFileImage(File.c_str()); } } @@ -80,7 +105,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI } break; case ID_FILE_STARTEMULATION: - _Gui->SaveWindowLoc(); + m_Gui->SaveWindowLoc(); //Before we go and create the new system, ensure the previous one has been closed CN64System::CloseSystem(); //Ok now g_BaseSystem should definitely be clean for initialization @@ -91,16 +116,16 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI case ID_FILE_ENDEMULATION: WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ENDEMULATION"); CN64System::CloseSystem(); - _Gui->SaveWindowLoc(); + m_Gui->SaveWindowLoc(); break; case ID_FILE_ROMDIRECTORY: WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ROMDIRECTORY 1"); - _Gui->SelectRomDir(); + m_Gui->SelectRomDir(); WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ROMDIRECTORY 2"); - _Gui->RefreshMenu(); + m_Gui->RefreshMenu(); WriteTrace(TraceDebug, __FUNCTION__ ": ID_FILE_ROMDIRECTORY 3"); break; - case ID_FILE_REFRESHROMLIST: _Gui->RefreshRomBrowser(); break; + case ID_FILE_REFRESHROMLIST: m_Gui->RefreshRomBrowser(); break; case ID_FILE_EXIT: DestroyWindow((HWND)hWnd); break; case ID_SYSTEM_RESET_SOFT: WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_RESET_SOFT"); @@ -111,16 +136,9 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI g_BaseSystem->ExternalEvent(SysEvent_ResetCPU_Hard); break; case ID_SYSTEM_PAUSE: - _Gui->SaveWindowLoc(); + m_Gui->SaveWindowLoc(); WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_PAUSE"); - if (g_Settings->LoadBool(GameRunning_CPU_Paused)) - { - g_BaseSystem->ExternalEvent(SysEvent_ResumeCPU_FromMenu); - } - else - { - g_BaseSystem->ExternalEvent(SysEvent_PauseCPU_FromMenu); - } + g_BaseSystem->ExternalEvent(g_Settings->LoadBool(GameRunning_CPU_Paused) ? SysEvent_ResumeCPU_FromMenu : SysEvent_PauseCPU_FromMenu); WriteTrace(TraceDebug, __FUNCTION__ ": ID_SYSTEM_PAUSE 1"); break; case ID_SYSTEM_BITMAP: @@ -253,14 +271,14 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI if (g_Settings->LoadBool(UserInterface_InFullScreen)) { WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN a"); - _Gui->MakeWindowOnTop(false); + m_Gui->MakeWindowOnTop(false); Notify().SetGfxPlugin(NULL); WriteTrace(TraceGfxPlugin, __FUNCTION__ ": ChangeWindow: Starting"); g_Plugins->Gfx()->ChangeWindow(); WriteTrace(TraceGfxPlugin, __FUNCTION__ ": ChangeWindow: Done"); ShowCursor(true); - _Gui->ShowStatusBar(true); - _Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); + m_Gui->ShowStatusBar(true); + m_Gui->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); g_Settings->SaveBool(UserInterface_InFullScreen, (DWORD)false); } else @@ -268,7 +286,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b"); ShowCursor(false); WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 1"); - _Gui->ShowStatusBar(false); + m_Gui->ShowStatusBar(false); WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 2"); try { @@ -284,7 +302,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI MessageBox(NULL, Message, "Exception", MB_OK); } WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 4"); - _Gui->MakeWindowOnTop(false); + m_Gui->MakeWindowOnTop(false); WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 5"); Notify().SetGfxPlugin(g_Plugins->Gfx()); WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_FULLSCREEN b 3"); @@ -297,12 +315,12 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI if (g_Settings->LoadDword(UserInterface_AlwaysOnTop)) { g_Settings->SaveBool(UserInterface_AlwaysOnTop, false); - _Gui->MakeWindowOnTop(false); + m_Gui->MakeWindowOnTop(false); } else { g_Settings->SaveBool(UserInterface_AlwaysOnTop, true); - _Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running)); + m_Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running)); } break; case ID_OPTIONS_CONFIG_RSP: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_RSP"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_RSP); break; @@ -474,14 +492,14 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI case ID_DEBUGGER_APPLOG_FLUSH: g_Settings->SaveBool(Debugger_AppLogFlush, !g_Settings->LoadBool(Debugger_AppLogFlush)); break; - case ID_DEBUGGER_LOGOPTIONS: _Gui->EnterLogOptions(); break; + case ID_DEBUGGER_LOGOPTIONS: m_Gui->EnterLogOptions(); break; case ID_DEBUGGER_GENERATELOG: g_Settings->SaveBool(Debugger_GenerateDebugLog, !g_Settings->LoadBool(Debugger_GenerateDebugLog)); break; - case ID_DEBUGGER_DUMPMEMORY: _Gui->Debug_ShowMemoryDump(); break; - case ID_DEBUGGER_SEARCHMEMORY: _Gui->Debug_ShowMemorySearch(); break; - case ID_DEBUGGER_MEMORY: _Gui->Debug_ShowMemoryWindow(); break; - case ID_DEBUGGER_TLBENTRIES: _Gui->Debug_ShowTLBWindow(); break; + case ID_DEBUGGER_DUMPMEMORY: m_Gui->Debug_ShowMemoryDump(); break; + case ID_DEBUGGER_SEARCHMEMORY: m_Gui->Debug_ShowMemorySearch(); break; + case ID_DEBUGGER_MEMORY: m_Gui->Debug_ShowMemoryWindow(); break; + case ID_DEBUGGER_TLBENTRIES: m_Gui->Debug_ShowTLBWindow(); break; case ID_DEBUGGER_INTERRUPT_SP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SP); break; case ID_DEBUGGER_INTERRUPT_SI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_SI); break; case ID_DEBUGGER_INTERRUPT_AI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_AI); break; @@ -489,7 +507,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI case ID_DEBUGGER_INTERRUPT_PI: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_PI); break; case ID_DEBUGGER_INTERRUPT_DP: g_BaseSystem->ExternalEvent(SysEvent_Interrupt_DP); break; case ID_CURRENT_SAVE_DEFAULT: - Notify().DisplayMessage(3, stdstr_f("Save Slot (%s) selected", GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str()).ToUTF16().c_str()); + g_Notify->DisplayMessage(3, stdstr_f("Save Slot (%s) selected", GetSaveSlotString(MenuID - ID_CURRENT_SAVE_DEFAULT).c_str()).ToUTF16().c_str()); g_Settings->SaveDword(Game_CurrentSaveState, (DWORD)(MenuID - ID_CURRENT_SAVE_DEFAULT)); break; case ID_CURRENT_SAVE_1: @@ -502,13 +520,13 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI case ID_CURRENT_SAVE_8: case ID_CURRENT_SAVE_9: case ID_CURRENT_SAVE_10: - Notify().DisplayMessage(3, stdstr_f("Save Slot (%s) selected", GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1)).ToUTF16().c_str()); + g_Notify->DisplayMessage(3, stdstr_f("Save Slot (%s) selected", GetSaveSlotString((MenuID - ID_CURRENT_SAVE_1) + 1)).ToUTF16().c_str()); g_Settings->SaveDword(Game_CurrentSaveState, (DWORD)((MenuID - ID_CURRENT_SAVE_1) + 1)); break; case ID_HELP_SUPPORTFORUM: ShellExecute(NULL, "open", "http://forum.pj64-emu.com/", NULL, NULL, SW_SHOWMAXIMIZED); break; case ID_HELP_HOMEPAGE: ShellExecute(NULL, "open", "http://www.pj64-emu.com", NULL, NULL, SW_SHOWMAXIMIZED); break; - case ID_HELP_ABOUT: _Gui->AboutBox(); break; - case ID_HELP_ABOUTSETTINGFILES: _Gui->AboutIniBox(); break; + case ID_HELP_ABOUT: m_Gui->AboutBox(); break; + case ID_HELP_ABOUTSETTINGFILES: m_Gui->AboutIniBox(); break; default: if (MenuID >= ID_RECENT_ROM_START && MenuID < ID_RECENT_ROM_END) { @@ -527,10 +545,10 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI { g_Settings->SaveString(Directory_Game, Dir.c_str()); Notify().AddRecentDir(Dir.c_str()); - _Gui->RefreshMenu(); - if (_Gui->RomBrowserVisible()) + m_Gui->RefreshMenu(); + if (m_Gui->RomBrowserVisible()) { - _Gui->RefreshRomBrowser(); + m_Gui->RefreshRomBrowser(); } } } @@ -546,10 +564,8 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI menuinfo.cch = sizeof(String); GetMenuItemInfoW((HMENU)m_MenuHandle, MenuID, FALSE, &menuinfo); - //See if the language has changed, if not do nothing - //Set the language g_Lang->SetLanguage(String); - _Gui->ResetRomBrowserColomuns(); + m_Gui->ResetRomBrowserColomuns(); break; } return false; @@ -882,7 +898,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) MenuItemList OptionMenu; Item.Reset(ID_OPTIONS_FULLSCREEN, MENU_FULL_SCREEN, m_ShortCuts.ShortCutString(ID_OPTIONS_FULLSCREEN, AccessLevel)); Item.SetItemEnabled(CPURunning); - if (g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL) + if (g_Plugins && g_Plugins->Gfx() && g_Plugins->Gfx()->ChangeWindow == NULL) { Item.SetItemEnabled(false); } @@ -897,7 +913,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) OptionMenu.push_back(MENU_ITEM(SPLITER)); Item.Reset(ID_OPTIONS_CONFIG_GFX, MENU_CONFG_GFX, m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_GFX, AccessLevel)); - if (g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->DllConfig == NULL) + if (g_Plugins && g_Plugins->Gfx() == NULL || g_Plugins->Gfx()->DllConfig == NULL) { Item.SetItemEnabled(false); } @@ -918,7 +934,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) OptionMenu.push_back(Item); } Item.Reset(ID_OPTIONS_CONFIG_CONT, MENU_CONFG_CTRL, m_ShortCuts.ShortCutString(ID_OPTIONS_CONFIG_CONT, AccessLevel)); - if (g_Plugins->Control() == NULL || g_Plugins->Control()->DllConfig == NULL) + if (g_Plugins && g_Plugins->Control() == NULL || g_Plugins->Control()->DllConfig == NULL) { Item.SetItemEnabled(false); } @@ -1071,7 +1087,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) /* Debug - RSP *******************/ - if (g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu())) + if (g_Plugins && g_Plugins->RSP() != NULL && IsMenu((HMENU)g_Plugins->RSP()->GetDebugMenu())) { Item.Reset(ID_PLUGIN_MENU, EMPTY_STRING, EMPTY_STDSTR, g_Plugins->RSP()->GetDebugMenu(), L"&RSP"); DebugMenu.push_back(Item); @@ -1079,7 +1095,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) /* Debug - RDP *******************/ - if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) + if (g_Plugins && g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) { Item.Reset(ID_PLUGIN_MENU, EMPTY_STRING, EMPTY_STDSTR, g_Plugins->Gfx()->GetDebugMenu(), L"&RDP"); DebugMenu.push_back(Item); @@ -1213,7 +1229,7 @@ void CMainMenu::ResetMenu(void) { //Create a new window with all the items WriteTrace(TraceDebug, __FUNCTION__ ": Create Menu"); - HMENU hMenu = (HMENU)CreateMenu(); + HMENU hMenu = CreateMenu(); FillOutMenu(hMenu); WriteTrace(TraceDebug, __FUNCTION__ ": Create Menu Done"); @@ -1227,7 +1243,7 @@ void CMainMenu::ResetMenu(void) WriteTrace(TraceDebug, __FUNCTION__ ": Attach Menu"); m_MenuHandle = hMenu; } - _Gui->SetWindowMenu(this); + m_Gui->SetWindowMenu(this); WriteTrace(TraceDebug, __FUNCTION__ ": Remove plugin menu"); if (g_Plugins->Gfx() != NULL && IsMenu((HMENU)g_Plugins->Gfx()->GetDebugMenu())) @@ -1247,5 +1263,4 @@ void CMainMenu::ResetMenu(void) ResetAccelerators(); WriteTrace(TraceDebug, __FUNCTION__ ": Done"); -} -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/Source/Project64/User Interface/Main Menu Class.h b/Source/Project64/User Interface/Main Menu Class.h index bf382b57e..48bdeb7cd 100644 --- a/Source/Project64/User Interface/Main Menu Class.h +++ b/Source/Project64/User Interface/Main Menu Class.h @@ -56,24 +56,6 @@ class CMainMenu : public CBaseMenu, private CDebugSettings { - typedef std::list SettingList; - - CMainGui * _Gui; - - //MSC_MAP m_ShortCuts; - void * m_AccelTable; - bool m_ResetAccelerators; - CShortCuts m_ShortCuts; - SettingList m_ChangeSettingList; - CriticalSection m_CS; - - void FillOutMenu(HMENU hMenu); - //stdstr ShortCutString(MSC_MAP & ShortCuts, int MenuID, CMenuShortCutKey::ACCESS_MODE AccessLevel); - std::wstring GetSaveSlotString(int Slot); - stdstr GetFileLastMod(stdstr FileName); - void RebuildAccelerators(void); - - static void SettingsChanged(CMainMenu * _this); public: CMainMenu(CMainGui * Window); ~CMainMenu(); @@ -82,4 +64,27 @@ public: bool ProcessMessage(HWND hWnd, DWORD wNotifyCode, DWORD wID); void ResetMenu(void); void ResetAccelerators(void) { m_ResetAccelerators = true; } + +private: + CMainMenu(); // Disable default constructor + CMainMenu(const CMainMenu&); // Disable copy constructor + CMainMenu& operator=(const CMainMenu&); // Disable assignment + + void FillOutMenu(HMENU hMenu); + std::wstring GetSaveSlotString(int Slot); + stdstr GetFileLastMod(stdstr FileName); + void RebuildAccelerators(void); + stdstr ChooseFileToOpen(HWND hParent); + + static void SettingsChanged(CMainMenu * _this); + + typedef std::list SettingList; + + CMainGui * m_Gui; + + void * m_AccelTable; + bool m_ResetAccelerators; + CShortCuts m_ShortCuts; + SettingList m_ChangeSettingList; + CriticalSection m_CS; }; From a4c438c20de201718eb5b72c1259fa3f64c0e612 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 13 Nov 2015 08:27:28 +1100 Subject: [PATCH 047/102] [Project64] Cleanup ModifiedEditBox.cpp --- .../WTL Controls/ModifiedEditBox.cpp | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp index d87c05bb1..cbdb5062b 100644 --- a/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp +++ b/Source/Project64/User Interface/WTL Controls/ModifiedEditBox.cpp @@ -23,84 +23,84 @@ m_bString(bString) CModifiedEditBox::~CModifiedEditBox() { - if (m_BoldFont) - { - DeleteObject(m_BoldFont); - } + if (m_BoldFont) + { + DeleteObject(m_BoldFont); + } } void CModifiedEditBox::SetReset(bool Reset) { - m_Reset = Reset; - if (m_Reset) - { - SetChanged(false); - } + m_Reset = Reset; + if (m_Reset) + { + SetChanged(false); + } } void CModifiedEditBox::SetChanged(bool Changed) { - m_Changed = Changed; - if (m_Changed) - { - SetReset(false); - if (m_BoldFont == NULL) - { - m_OriginalFont = (HFONT)SendMessage(WM_GETFONT); + m_Changed = Changed; + if (m_Changed) + { + SetReset(false); + if (m_BoldFont == NULL) + { + m_OriginalFont = (HFONT)SendMessage(WM_GETFONT); - LOGFONT lfSystemVariableFont; - GetObject(m_OriginalFont, sizeof(LOGFONT), &lfSystemVariableFont); - lfSystemVariableFont.lfWeight = FW_BOLD; + LOGFONT lfSystemVariableFont; + GetObject(m_OriginalFont, sizeof(LOGFONT), &lfSystemVariableFont); + lfSystemVariableFont.lfWeight = FW_BOLD; - m_BoldFont = CreateFontIndirect(&lfSystemVariableFont); - } - SendMessage(WM_SETFONT, (WPARAM)m_BoldFont); - InvalidateRect(NULL); - if (m_TextField) - { - ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_BoldFont, 0); - ::InvalidateRect(m_TextField, NULL, true); - } - } - else - { - if (m_OriginalFont) - { - SendMessage(WM_SETFONT, (WPARAM)m_OriginalFont); - InvalidateRect(NULL); - if (m_TextField) - { - ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_OriginalFont, 0); - ::InvalidateRect(m_TextField, NULL, true); - } - } - } + m_BoldFont = CreateFontIndirect(&lfSystemVariableFont); + } + SendMessage(WM_SETFONT, (WPARAM)m_BoldFont); + InvalidateRect(NULL); + if (m_TextField) + { + ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_BoldFont, 0); + ::InvalidateRect(m_TextField, NULL, true); + } + } + else + { + if (m_OriginalFont) + { + SendMessage(WM_SETFONT, (WPARAM)m_OriginalFont); + InvalidateRect(NULL); + if (m_TextField) + { + ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_OriginalFont, 0); + ::InvalidateRect(m_TextField, NULL, true); + } + } + } } stdstr CModifiedEditBox::GetWindowText(void) { - stdstr Result; - ATLASSERT(::IsWindow(m_hWnd)); + stdstr Result; + ATLASSERT(::IsWindow(m_hWnd)); - int nLen = ::GetWindowTextLength(m_hWnd); - if (nLen == 0) - { - return Result; - } - Result.resize(nLen + 1); - ::GetWindowText(m_hWnd, (char *)Result.c_str(), nLen + 1); - return Result; + int nLen = ::GetWindowTextLength(m_hWnd); + if (nLen == 0) + { + return Result; + } + Result.resize(nLen + 1); + ::GetWindowText(m_hWnd, (char *)Result.c_str(), nLen + 1); + return Result; } void CModifiedEditBox::SetTextField(HWND hWnd) { - if (m_TextField && m_OriginalFont) - { - ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_OriginalFont, 0); - } - m_TextField = hWnd; - if (m_Changed && m_BoldFont) - { - ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_BoldFont, 0); - } -} + if (m_TextField && m_OriginalFont) + { + ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_OriginalFont, 0); + } + m_TextField = hWnd; + if (m_Changed && m_BoldFont) + { + ::SendMessage(m_TextField, WM_SETFONT, (WPARAM)m_BoldFont, 0); + } +} \ No newline at end of file From 1b2febc3c2f302e76036d08ad881aa1394180629 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 13 Nov 2015 08:30:40 +1100 Subject: [PATCH 048/102] [Project64] Clean up Settings Page - Keyboard Shortcuts.cpp --- .../Settings Page - Keyboard Shortcuts.cpp | 540 +++++++++--------- 1 file changed, 270 insertions(+), 270 deletions(-) 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 9eb9ebe51..29aaff1db 100644 --- a/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp +++ b/Source/Project64/User Interface/Settings/Settings Page - Keyboard Shortcuts.cpp @@ -15,362 +15,362 @@ COptionsShortCutsPage::COptionsShortCutsPage(HWND hParent, const RECT & rcDispay) : m_EnableReset(false) { - if (!Create(hParent, rcDispay)) - { - return; - } + if (!Create(hParent, rcDispay)) + { + return; + } - SetDlgItemTextW(m_hWnd, IDC_S_CPU_STATE, GS(ACCEL_CPUSTATE_TITLE)); - SetDlgItemTextW(m_hWnd, IDC_MENU_ITEM_TEXT, GS(ACCEL_MENUITEM_TITLE)); - SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_KEYS, GS(ACCEL_CURRENTKEYS_TITLE)); - SetDlgItemTextW(m_hWnd, IDC_S_SELECT_SHORT, GS(ACCEL_SELKEY_TITLE)); - SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_ASSIGN, GS(ACCEL_ASSIGNEDTO_TITLE)); - SetDlgItemTextW(m_hWnd, IDC_ASSIGN, GS(ACCEL_ASSIGN_BTN)); - SetDlgItemTextW(m_hWnd, IDC_REMOVE, GS(ACCEL_REMOVE_BTN)); - SetDlgItemTextW(m_hWnd, IDC_KEY_PROMPT, GS(ACCEL_DETECTKEY)); + SetDlgItemTextW(m_hWnd, IDC_S_CPU_STATE, GS(ACCEL_CPUSTATE_TITLE)); + SetDlgItemTextW(m_hWnd, IDC_MENU_ITEM_TEXT, GS(ACCEL_MENUITEM_TITLE)); + SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_KEYS, GS(ACCEL_CURRENTKEYS_TITLE)); + SetDlgItemTextW(m_hWnd, IDC_S_SELECT_SHORT, GS(ACCEL_SELKEY_TITLE)); + SetDlgItemTextW(m_hWnd, IDC_S_CURRENT_ASSIGN, GS(ACCEL_ASSIGNEDTO_TITLE)); + SetDlgItemTextW(m_hWnd, IDC_ASSIGN, GS(ACCEL_ASSIGN_BTN)); + SetDlgItemTextW(m_hWnd, IDC_REMOVE, GS(ACCEL_REMOVE_BTN)); + SetDlgItemTextW(m_hWnd, IDC_KEY_PROMPT, GS(ACCEL_DETECTKEY)); - m_CreateNewShortCut.AttachToDlgItem(m_hWnd, IDC_S_SELECT_SHORT); - m_CpuState.Attach(GetDlgItem(IDC_C_CPU_STATE)); - m_MenuItems.Attach(GetDlgItem(IDC_MENU_ITEMS)); - m_CurrentKeys.Attach(GetDlgItem(IDC_CURRENT_KEYS)); - m_VirtualKeyList.Attach(GetDlgItem(IDC_VIRTUALKEY)); + m_CreateNewShortCut.AttachToDlgItem(m_hWnd, IDC_S_SELECT_SHORT); + m_CpuState.Attach(GetDlgItem(IDC_C_CPU_STATE)); + m_MenuItems.Attach(GetDlgItem(IDC_MENU_ITEMS)); + m_CurrentKeys.Attach(GetDlgItem(IDC_CURRENT_KEYS)); + m_VirtualKeyList.Attach(GetDlgItem(IDC_VIRTUALKEY)); - m_MenuItems.ModifyStyle(0, TVS_SHOWSELALWAYS); + m_MenuItems.ModifyStyle(0, TVS_SHOWSELALWAYS); - m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_1)), CMenuShortCutKey::GAME_NOT_RUNNING); - m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_3)), CMenuShortCutKey::GAME_RUNNING_WINDOW); - m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_4)), CMenuShortCutKey::GAME_RUNNING_FULLSCREEN); - m_CpuState.SetCurSel(0); + m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_1)), CMenuShortCutKey::GAME_NOT_RUNNING); + m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_3)), CMenuShortCutKey::GAME_RUNNING_WINDOW); + m_CpuState.SetItemData(m_CpuState.AddStringW(GS(ACCEL_CPUSTATE_4)), CMenuShortCutKey::GAME_RUNNING_FULLSCREEN); + m_CpuState.SetCurSel(0); - int VirtualKeyListSize; - VIRTUAL_KEY * VirtualKeyList = CMenuShortCutKey::VirtualKeyList(VirtualKeyListSize); - for (int count = 0; count < VirtualKeyListSize; count++) - { - m_VirtualKeyList.SetItemData(m_VirtualKeyList.AddString(VirtualKeyList[count].Name), VirtualKeyList[count].Key); - } + int VirtualKeyListSize; + VIRTUAL_KEY * VirtualKeyList = CMenuShortCutKey::VirtualKeyList(VirtualKeyListSize); + for (int count = 0; count < VirtualKeyListSize; count++) + { + m_VirtualKeyList.SetItemData(m_VirtualKeyList.AddString(VirtualKeyList[count].Name), VirtualKeyList[count].Key); + } - OnCpuStateChanged(LBN_SELCHANGE, IDC_C_CPU_STATE, GetDlgItem(IDC_C_CPU_STATE)); - CheckResetEnable(); + OnCpuStateChanged(LBN_SELCHANGE, IDC_C_CPU_STATE, GetDlgItem(IDC_C_CPU_STATE)); + CheckResetEnable(); } void COptionsShortCutsPage::CheckResetEnable(void) { - MSC_MAP & ShortCuts = m_ShortCuts.GetShortCuts(); - for (MSC_MAP::iterator Item = ShortCuts.begin(); Item != ShortCuts.end(); Item++) - { - const SHORTCUT_KEY_LIST & ShortCutList = Item->second.GetAccelItems(); - for (SHORTCUT_KEY_LIST::const_iterator ShortCut_item = ShortCutList.begin(); ShortCut_item != ShortCutList.end(); ShortCut_item++) - { - if (!ShortCut_item->Inactive() && !ShortCut_item->UserAdded()) - { - continue; - } - m_EnableReset = true; - return; - } - } - m_EnableReset = false; + MSC_MAP & ShortCuts = m_ShortCuts.GetShortCuts(); + for (MSC_MAP::iterator Item = ShortCuts.begin(); Item != ShortCuts.end(); Item++) + { + const SHORTCUT_KEY_LIST & ShortCutList = Item->second.GetAccelItems(); + for (SHORTCUT_KEY_LIST::const_iterator ShortCut_item = ShortCutList.begin(); ShortCut_item != ShortCutList.end(); ShortCut_item++) + { + if (!ShortCut_item->Inactive() && !ShortCut_item->UserAdded()) + { + continue; + } + m_EnableReset = true; + return; + } + } + m_EnableReset = false; } void COptionsShortCutsPage::OnCpuStateChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) { - ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); + ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); - MSC_MAP & ShortCuts = m_ShortCuts.GetShortCuts(); - m_MenuItems.DeleteAllItems(); + MSC_MAP & ShortCuts = m_ShortCuts.GetShortCuts(); + m_MenuItems.DeleteAllItems(); - for (MSC_MAP::iterator Item = ShortCuts.begin(); Item != ShortCuts.end(); Item++) - { - ACCESS_MODE ItemMode = Item->second.AccessMode(); - if ((ItemMode & AccessLevel) != AccessLevel) - { - continue; - } - //find Parent - HTREEITEM hParent = m_MenuItems.GetChildItem(TVI_ROOT); - while (hParent) - { - if (m_MenuItems.GetItemData(hParent) == (DWORD_PTR)Item->second.Section()) - { - break; - } - hParent = m_MenuItems.GetNextSiblingItem(hParent); - } + for (MSC_MAP::iterator Item = ShortCuts.begin(); Item != ShortCuts.end(); Item++) + { + ACCESS_MODE ItemMode = Item->second.AccessMode(); + if ((ItemMode & AccessLevel) != AccessLevel) + { + continue; + } + //find Parent + HTREEITEM hParent = m_MenuItems.GetChildItem(TVI_ROOT); + while (hParent) + { + if (m_MenuItems.GetItemData(hParent) == (DWORD_PTR)Item->second.Section()) + { + break; + } + hParent = m_MenuItems.GetNextSiblingItem(hParent); + } - if (hParent == NULL) - { - hParent = m_MenuItems.InsertItemW(TVIF_TEXT | TVIF_PARAM, GS(Item->second.Section()), 0, 0, 0, 0, Item->second.Section(), TVI_ROOT, TVI_LAST); - } + if (hParent == NULL) + { + hParent = m_MenuItems.InsertItemW(TVIF_TEXT | TVIF_PARAM, GS(Item->second.Section()), 0, 0, 0, 0, Item->second.Section(), TVI_ROOT, TVI_LAST); + } - wstring str = GS(Item->second.Title()); - std::wstring::size_type pos = str.find(L"&"); - while (pos != std::wstring::npos) - { - str.replace(pos, 1, L""); - pos = str.find(L"&", pos); - } - pos = str.find(L"..."); - while (pos != std::wstring::npos) - { - str.replace(pos, 3, L""); - pos = str.find(L"...", pos); - } + wstring str = GS(Item->second.Title()); + std::wstring::size_type pos = str.find(L"&"); + while (pos != std::wstring::npos) + { + str.replace(pos, 1, L""); + pos = str.find(L"&", pos); + } + pos = str.find(L"..."); + while (pos != std::wstring::npos) + { + str.replace(pos, 3, L""); + pos = str.find(L"...", pos); + } - HTREEITEM hItem = m_MenuItems.InsertItemW(TVIF_TEXT | TVIF_PARAM, str.c_str(), 0, 0, 0, 0, (DWORD_PTR)&Item->second, hParent, TVI_LAST); + HTREEITEM hItem = m_MenuItems.InsertItemW(TVIF_TEXT | TVIF_PARAM, str.c_str(), 0, 0, 0, 0, (DWORD_PTR)&Item->second, hParent, TVI_LAST); - const SHORTCUT_KEY_LIST & ShortCutList = Item->second.GetAccelItems(); - for (SHORTCUT_KEY_LIST::const_iterator ShortCut_item = ShortCutList.begin(); ShortCut_item != ShortCutList.end(); ShortCut_item++) - { - if (!ShortCut_item->Inactive() && !ShortCut_item->UserAdded()) - { - continue; - } - m_MenuItems.SetItemState(hItem, TVIS_BOLD, TVIS_BOLD); - m_MenuItems.SetItemState(hParent, TVIS_BOLD, TVIS_BOLD); - break; - } - } + const SHORTCUT_KEY_LIST & ShortCutList = Item->second.GetAccelItems(); + for (SHORTCUT_KEY_LIST::const_iterator ShortCut_item = ShortCutList.begin(); ShortCut_item != ShortCutList.end(); ShortCut_item++) + { + if (!ShortCut_item->Inactive() && !ShortCut_item->UserAdded()) + { + continue; + } + m_MenuItems.SetItemState(hItem, TVIS_BOLD, TVIS_BOLD); + m_MenuItems.SetItemState(hParent, TVIS_BOLD, TVIS_BOLD); + break; + } + } } void COptionsShortCutsPage::OnRemoveClicked(UINT /*Code*/, int /*id*/, HWND /*ctl*/) { - HTREEITEM hSelectedItem = m_MenuItems.GetSelectedItem(); - if (hSelectedItem == NULL) - { - g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT)); - return; - } - HTREEITEM hParent = m_MenuItems.GetParentItem(hSelectedItem); - if (hParent == NULL) - { - g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT)); - return; - } + HTREEITEM hSelectedItem = m_MenuItems.GetSelectedItem(); + if (hSelectedItem == NULL) + { + g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT)); + return; + } + HTREEITEM hParent = m_MenuItems.GetParentItem(hSelectedItem); + if (hParent == NULL) + { + g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT)); + return; + } - CShortCutItem * ShortCut = (CShortCutItem *)m_MenuItems.GetItemData(hSelectedItem); + CShortCutItem * ShortCut = (CShortCutItem *)m_MenuItems.GetItemData(hSelectedItem); - //Make sure an item is selected - int index = m_CurrentKeys.GetCurSel(); - if (index < 0) - { - g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT)); - return; - } - ShortCut->RemoveItem((CMenuShortCutKey *)m_CurrentKeys.GetItemData(index)); - m_MenuItems.SetItemState(hSelectedItem, TVIS_BOLD, TVIS_BOLD); - m_MenuItems.SetItemState(hParent, TVIS_BOLD, TVIS_BOLD); - m_EnableReset = true; + //Make sure an item is selected + int index = m_CurrentKeys.GetCurSel(); + if (index < 0) + { + g_Notify->DisplayError(GS(MSG_NO_SEL_SHORTCUT)); + return; + } + ShortCut->RemoveItem((CMenuShortCutKey *)m_CurrentKeys.GetItemData(index)); + m_MenuItems.SetItemState(hSelectedItem, TVIS_BOLD, TVIS_BOLD); + m_MenuItems.SetItemState(hParent, TVIS_BOLD, TVIS_BOLD); + m_EnableReset = true; - RefreshShortCutOptions(hSelectedItem); - SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); + RefreshShortCutOptions(hSelectedItem); + SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); } void COptionsShortCutsPage::OnDetectKeyClicked(UINT /*Code*/, int /*id*/, HWND /*ctl*/) { - CloseHandle(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)stInputGetKeys, this, 0, NULL)); + CloseHandle(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)stInputGetKeys, this, 0, NULL)); } void COptionsShortCutsPage::OnAssignClicked(UINT /*Code*/, int /*id*/, HWND /*ctl*/) { - //Get the virtual key info - int index = m_VirtualKeyList.GetCurSel(); - if (index < 0) - { - g_Notify->DisplayError(GS(MSG_NO_SHORTCUT_SEL)); - return; - } + //Get the virtual key info + int index = m_VirtualKeyList.GetCurSel(); + if (index < 0) + { + g_Notify->DisplayError(GS(MSG_NO_SHORTCUT_SEL)); + return; + } - WORD key = (WORD)SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETITEMDATA, index, 0); - bool bCtrl = (SendDlgItemMessage(IDC_CTL, BM_GETCHECK, 0, 0) == BST_CHECKED); - bool bAlt = (SendDlgItemMessage(IDC_ALT, BM_GETCHECK, 0, 0) == BST_CHECKED); - bool bShift = (SendDlgItemMessage(IDC_SHIFT, BM_GETCHECK, 0, 0) == BST_CHECKED); + WORD key = (WORD)SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETITEMDATA, index, 0); + bool bCtrl = (SendDlgItemMessage(IDC_CTL, BM_GETCHECK, 0, 0) == BST_CHECKED); + bool bAlt = (SendDlgItemMessage(IDC_ALT, BM_GETCHECK, 0, 0) == BST_CHECKED); + bool bShift = (SendDlgItemMessage(IDC_SHIFT, BM_GETCHECK, 0, 0) == BST_CHECKED); - ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); + ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); - HTREEITEM hSelectedItem = m_MenuItems.GetSelectedItem(); - if (hSelectedItem == NULL) - { - g_Notify->DisplayError(GS(MSG_NO_MENUITEM_SEL)); - return; - } - HTREEITEM hParent = m_MenuItems.GetParentItem(hSelectedItem); - if (hParent == NULL) - { - g_Notify->DisplayError(GS(MSG_NO_MENUITEM_SEL)); - return; - } + HTREEITEM hSelectedItem = m_MenuItems.GetSelectedItem(); + if (hSelectedItem == NULL) + { + g_Notify->DisplayError(GS(MSG_NO_MENUITEM_SEL)); + return; + } + HTREEITEM hParent = m_MenuItems.GetParentItem(hSelectedItem); + if (hParent == NULL) + { + g_Notify->DisplayError(GS(MSG_NO_MENUITEM_SEL)); + return; + } - CShortCutItem * ShortCut = (CShortCutItem *)m_MenuItems.GetItemData(hSelectedItem); + CShortCutItem * ShortCut = (CShortCutItem *)m_MenuItems.GetItemData(hSelectedItem); - LanguageStringID strid = m_ShortCuts.GetMenuItemName(key, bCtrl, bAlt, bShift, AccessLevel); - if (strid != EMPTY_STRING) - { - g_Notify->DisplayError(GS(MSG_MENUITEM_ASSIGNED)); - return; - } - ShortCut->AddShortCut(key, bCtrl, bAlt, bShift, AccessLevel, true, false); - m_MenuItems.SetItemState(hSelectedItem, TVIS_BOLD, TVIS_BOLD); - m_MenuItems.SetItemState(hParent, TVIS_BOLD, TVIS_BOLD); - m_EnableReset = true; + LanguageStringID strid = m_ShortCuts.GetMenuItemName(key, bCtrl, bAlt, bShift, AccessLevel); + if (strid != EMPTY_STRING) + { + g_Notify->DisplayError(GS(MSG_MENUITEM_ASSIGNED)); + return; + } + ShortCut->AddShortCut(key, bCtrl, bAlt, bShift, AccessLevel, true, false); + m_MenuItems.SetItemState(hSelectedItem, TVIS_BOLD, TVIS_BOLD); + m_MenuItems.SetItemState(hParent, TVIS_BOLD, TVIS_BOLD); + m_EnableReset = true; - RefreshShortCutOptions(hSelectedItem); - SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); + RefreshShortCutOptions(hSelectedItem); + SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); } void COptionsShortCutsPage::OnShortCutChanged(UINT /*Code*/, int /*id*/, HWND /*ctl*/) { - //Get the virtual key info - int index = m_VirtualKeyList.GetCurSel(); - if (index < 0) { return; } - WORD key = (WORD)m_VirtualKeyList.GetItemData(index); - bool bCtrl = (SendDlgItemMessage(IDC_CTL, BM_GETCHECK, 0, 0) == BST_CHECKED); - bool bAlt = (SendDlgItemMessage(IDC_ALT, BM_GETCHECK, 0, 0) == BST_CHECKED); - bool bShift = (SendDlgItemMessage(IDC_SHIFT, BM_GETCHECK, 0, 0) == BST_CHECKED); + //Get the virtual key info + int index = m_VirtualKeyList.GetCurSel(); + if (index < 0) { return; } + WORD key = (WORD)m_VirtualKeyList.GetItemData(index); + bool bCtrl = (SendDlgItemMessage(IDC_CTL, BM_GETCHECK, 0, 0) == BST_CHECKED); + bool bAlt = (SendDlgItemMessage(IDC_ALT, BM_GETCHECK, 0, 0) == BST_CHECKED); + bool bShift = (SendDlgItemMessage(IDC_SHIFT, BM_GETCHECK, 0, 0) == BST_CHECKED); - ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); + ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); - stdstr str; - str.FromUTF16(GS(m_ShortCuts.GetMenuItemName(key, bCtrl, bAlt, bShift, AccessLevel))); - if (str.length() > 0) - { - str.resize(std::remove(str.begin(), str.end(), '&') - str.begin()); - } - else - { - str = "None"; - } - SetDlgItemText(IDC_ASSIGNED_MENU_ITEM, str.c_str()); + stdstr str; + str.FromUTF16(GS(m_ShortCuts.GetMenuItemName(key, bCtrl, bAlt, bShift, AccessLevel))); + if (str.length() > 0) + { + str.resize(std::remove(str.begin(), str.end(), '&') - str.begin()); + } + else + { + str = "None"; + } + SetDlgItemText(IDC_ASSIGNED_MENU_ITEM, str.c_str()); } LRESULT COptionsShortCutsPage::OnMenuItemChanged(LPNMHDR lpnmh) { - RefreshShortCutOptions(((LPNMTREEVIEW)lpnmh)->itemNew.hItem); - return true; + RefreshShortCutOptions(((LPNMTREEVIEW)lpnmh)->itemNew.hItem); + return true; } void COptionsShortCutsPage::RefreshShortCutOptions(HTREEITEM hItem) { - HTREEITEM hParent = m_MenuItems.GetParentItem(hItem); - if (hParent == NULL) - { - return; - } + HTREEITEM hParent = m_MenuItems.GetParentItem(hItem); + if (hParent == NULL) + { + return; + } - ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); - CShortCutItem * ShortCut = (CShortCutItem *)m_MenuItems.GetItemData(hItem); + ACCESS_MODE AccessLevel = (ACCESS_MODE)m_CpuState.GetItemData(m_CpuState.GetCurSel()); + CShortCutItem * ShortCut = (CShortCutItem *)m_MenuItems.GetItemData(hItem); - m_CurrentKeys.ResetContent(); + m_CurrentKeys.ResetContent(); - const SHORTCUT_KEY_LIST & ShortCutList = ShortCut->GetAccelItems(); - for (SHORTCUT_KEY_LIST::const_iterator ShortCut_item = ShortCutList.begin(); ShortCut_item != ShortCutList.end(); ShortCut_item++) - { - if (ShortCut_item->Inactive()) - { - continue; - } + const SHORTCUT_KEY_LIST & ShortCutList = ShortCut->GetAccelItems(); + for (SHORTCUT_KEY_LIST::const_iterator ShortCut_item = ShortCutList.begin(); ShortCut_item != ShortCutList.end(); ShortCut_item++) + { + if (ShortCut_item->Inactive()) + { + continue; + } - ACCESS_MODE ItemMode = ShortCut_item->AccessMode(); - if ((ItemMode & AccessLevel) != AccessLevel) - { - continue; - } - stdstr Name = ShortCut_item->Name(); - m_CurrentKeys.SetItemData(m_CurrentKeys.AddString(Name.c_str()), (DWORD_PTR)&*ShortCut_item); - } + ACCESS_MODE ItemMode = ShortCut_item->AccessMode(); + if ((ItemMode & AccessLevel) != AccessLevel) + { + continue; + } + stdstr Name = ShortCut_item->Name(); + m_CurrentKeys.SetItemData(m_CurrentKeys.AddString(Name.c_str()), (DWORD_PTR)&*ShortCut_item); + } } BOOL CALLBACK KeyPromptDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM /*lParam*/) { - switch (uMsg) - { - case WM_INITDIALOG: - break; - case WM_COMMAND: - switch (LOWORD(wParam)) - { - case IDCANCEL: - SetForegroundWindow(GetParent(hDlg)); - DestroyWindow(hDlg); - break; - } - break; - default: - return FALSE; - } - return TRUE; + switch (uMsg) + { + case WM_INITDIALOG: + break; + case WM_COMMAND: + switch (LOWORD(wParam)) + { + case IDCANCEL: + SetForegroundWindow(GetParent(hDlg)); + DestroyWindow(hDlg); + break; + } + break; + default: + return FALSE; + } + return TRUE; } void COptionsShortCutsPage::InputGetKeys(void) { - HWND hKeyDlg = CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Key_Prompt), m_hWnd, (DLGPROC)KeyPromptDlgProc, (LPARAM)::GetDlgItem(m_hWnd, IDC_VIRTUALKEY)); - ::EnableWindow(GetParent(), false); - MSG msg; + HWND hKeyDlg = CreateDialogParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Key_Prompt), m_hWnd, (DLGPROC)KeyPromptDlgProc, (LPARAM)::GetDlgItem(m_hWnd, IDC_VIRTUALKEY)); + ::EnableWindow(GetParent(), false); + MSG msg; - for (bool fDone = false; !fDone; MsgWaitForMultipleObjects(0, NULL, false, 45, QS_ALLINPUT)) { - while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { - if (msg.message == WM_QUIT) { - fDone = true; - ::PostMessage(NULL, WM_QUIT, 0, 0); - break; - } - if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) { - int nVirtKey = (int)msg.wParam; - if (nVirtKey == VK_SHIFT) { continue; } - if (nVirtKey == VK_CONTROL) { continue; } - if (nVirtKey == VK_MENU) { continue; } - SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, (WPARAM)-1, 0); - for (int count = 0; count < SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETCOUNT, 0, 0); count++) { - int Data = (int)SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETITEMDATA, count, 0); - if (Data != nVirtKey) { continue; } - SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, count, 0); - SendDlgItemMessage(IDC_CTL, BM_SETCHECK, (GetKeyState(VK_CONTROL) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendDlgItemMessage(IDC_ALT, BM_SETCHECK, (GetKeyState(VK_MENU) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendDlgItemMessage(IDC_SHIFT, BM_SETCHECK, (GetKeyState(VK_SHIFT) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(WM_COMMAND, MAKELPARAM(IDC_VIRTUALKEY, LBN_SELCHANGE), (LPARAM)::GetDlgItem(m_hWnd, IDC_VIRTUALKEY)); - SetForegroundWindow(GetParent()); - ::DestroyWindow(hKeyDlg); - } - continue; - } - if (!::IsDialogMessage(hKeyDlg, &msg)) { - TranslateMessage(&msg); - DispatchMessage(&msg); - } - } + for (bool fDone = false; !fDone; MsgWaitForMultipleObjects(0, NULL, false, 45, QS_ALLINPUT)) { + while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { + if (msg.message == WM_QUIT) { + fDone = true; + ::PostMessage(NULL, WM_QUIT, 0, 0); + break; + } + if (msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) { + int nVirtKey = (int)msg.wParam; + if (nVirtKey == VK_SHIFT) { continue; } + if (nVirtKey == VK_CONTROL) { continue; } + if (nVirtKey == VK_MENU) { continue; } + SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, (WPARAM)-1, 0); + for (int count = 0; count < SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETCOUNT, 0, 0); count++) { + int Data = (int)SendDlgItemMessage(IDC_VIRTUALKEY, CB_GETITEMDATA, count, 0); + if (Data != nVirtKey) { continue; } + SendDlgItemMessage(IDC_VIRTUALKEY, CB_SETCURSEL, count, 0); + SendDlgItemMessage(IDC_CTL, BM_SETCHECK, (GetKeyState(VK_CONTROL) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(IDC_ALT, BM_SETCHECK, (GetKeyState(VK_MENU) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendDlgItemMessage(IDC_SHIFT, BM_SETCHECK, (GetKeyState(VK_SHIFT) & 0x80) != 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(WM_COMMAND, MAKELPARAM(IDC_VIRTUALKEY, LBN_SELCHANGE), (LPARAM)::GetDlgItem(m_hWnd, IDC_VIRTUALKEY)); + SetForegroundWindow(GetParent()); + ::DestroyWindow(hKeyDlg); + } + continue; + } + if (!::IsDialogMessage(hKeyDlg, &msg)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } - if (!::IsWindow(hKeyDlg)) { fDone = true; } - } - ::SetFocus(GetParent()); - ::EnableWindow(GetParent(), true); + if (!::IsWindow(hKeyDlg)) { fDone = true; } + } + ::SetFocus(GetParent()); + ::EnableWindow(GetParent(), true); } void COptionsShortCutsPage::HidePage() { - ShowWindow(SW_HIDE); + ShowWindow(SW_HIDE); } void COptionsShortCutsPage::ShowPage() { - ShowWindow(SW_SHOW); + ShowWindow(SW_SHOW); } void COptionsShortCutsPage::ApplySettings(bool /*UpdateScreen*/) { - m_ShortCuts.Save(); - g_Settings->SaveBool(Info_ShortCutsChanged, true); + m_ShortCuts.Save(); + g_Settings->SaveBool(Info_ShortCutsChanged, true); } bool COptionsShortCutsPage::EnableReset(void) { - return m_EnableReset; + return m_EnableReset; } void COptionsShortCutsPage::ResetPage() { - m_EnableReset = false; - m_ShortCuts.Load(true); - OnCpuStateChanged(LBN_SELCHANGE, IDC_C_CPU_STATE, GetDlgItem(IDC_C_CPU_STATE)); - SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); - m_CurrentKeys.ResetContent(); - CSettingsPageImpl::ResetPage(); -} + m_EnableReset = false; + m_ShortCuts.Load(true); + OnCpuStateChanged(LBN_SELCHANGE, IDC_C_CPU_STATE, GetDlgItem(IDC_C_CPU_STATE)); + SendMessage(GetParent(), PSM_CHANGED, (WPARAM)m_hWnd, 0); + m_CurrentKeys.ResetContent(); + CSettingsPageImpl::ResetPage(); +} \ No newline at end of file From 9d487bd969a7d245c8872349d6b6625a5ea8c2ec Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 12 Nov 2015 21:52:34 -0500 Subject: [PATCH 049/102] DllConfig(hParent) should be a pointer, not a uint32_t. --- Source/Project64/Plugins/Plugin Base.cpp | 2 +- Source/Project64/Plugins/Plugin Base.h | 2 +- Source/Project64/Plugins/Plugin Class.cpp | 2 +- Source/Project64/Plugins/Plugin Class.h | 2 +- .../User Interface/Main Menu Class.cpp | 20 +++++++++++++++---- 5 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Source/Project64/Plugins/Plugin Base.cpp b/Source/Project64/Plugins/Plugin Base.cpp index 3f3f8df09..2ef931177 100644 --- a/Source/Project64/Plugins/Plugin Base.cpp +++ b/Source/Project64/Plugins/Plugin Base.cpp @@ -71,7 +71,7 @@ bool CPlugin::Load (const char * FileName) RomOpen = (void (__cdecl *)(void)) GetProcAddress( (HMODULE)m_hDll, "RomOpen" ); RomClosed = (void (__cdecl *)(void)) GetProcAddress( (HMODULE)m_hDll, "RomClosed" ); PluginOpened = (void (__cdecl *)(void)) GetProcAddress( (HMODULE)m_hDll, "PluginLoaded" ); - DllConfig = (void (__cdecl *)(uint32_t)) GetProcAddress( (HMODULE)m_hDll, "DllConfig" ); + DllConfig = (void (__cdecl *)(void *)) GetProcAddress( (HMODULE)m_hDll, "DllConfig" ); DllAbout = (void (__cdecl *)(void *)) GetProcAddress( (HMODULE)m_hDll, "DllAbout" ); SetSettingInfo3 = (void (__cdecl *)(PLUGIN_SETTINGS3 *))GetProcAddress( (HMODULE)m_hDll, "SetSettingInfo3" ); diff --git a/Source/Project64/Plugins/Plugin Base.h b/Source/Project64/Plugins/Plugin Base.h index eaf5dcd01..4312dc8aa 100644 --- a/Source/Project64/Plugins/Plugin Base.h +++ b/Source/Project64/Plugins/Plugin Base.h @@ -30,7 +30,7 @@ public: void Close(); void(__cdecl *DllAbout) (void * hWnd); - void(__cdecl *DllConfig) (uint32_t hParent); + void(__cdecl *DllConfig) (void * hParent); static bool ValidPluginVersion ( PLUGIN_INFO & PluginInfo ); diff --git a/Source/Project64/Plugins/Plugin Class.cpp b/Source/Project64/Plugins/Plugin Class.cpp index e614eed90..820e0cbe8 100644 --- a/Source/Project64/Plugins/Plugin Class.cpp +++ b/Source/Project64/Plugins/Plugin Class.cpp @@ -318,7 +318,7 @@ bool CPlugins::Reset(CN64System * System) return true; } -void CPlugins::ConfigPlugin(uint32_t hParent, PLUGIN_TYPE Type) +void CPlugins::ConfigPlugin(void* hParent, PLUGIN_TYPE Type) { switch (Type) { diff --git a/Source/Project64/Plugins/Plugin Class.h b/Source/Project64/Plugins/Plugin Class.h index 0ce075a91..28a608b9a 100644 --- a/Source/Project64/Plugins/Plugin Class.h +++ b/Source/Project64/Plugins/Plugin Class.h @@ -104,7 +104,7 @@ public: void RomOpened(void); void RomClosed(void); void SetRenderWindows(RenderWindow * MainWindow, RenderWindow * SyncWindow); - void ConfigPlugin(uint32_t hParent, PLUGIN_TYPE Type); + void ConfigPlugin(void* hParent, PLUGIN_TYPE Type); bool CopyPlugins(const stdstr & DstDir) const; void CreatePlugins(void); bool Reset(CN64System * System); diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index bfdf6baa4..cae92fe2c 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -323,10 +323,22 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI m_Gui->MakeWindowOnTop(g_Settings->LoadBool(GameRunning_CPU_Running)); } break; - case ID_OPTIONS_CONFIG_RSP: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_RSP"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_RSP); break; - case ID_OPTIONS_CONFIG_GFX: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_GFX"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_GFX); break; - case ID_OPTIONS_CONFIG_AUDIO:WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_AUDIO"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_AUDIO); break; - case ID_OPTIONS_CONFIG_CONT: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_CONT"); g_Plugins->ConfigPlugin((DWORD)hWnd, PLUGIN_TYPE_CONTROLLER); break; + case ID_OPTIONS_CONFIG_RSP: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_RSP"); + g_Plugins->ConfigPlugin(hWnd, PLUGIN_TYPE_RSP); + break; + case ID_OPTIONS_CONFIG_GFX: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_GFX"); + g_Plugins->ConfigPlugin(hWnd, PLUGIN_TYPE_GFX); + break; + case ID_OPTIONS_CONFIG_AUDIO: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_AUDIO"); + g_Plugins->ConfigPlugin(hWnd, PLUGIN_TYPE_AUDIO); + break; + case ID_OPTIONS_CONFIG_CONT: + WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CONFIG_CONT"); + g_Plugins->ConfigPlugin(hWnd, PLUGIN_TYPE_CONTROLLER); + break; case ID_OPTIONS_CPU_USAGE: WriteTrace(TraceDebug, __FUNCTION__ ": ID_OPTIONS_CPU_USAGE"); if (g_Settings->LoadBool(UserInterface_ShowCPUPer)) From 815418c4e9b49e8db20ad44f092af2640567e8a3 Mon Sep 17 00:00:00 2001 From: toehead2001 Date: Thu, 12 Nov 2015 21:21:29 -0700 Subject: [PATCH 050/102] Don't hard code Platform Toolset --- PropertySheets/Platform.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PropertySheets/Platform.props b/PropertySheets/Platform.props index add82bd1a..8e043f9db 100644 --- a/PropertySheets/Platform.props +++ b/PropertySheets/Platform.props @@ -2,7 +2,7 @@ - v140_xp + $(DefaultPlatformToolset)_xp From e87c8de1078a5990bcc31b817208ddb38db568ad Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 13 Nov 2015 17:34:57 +1100 Subject: [PATCH 051/102] [Project64] Move Logging.cpp to User Interface/LoggingUI.cpp --- Source/Project64/Logging.cpp | 919 ----------------- .../Interpreter/Interpreter Ops 32.cpp | 307 +++--- .../Interpreter/Interpreter Ops.cpp | 757 +++++++------- Source/Project64/N64 System/Mips/Pif Ram.cpp | 941 +++++++++--------- .../N64 System/Mips/Register Class.cpp | 373 +++---- Source/Project64/N64 System/N64 Class.cpp | 2 +- Source/Project64/Project64.vcxproj | 4 +- Source/Project64/Project64.vcxproj.filters | 10 +- Source/Project64/User Interface/LoggingUI.cpp | 920 +++++++++++++++++ .../{Logging.h => User Interface/LoggingUI.h} | 0 Source/Project64/stdafx.h | 1 - 11 files changed, 2118 insertions(+), 2116 deletions(-) delete mode 100644 Source/Project64/Logging.cpp create mode 100644 Source/Project64/User Interface/LoggingUI.cpp rename Source/Project64/{Logging.h => User Interface/LoggingUI.h} (100%) diff --git a/Source/Project64/Logging.cpp b/Source/Project64/Logging.cpp deleted file mode 100644 index cb4a5ac33..000000000 --- a/Source/Project64/Logging.cpp +++ /dev/null @@ -1,919 +0,0 @@ -/**************************************************************************** -* * -* Project64 - A Nintendo 64 emulator. * -* http://www.pj64-emu.com/ * -* Copyright (C) 2012 Project64. All rights reserved. * -* * -* License: * -* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * -* * -****************************************************************************/ -#include "stdafx.h" - -#include - -void LoadLogSetting (HKEY hKey,char * String, bool * Value); -void SaveLogOptions (void); - -LRESULT CALLBACK LogGeneralProc ( HWND, UINT, WPARAM, LPARAM ); -LRESULT CALLBACK LogPifProc ( HWND, UINT, WPARAM, LPARAM ); -LRESULT CALLBACK LogRegProc ( HWND, UINT, WPARAM, LPARAM ); - -static HANDLE g_hLogFile = NULL; -LOG_OPTIONS g_LogOptions, TempOptions; - -void EnterLogOptions(HWND hwndOwner) -{ - PROPSHEETPAGE psp[3]; - PROPSHEETHEADER psh; - - psp[0].dwSize = sizeof(PROPSHEETPAGE); - psp[0].dwFlags = PSP_USETITLE; - psp[0].hInstance = GetModuleHandle(NULL); - psp[0].pszTemplate = MAKEINTRESOURCE(IDD_Logging_Registers); - psp[0].pfnDlgProc = (DLGPROC)LogRegProc; - psp[0].pszTitle = "Registers"; - psp[0].lParam = 0; - psp[0].pfnCallback = NULL; - - psp[1].dwSize = sizeof(PROPSHEETPAGE); - psp[1].dwFlags = PSP_USETITLE; - psp[1].hInstance = GetModuleHandle(NULL); - psp[1].pszTemplate = MAKEINTRESOURCE(IDD_Logging_PifRam); - psp[1].pfnDlgProc = (DLGPROC)LogPifProc; - psp[1].pszTitle = "Pif Ram"; - psp[1].lParam = 0; - psp[1].pfnCallback = NULL; - - psp[2].dwSize = sizeof(PROPSHEETPAGE); - psp[2].dwFlags = PSP_USETITLE; - psp[2].hInstance = GetModuleHandle(NULL); - psp[2].pszTemplate = MAKEINTRESOURCE(IDD_Logging_General); - psp[2].pfnDlgProc = (DLGPROC)LogGeneralProc; - psp[2].pszTitle = "General"; - psp[2].lParam = 0; - psp[2].pfnCallback = NULL; - - psh.dwSize = sizeof(PROPSHEETHEADER); - psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; - psh.hwndParent = hwndOwner; - psh.hInstance = GetModuleHandle(NULL); - psh.pszCaption = (LPSTR) "Log Options"; - psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); - psh.nStartPage = 0; - psh.ppsp = (LPCPROPSHEETPAGE) &psp; - psh.pfnCallback = NULL; - - LoadLogOptions(&TempOptions,TRUE); -#if defined(WINDOWS_UI) - PropertySheet(&psh); -#else - g_Notify -> BreakPoint(__FILEW__, __LINE__); -#endif - SaveLogOptions(); - LoadLogOptions(&g_LogOptions, FALSE); - return; -} - -void LoadLogOptions (LOG_OPTIONS * LogOptions, bool AlwaysFill) -{ - int32_t lResult; - HKEY hKeyResults = 0; - char String[200]; - - sprintf(String,"Software\\N64 Emulation\\%s\\Logging",g_Settings->LoadStringVal(Setting_ApplicationName).c_str()); - lResult = RegOpenKeyEx( HKEY_CURRENT_USER,String,0,KEY_ALL_ACCESS, - &hKeyResults); - - if (lResult == ERROR_SUCCESS) - { - //LoadLogSetting(hKeyResults,"Generate Log File",&LogOptions->GenerateLog); - if (LogOptions->GenerateLog || AlwaysFill) - { - LoadLogSetting(hKeyResults,"Log RDRAM",&LogOptions->LogRDRamRegisters); - LoadLogSetting(hKeyResults,"Log SP",&LogOptions->LogSPRegisters); - LoadLogSetting(hKeyResults,"Log DP Command",&LogOptions->LogDPCRegisters); - LoadLogSetting(hKeyResults,"Log DP Span",&LogOptions->LogDPSRegisters); - LoadLogSetting(hKeyResults,"Log MIPS Interface (MI)",&LogOptions->LogMIPSInterface); - LoadLogSetting(hKeyResults,"Log Video Interface (VI)",&LogOptions->LogVideoInterface); - LoadLogSetting(hKeyResults,"Log Audio Interface (AI)",&LogOptions->LogAudioInterface); - LoadLogSetting(hKeyResults,"Log Peripheral Interface (PI)",&LogOptions->LogPerInterface); - LoadLogSetting(hKeyResults,"Log RDRAM Interface (RI)",&LogOptions->LogRDRAMInterface); - LoadLogSetting(hKeyResults,"Log Serial Interface (SI)",&LogOptions->LogSerialInterface); - LoadLogSetting(hKeyResults,"Log PifRam DMA Operations",&LogOptions->LogPRDMAOperations); - LoadLogSetting(hKeyResults,"Log PifRam Direct Memory Loads",&LogOptions->LogPRDirectMemLoads); - LoadLogSetting(hKeyResults,"Log PifRam DMA Memory Loads",&LogOptions->LogPRDMAMemLoads); - LoadLogSetting(hKeyResults,"Log PifRam Direct Memory Stores",&LogOptions->LogPRDirectMemStores); - LoadLogSetting(hKeyResults,"Log PifRam DMA Memory Stores",&LogOptions->LogPRDMAMemStores); - LoadLogSetting(hKeyResults,"Log Controller Pak",&LogOptions->LogControllerPak); - LoadLogSetting(hKeyResults,"Log CP0 changes",&LogOptions->LogCP0changes); - LoadLogSetting(hKeyResults,"Log CP0 reads",&LogOptions->LogCP0reads); - LoadLogSetting(hKeyResults,"Log Exceptions",&LogOptions->LogExceptions); - LoadLogSetting(hKeyResults,"No Interrupts",&LogOptions->NoInterrupts); - LoadLogSetting(hKeyResults,"Log TLB",&LogOptions->LogTLB); - LoadLogSetting(hKeyResults,"Log Cache Operations",&LogOptions->LogCache); - LoadLogSetting(hKeyResults,"Log Rom Header",&LogOptions->LogRomHeader); - LoadLogSetting(hKeyResults,"Log Unknown access",&LogOptions->LogUnknown); - return; - } - } - - LogOptions->GenerateLog = FALSE; - LogOptions->LogRDRamRegisters = FALSE; - LogOptions->LogSPRegisters = FALSE; - LogOptions->LogDPCRegisters = FALSE; - LogOptions->LogDPSRegisters = FALSE; - LogOptions->LogMIPSInterface = FALSE; - LogOptions->LogVideoInterface = FALSE; - LogOptions->LogAudioInterface = FALSE; - LogOptions->LogPerInterface = FALSE; - LogOptions->LogRDRAMInterface = FALSE; - LogOptions->LogSerialInterface = FALSE; - - LogOptions->LogPRDMAOperations = FALSE; - LogOptions->LogPRDirectMemLoads = FALSE; - LogOptions->LogPRDMAMemLoads = FALSE; - LogOptions->LogPRDirectMemStores = FALSE; - LogOptions->LogPRDMAMemStores = FALSE; - LogOptions->LogControllerPak = FALSE; - - LogOptions->LogCP0changes = FALSE; - LogOptions->LogCP0reads = FALSE; - LogOptions->LogCache = FALSE; - LogOptions->LogExceptions = FALSE; - LogOptions->NoInterrupts = FALSE; - LogOptions->LogTLB = FALSE; - LogOptions->LogRomHeader = FALSE; - LogOptions->LogUnknown = FALSE; -} - -void LoadLogSetting (HKEY hKey,char * String, bool * Value) -{ - DWORD Type, dwResult, Bytes = 4; - int32_t lResult; - - lResult = RegQueryValueEx(hKey,String,0,&Type,(LPBYTE)(&dwResult),&Bytes); - if (Type == REG_DWORD && lResult == ERROR_SUCCESS) - { - *Value = dwResult != 0; - } - else - { - *Value = FALSE; - } -} - -LRESULT CALLBACK LogGeneralProc (HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - if (TempOptions.LogCP0changes) { CheckDlgButton(hDlg,IDC_CP0_WRITE,BST_CHECKED); } - if (TempOptions.LogCP0reads) { CheckDlgButton(hDlg,IDC_CP0_READ,BST_CHECKED); } - if (TempOptions.LogCache) { CheckDlgButton(hDlg,IDC_CACHE,BST_CHECKED); } - if (TempOptions.LogExceptions) { CheckDlgButton(hDlg,IDC_EXCEPTIONS,BST_CHECKED); } - if (TempOptions.NoInterrupts) { CheckDlgButton(hDlg,IDC_INTERRUPTS,BST_CHECKED); } - if (TempOptions.LogTLB) { CheckDlgButton(hDlg,IDC_TLB,BST_CHECKED); } - if (TempOptions.LogRomHeader) { CheckDlgButton(hDlg,IDC_ROM_HEADER,BST_CHECKED); } - if (TempOptions.LogUnknown) { CheckDlgButton(hDlg,IDC_UNKOWN,BST_CHECKED); } - break; - case WM_NOTIFY: - if (((NMHDR FAR *) lParam)->code != PSN_APPLY) { break; } - TempOptions.LogCP0changes = IsDlgButtonChecked(hDlg,IDC_CP0_WRITE) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogCP0reads = IsDlgButtonChecked(hDlg,IDC_CP0_READ) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogCache = IsDlgButtonChecked(hDlg,IDC_CACHE) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogExceptions = IsDlgButtonChecked(hDlg,IDC_EXCEPTIONS) == BST_CHECKED?TRUE:FALSE; - TempOptions.NoInterrupts = IsDlgButtonChecked(hDlg,IDC_INTERRUPTS) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogTLB = IsDlgButtonChecked(hDlg,IDC_TLB) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogRomHeader = IsDlgButtonChecked(hDlg,IDC_ROM_HEADER) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogUnknown = IsDlgButtonChecked(hDlg,IDC_UNKOWN) == BST_CHECKED?TRUE:FALSE; - break; - default: - return FALSE; - } - return TRUE; -} - -void Log_LW (uint32_t PC, uint32_t VAddr) -{ - if (!g_LogOptions.GenerateLog) - { - return; - } - - if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 ) - { - uint32_t PAddr; - if (!g_TransVaddr->TranslateVaddr(VAddr,PAddr)) - { - if (g_LogOptions.LogUnknown) - { - LogMessage("%08X: read from unknown ??? (%08X)",PC,VAddr); - } - return; - } - VAddr = PAddr + 0xA0000000; - } - - uint32_t Value; - if ( VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) - { - return; - } - if ( VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) - { - if (!g_LogOptions.LogRDRamRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA3F00000: LogMessage("%08X: read from RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG (%08X)",PC, Value); return; - case 0xA3F00004: LogMessage("%08X: read from RDRAM_DEVICE_ID_REG (%08X)",PC, Value); return; - case 0xA3F00008: LogMessage("%08X: read from RDRAM_DELAY_REG (%08X)",PC, Value); return; - case 0xA3F0000C: LogMessage("%08X: read from RDRAM_MODE_REG (%08X)",PC, Value); return; - case 0xA3F00010: LogMessage("%08X: read from RDRAM_REF_INTERVAL_REG (%08X)",PC, Value); return; - case 0xA3F00014: LogMessage("%08X: read from RDRAM_REF_ROW_REG (%08X)",PC, Value); return; - case 0xA3F00018: LogMessage("%08X: read from RDRAM_RAS_INTERVAL_REG (%08X)",PC, Value); return; - case 0xA3F0001C: LogMessage("%08X: read from RDRAM_MIN_INTERVAL_REG (%08X)",PC, Value); return; - case 0xA3F00020: LogMessage("%08X: read from RDRAM_ADDR_SELECT_REG (%08X)",PC, Value); return; - case 0xA3F00024: LogMessage("%08X: read from RDRAM_DEVICE_MANUF_REG (%08X)",PC, Value); return; - } - } - - if ( VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC ) - { - return; - } - if ( VAddr >= 0xA4040000 && VAddr <= 0xA404001C ) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA4040000: LogMessage("%08X: read from SP_MEM_ADDR_REG (%08X)",PC, Value); break; - case 0xA4040004: LogMessage("%08X: read from SP_DRAM_ADDR_REG (%08X)",PC, Value); break; - case 0xA4040008: LogMessage("%08X: read from SP_RD_LEN_REG (%08X)",PC, Value); break; - case 0xA404000C: LogMessage("%08X: read from SP_WR_LEN_REG (%08X)",PC, Value); break; - case 0xA4040010: LogMessage("%08X: read from SP_STATUS_REG (%08X)",PC, Value); break; - case 0xA4040014: LogMessage("%08X: read from SP_DMA_FULL_REG (%08X)",PC, Value); break; - case 0xA4040018: LogMessage("%08X: read from SP_DMA_BUSY_REG (%08X)",PC, Value); break; - case 0xA404001C: LogMessage("%08X: read from SP_SEMAPHORE_REG (%08X)",PC, Value); break; - } - return; - } - if ( VAddr == 0xA4080000) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - LogMessage("%08X: read from SP_PC (%08X)",PC, Value); - return; - } - if (VAddr >= 0xA4100000 && VAddr <= 0xA410001C) - { - if (!g_LogOptions.LogDPCRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA4100000: LogMessage("%08X: read from DPC_START_REG (%08X)",PC, Value); return; - case 0xA4100004: LogMessage("%08X: read from DPC_END_REG (%08X)",PC, Value); return; - case 0xA4100008: LogMessage("%08X: read from DPC_CURRENT_REG (%08X)",PC, Value); return; - case 0xA410000C: LogMessage("%08X: read from DPC_STATUS_REG (%08X)",PC, Value); return; - case 0xA4100010: LogMessage("%08X: read from DPC_CLOCK_REG (%08X)",PC, Value); return; - case 0xA4100014: LogMessage("%08X: read from DPC_BUFBUSY_REG (%08X)",PC, Value); return; - case 0xA4100018: LogMessage("%08X: read from DPC_PIPEBUSY_REG (%08X)",PC, Value); return; - case 0xA410001C: LogMessage("%08X: read from DPC_TMEM_REG (%08X)",PC, Value); return; - } - } - if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C) - { - if (!g_LogOptions.LogMIPSInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA4300000: LogMessage("%08X: read from MI_INIT_MODE_REG/MI_MODE_REG (%08X)",PC, Value); return; - case 0xA4300004: LogMessage("%08X: read from MI_VERSION_REG/MI_NOOP_REG (%08X)",PC, Value); return; - case 0xA4300008: LogMessage("%08X: read from MI_INTR_REG (%08X)",PC, Value); return; - case 0xA430000C: LogMessage("%08X: read from MI_INTR_MASK_REG (%08X)",PC, Value); return; - } - } - if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034) - { - if (!g_LogOptions.LogVideoInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA4400000: LogMessage("%08X: read from VI_STATUS_REG/VI_CONTROL_REG (%08X)",PC, Value); return; - case 0xA4400004: LogMessage("%08X: read from VI_ORIGIN_REG/VI_DRAM_ADDR_REG (%08X)",PC, Value); return; - case 0xA4400008: LogMessage("%08X: read from VI_WIDTH_REG/VI_H_WIDTH_REG (%08X)",PC, Value); return; - case 0xA440000C: LogMessage("%08X: read from VI_INTR_REG/VI_V_INTR_REG (%08X)",PC, Value); return; - case 0xA4400010: LogMessage("%08X: read from VI_CURRENT_REG/VI_V_CURRENT_LINE_REG (%08X)",PC, Value); return; - case 0xA4400014: LogMessage("%08X: read from VI_BURST_REG/VI_TIMING_REG (%08X)",PC, Value); return; - case 0xA4400018: LogMessage("%08X: read from VI_V_SYNC_REG (%08X)",PC, Value); return; - case 0xA440001C: LogMessage("%08X: read from VI_H_SYNC_REG (%08X)",PC, Value); return; - case 0xA4400020: LogMessage("%08X: read from VI_LEAP_REG/VI_H_SYNC_LEAP_REG (%08X)",PC, Value); return; - case 0xA4400024: LogMessage("%08X: read from VI_H_START_REG/VI_H_VIDEO_REG (%08X)",PC, Value); return; - case 0xA4400028: LogMessage("%08X: read from VI_V_START_REG/VI_V_VIDEO_REG (%08X)",PC, Value); return; - case 0xA440002C: LogMessage("%08X: read from VI_V_BURST_REG (%08X)",PC, Value); return; - case 0xA4400030: LogMessage("%08X: read from VI_X_SCALE_REG (%08X)",PC, Value); return; - case 0xA4400034: LogMessage("%08X: read from VI_Y_SCALE_REG (%08X)",PC, Value); return; - } - } - if (VAddr >= 0xA4500000 && VAddr <= 0xA4500014) - { - if (!g_LogOptions.LogAudioInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA4500000: LogMessage("%08X: read from AI_DRAM_ADDR_REG (%08X)",PC, Value); return; - case 0xA4500004: LogMessage("%08X: read from AI_LEN_REG (%08X)",PC, Value); return; - case 0xA4500008: LogMessage("%08X: read from AI_CONTROL_REG (%08X)",PC, Value); return; - case 0xA450000C: LogMessage("%08X: read from AI_STATUS_REG (%08X)",PC, Value); return; - case 0xA4500010: LogMessage("%08X: read from AI_DACRATE_REG (%08X)",PC, Value); return; - case 0xA4500014: LogMessage("%08X: read from AI_BITRATE_REG (%08X)",PC, Value); return; - } - } - if (VAddr >= 0xA4600000 && VAddr <= 0xA4600030) - { - if (!g_LogOptions.LogPerInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA4600000: LogMessage("%08X: read from PI_DRAM_ADDR_REG (%08X)",PC, Value); return; - case 0xA4600004: LogMessage("%08X: read from PI_CART_ADDR_REG (%08X)",PC, Value); return; - case 0xA4600008: LogMessage("%08X: read from PI_RD_LEN_REG (%08X)",PC, Value); return; - case 0xA460000C: LogMessage("%08X: read from PI_WR_LEN_REG (%08X)",PC, Value); return; - case 0xA4600010: LogMessage("%08X: read from PI_STATUS_REG (%08X)",PC, Value); return; - case 0xA4600014: LogMessage("%08X: read from PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG (%08X)",PC, Value); return; - case 0xA4600018: LogMessage("%08X: read from PI_BSD_DOM1_PWD_REG (%08X)",PC, Value); return; - case 0xA460001C: LogMessage("%08X: read from PI_BSD_DOM1_PGS_REG (%08X)",PC, Value); return; - case 0xA4600020: LogMessage("%08X: read from PI_BSD_DOM1_RLS_REG (%08X)",PC, Value); return; - case 0xA4600024: LogMessage("%08X: read from PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG (%08X)",PC, Value); return; - case 0xA4600028: LogMessage("%08X: read from PI_BSD_DOM2_PWD_REG (%08X)",PC, Value); return; - case 0xA460002C: LogMessage("%08X: read from PI_BSD_DOM2_PGS_REG (%08X)",PC, Value); return; - case 0xA4600030: LogMessage("%08X: read from PI_BSD_DOM2_RLS_REG (%08X)",PC, Value); return; - } - } - if (VAddr >= 0xA4700000 && VAddr <= 0xA470001C) - { - if (!g_LogOptions.LogRDRAMInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - - switch (VAddr) - { - case 0xA4700000: LogMessage("%08X: read from RI_MODE_REG (%08X)",PC, Value); return; - case 0xA4700004: LogMessage("%08X: read from RI_CONFIG_REG (%08X)",PC, Value); return; - case 0xA4700008: LogMessage("%08X: read from RI_CURRENT_LOAD_REG (%08X)",PC, Value); return; - case 0xA470000C: LogMessage("%08X: read from RI_SELECT_REG (%08X)",PC, Value); return; - case 0xA4700010: LogMessage("%08X: read from RI_REFRESH_REG/RI_COUNT_REG (%08X)",PC, Value); return; - case 0xA4700014: LogMessage("%08X: read from RI_LATENCY_REG (%08X)",PC, Value); return; - case 0xA4700018: LogMessage("%08X: read from RI_RERROR_REG (%08X)",PC, Value); return; - case 0xA470001C: LogMessage("%08X: read from RI_WERROR_REG (%08X)",PC, Value); return; - } - } - if ( VAddr == 0xA4800000) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - LogMessage("%08X: read from SI_DRAM_ADDR_REG (%08X)",PC, Value); - return; - } - if ( VAddr == 0xA4800004) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - LogMessage("%08X: read from SI_PIF_ADDR_RD64B_REG (%08X)",PC, Value); - return; - } - if ( VAddr == 0xA4800010) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - LogMessage("%08X: read from SI_PIF_ADDR_WR64B_REG (%08X)",PC, Value); - return; - } - if ( VAddr == 0xA4800018) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - LogMessage("%08X: read from SI_STATUS_REG (%08X)",PC, Value); - return; - } - if ( VAddr >= 0xBFC00000 && VAddr <= 0xBFC007C0 ) - { - return; - } - if ( VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC ) - { - if (!g_LogOptions.LogPRDirectMemLoads) - { - return; - } - g_MMU->LW_VAddr(VAddr,Value); - LogMessage("%08X: read word from Pif Ram at 0x%X (%08X)",PC,VAddr - 0xBFC007C0, Value); - return; - } - if ( VAddr >= 0xB0000040 && ((VAddr - 0xB0000000) < g_Rom->GetRomSize())) - { - return; - } - if ( VAddr >= 0xB0000000 && VAddr < 0xB0000040) - { - if (!g_LogOptions.LogRomHeader) - { - return; - } - - g_MMU->LW_VAddr(VAddr,Value); - switch (VAddr) - { - case 0xB0000004: LogMessage("%08X: read from Rom Clock Rate (%08X)",PC, Value); break; - case 0xB0000008: LogMessage("%08X: read from Rom Boot address offset (%08X)",PC, Value); break; - case 0xB000000C: LogMessage("%08X: read from Rom Release offset (%08X)",PC, Value); break; - case 0xB0000010: LogMessage("%08X: read from Rom CRC1 (%08X)",PC, Value); break; - case 0xB0000014: LogMessage("%08X: read from Rom CRC2 (%08X)",PC, Value); break; - default: LogMessage("%08X: read from Rom header 0x%X (%08X)",PC, VAddr & 0xFF,Value); break; - } - return; - } - if (!g_LogOptions.LogUnknown) - { - return; - } - LogMessage("%08X: read from unknown ??? (%08X)",PC,VAddr); -} - -void Log_SW (uint32_t PC, uint32_t VAddr, uint32_t Value) -{ - if (!g_LogOptions.GenerateLog) - { - return; - } - - if ( VAddr < 0xA0000000 || VAddr >= 0xC0000000 ) - { - uint32_t PAddr; - if (!g_TransVaddr->TranslateVaddr(VAddr,PAddr)) - { - if (g_LogOptions.LogUnknown) - { - LogMessage("%08X: Writing 0x%08X to %08X",PC, Value, VAddr ); - } - return; - } - VAddr = PAddr + 0xA0000000; - } - - if ( VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) - { - return; - } - if ( VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) - { - if (!g_LogOptions.LogRDRamRegisters) - { - return; - } - switch (VAddr) - { - case 0xA3F00000: LogMessage("%08X: Writing 0x%08X to RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG",PC, Value ); return; - case 0xA3F00004: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_ID_REG",PC, Value ); return; - case 0xA3F00008: LogMessage("%08X: Writing 0x%08X to RDRAM_DELAY_REG",PC, Value ); return; - case 0xA3F0000C: LogMessage("%08X: Writing 0x%08X to RDRAM_MODE_REG",PC, Value ); return; - case 0xA3F00010: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_INTERVAL_REG",PC, Value ); return; - case 0xA3F00014: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_ROW_REG",PC, Value ); return; - case 0xA3F00018: LogMessage("%08X: Writing 0x%08X to RDRAM_RAS_INTERVAL_REG",PC, Value ); return; - case 0xA3F0001C: LogMessage("%08X: Writing 0x%08X to RDRAM_MIN_INTERVAL_REG",PC, Value ); return; - case 0xA3F00020: LogMessage("%08X: Writing 0x%08X to RDRAM_ADDR_SELECT_REG",PC, Value ); return; - case 0xA3F00024: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_MANUF_REG",PC, Value ); return; - } - } - if ( VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC ) - { - return; - } - - if ( VAddr >= 0xA4040000 && VAddr <= 0xA404001C) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - switch (VAddr) - { - case 0xA4040000: LogMessage("%08X: Writing 0x%08X to SP_MEM_ADDR_REG",PC, Value ); return; - case 0xA4040004: LogMessage("%08X: Writing 0x%08X to SP_DRAM_ADDR_REG",PC, Value ); return; - case 0xA4040008: LogMessage("%08X: Writing 0x%08X to SP_RD_LEN_REG",PC, Value ); return; - case 0xA404000C: LogMessage("%08X: Writing 0x%08X to SP_WR_LEN_REG",PC, Value ); return; - case 0xA4040010: LogMessage("%08X: Writing 0x%08X to SP_STATUS_REG",PC, Value ); return; - case 0xA4040014: LogMessage("%08X: Writing 0x%08X to SP_DMA_FULL_REG",PC, Value ); return; - case 0xA4040018: LogMessage("%08X: Writing 0x%08X to SP_DMA_BUSY_REG",PC, Value ); return; - case 0xA404001C: LogMessage("%08X: Writing 0x%08X to SP_SEMAPHORE_REG",PC, Value ); return; - } - } - if ( VAddr == 0xA4080000) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SP_PC",PC, Value ); return; - } - - if ( VAddr >= 0xA4100000 && VAddr <= 0xA410001C) - { - if (!g_LogOptions.LogDPCRegisters) - { - return; - } - switch (VAddr) - { - case 0xA4100000: LogMessage("%08X: Writing 0x%08X to DPC_START_REG",PC, Value ); return; - case 0xA4100004: LogMessage("%08X: Writing 0x%08X to DPC_END_REG",PC, Value ); return; - case 0xA4100008: LogMessage("%08X: Writing 0x%08X to DPC_CURRENT_REG",PC, Value ); return; - case 0xA410000C: LogMessage("%08X: Writing 0x%08X to DPC_STATUS_REG",PC, Value ); return; - case 0xA4100010: LogMessage("%08X: Writing 0x%08X to DPC_CLOCK_REG",PC, Value ); return; - case 0xA4100014: LogMessage("%08X: Writing 0x%08X to DPC_BUFBUSY_REG",PC, Value ); return; - case 0xA4100018: LogMessage("%08X: Writing 0x%08X to DPC_PIPEBUSY_REG",PC, Value ); return; - case 0xA410001C: LogMessage("%08X: Writing 0x%08X to DPC_TMEM_REG",PC, Value ); return; - } - } - - if ( VAddr >= 0xA4200000 && VAddr <= 0xA420000C) - { - if (!g_LogOptions.LogDPSRegisters) - { - return; - } - switch (VAddr) - { - case 0xA4200000: LogMessage("%08X: Writing 0x%08X to DPS_TBIST_REG",PC, Value ); return; - case 0xA4200004: LogMessage("%08X: Writing 0x%08X to DPS_TEST_MODE_REG",PC, Value ); return; - case 0xA4200008: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_ADDR_REG",PC, Value ); return; - case 0xA420000C: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_DATA_REG",PC, Value ); return; - } - } - - if ( VAddr >= 0xA4300000 && VAddr <= 0xA430000C) - { - if (!g_LogOptions.LogMIPSInterface) - { - return; - } - switch (VAddr) - { - case 0xA4300000: LogMessage("%08X: Writing 0x%08X to MI_INIT_MODE_REG/MI_MODE_REG",PC, Value ); return; - case 0xA4300004: LogMessage("%08X: Writing 0x%08X to MI_VERSION_REG/MI_NOOP_REG",PC, Value ); return; - case 0xA4300008: LogMessage("%08X: Writing 0x%08X to MI_INTR_REG",PC, Value ); return; - case 0xA430000C: LogMessage("%08X: Writing 0x%08X to MI_INTR_MASK_REG",PC, Value ); return; - } - } - if ( VAddr >= 0xA4400000 && VAddr <= 0xA4400034) - { - if (!g_LogOptions.LogVideoInterface) - { - return; - } - switch (VAddr) - { - case 0xA4400000: LogMessage("%08X: Writing 0x%08X to VI_STATUS_REG/VI_CONTROL_REG",PC, Value ); return; - case 0xA4400004: LogMessage("%08X: Writing 0x%08X to VI_ORIGIN_REG/VI_DRAM_ADDR_REG",PC, Value ); return; - case 0xA4400008: LogMessage("%08X: Writing 0x%08X to VI_WIDTH_REG/VI_H_WIDTH_REG",PC, Value ); return; - case 0xA440000C: LogMessage("%08X: Writing 0x%08X to VI_INTR_REG/VI_V_INTR_REG",PC, Value ); return; - case 0xA4400010: LogMessage("%08X: Writing 0x%08X to VI_CURRENT_REG/VI_V_CURRENT_LINE_REG",PC, Value ); return; - case 0xA4400014: LogMessage("%08X: Writing 0x%08X to VI_BURST_REG/VI_TIMING_REG",PC, Value ); return; - case 0xA4400018: LogMessage("%08X: Writing 0x%08X to VI_V_SYNC_REG",PC, Value ); return; - case 0xA440001C: LogMessage("%08X: Writing 0x%08X to VI_H_SYNC_REG",PC, Value ); return; - case 0xA4400020: LogMessage("%08X: Writing 0x%08X to VI_LEAP_REG/VI_H_SYNC_LEAP_REG",PC, Value ); return; - case 0xA4400024: LogMessage("%08X: Writing 0x%08X to VI_H_START_REG/VI_H_VIDEO_REG",PC, Value ); return; - case 0xA4400028: LogMessage("%08X: Writing 0x%08X to VI_V_START_REG/VI_V_VIDEO_REG",PC, Value ); return; - case 0xA440002C: LogMessage("%08X: Writing 0x%08X to VI_V_BURST_REG",PC, Value ); return; - case 0xA4400030: LogMessage("%08X: Writing 0x%08X to VI_X_SCALE_REG",PC, Value ); return; - case 0xA4400034: LogMessage("%08X: Writing 0x%08X to VI_Y_SCALE_REG",PC, Value ); return; - } - } - - if ( VAddr >= 0xA4500000 && VAddr <= 0xA4500014) - { - if (!g_LogOptions.LogAudioInterface) - { - return; - } - switch (VAddr) - { - case 0xA4500000: LogMessage("%08X: Writing 0x%08X to AI_DRAM_ADDR_REG",PC, Value ); return; - case 0xA4500004: LogMessage("%08X: Writing 0x%08X to AI_LEN_REG",PC, Value ); return; - case 0xA4500008: LogMessage("%08X: Writing 0x%08X to AI_CONTROL_REG",PC, Value ); return; - case 0xA450000C: LogMessage("%08X: Writing 0x%08X to AI_STATUS_REG",PC, Value ); return; - case 0xA4500010: LogMessage("%08X: Writing 0x%08X to AI_DACRATE_REG",PC, Value ); return; - case 0xA4500014: LogMessage("%08X: Writing 0x%08X to AI_BITRATE_REG",PC, Value ); return; - } - } - - if ( VAddr >= 0xA4600000 && VAddr <= 0xA4600030) - { - if (!g_LogOptions.LogPerInterface) - { - return; - } - switch (VAddr) - { - case 0xA4600000: LogMessage("%08X: Writing 0x%08X to PI_DRAM_ADDR_REG",PC, Value ); return; - case 0xA4600004: LogMessage("%08X: Writing 0x%08X to PI_CART_ADDR_REG",PC, Value ); return; - case 0xA4600008: LogMessage("%08X: Writing 0x%08X to PI_RD_LEN_REG",PC, Value ); return; - case 0xA460000C: LogMessage("%08X: Writing 0x%08X to PI_WR_LEN_REG",PC, Value ); return; - case 0xA4600010: LogMessage("%08X: Writing 0x%08X to PI_STATUS_REG",PC, Value ); return; - case 0xA4600014: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG",PC, Value ); return; - case 0xA4600018: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PWD_REG",PC, Value ); return; - case 0xA460001C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PGS_REG",PC, Value ); return; - case 0xA4600020: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_RLS_REG",PC, Value ); return; - case 0xA4600024: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG",PC, Value ); return; - case 0xA4600028: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PWD_REG",PC, Value ); return; - case 0xA460002C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PGS_REG",PC, Value ); return; - case 0xA4600030: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_RLS_REG",PC, Value ); return; - } - } - if ( VAddr >= 0xA4700000 && VAddr <= 0xA470001C) - { - if (!g_LogOptions.LogRDRAMInterface) - { - return; - } - switch (VAddr) - { - case 0xA4700000: LogMessage("%08X: Writing 0x%08X to RI_MODE_REG",PC, Value ); return; - case 0xA4700004: LogMessage("%08X: Writing 0x%08X to RI_CONFIG_REG",PC, Value ); return; - case 0xA4700008: LogMessage("%08X: Writing 0x%08X to RI_CURRENT_LOAD_REG",PC, Value ); return; - case 0xA470000C: LogMessage("%08X: Writing 0x%08X to RI_SELECT_REG",PC, Value ); return; - case 0xA4700010: LogMessage("%08X: Writing 0x%08X to RI_REFRESH_REG/RI_COUNT_REG",PC, Value ); return; - case 0xA4700014: LogMessage("%08X: Writing 0x%08X to RI_LATENCY_REG",PC, Value ); return; - case 0xA4700018: LogMessage("%08X: Writing 0x%08X to RI_RERROR_REG",PC, Value ); return; - case 0xA470001C: LogMessage("%08X: Writing 0x%08X to RI_WERROR_REG",PC, Value ); return; - } - } - if ( VAddr == 0xA4800000) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_DRAM_ADDR_REG",PC, Value ); return; - } - if ( VAddr == 0xA4800004) - { - if (g_LogOptions.LogPRDMAOperations) - { - LogMessage("%08X: A DMA transfer from the PIF ram has occured",PC ); - } - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_RD64B_REG",PC, Value ); return; - } - if ( VAddr == 0xA4800010) - { - if (g_LogOptions.LogPRDMAOperations) - { - LogMessage("%08X: A DMA transfer to the PIF ram has occured",PC ); - } - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_WR64B_REG",PC, Value ); return; - } - if ( VAddr == 0xA4800018) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_STATUS_REG",PC, Value ); return; - } - - if ( VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC ) - { - if (!g_LogOptions.LogPRDirectMemStores) - { - return; - } - LogMessage("%08X: Writing 0x%08X to Pif Ram at 0x%X",PC,Value, VAddr - 0xBFC007C0); - return; - } - if (!g_LogOptions.LogUnknown) - { - return; - } - LogMessage("%08X: Writing 0x%08X to %08X ????",PC, Value, VAddr ); -} - -LRESULT CALLBACK LogPifProc (HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - if (TempOptions.LogPRDMAOperations) { CheckDlgButton(hDlg,IDC_SI_DMA,BST_CHECKED); } - if (TempOptions.LogPRDirectMemLoads) { CheckDlgButton(hDlg,IDC_DIRECT_WRITE,BST_CHECKED); } - if (TempOptions.LogPRDMAMemLoads) { CheckDlgButton(hDlg,IDC_DMA_WRITE,BST_CHECKED); } - if (TempOptions.LogPRDirectMemStores) { CheckDlgButton(hDlg,IDC_DIRECT_READ,BST_CHECKED); } - if (TempOptions.LogPRDMAMemStores) { CheckDlgButton(hDlg,IDC_DMA_READ,BST_CHECKED); } - if (TempOptions.LogControllerPak) { CheckDlgButton(hDlg,IDC_CONT_PAK,BST_CHECKED); } - break; - case WM_NOTIFY: - if (((NMHDR FAR *) lParam)->code != PSN_APPLY) - { - break; - } - TempOptions.LogPRDMAOperations = IsDlgButtonChecked(hDlg,IDC_SI_DMA) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogPRDirectMemLoads = IsDlgButtonChecked(hDlg,IDC_DIRECT_WRITE) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogPRDMAMemLoads = IsDlgButtonChecked(hDlg,IDC_DMA_WRITE) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogPRDirectMemStores = IsDlgButtonChecked(hDlg,IDC_DIRECT_READ) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogPRDMAMemStores = IsDlgButtonChecked(hDlg,IDC_DMA_READ) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogControllerPak = IsDlgButtonChecked(hDlg,IDC_CONT_PAK) == BST_CHECKED?TRUE:FALSE; - break; - default: - return FALSE; - } - return TRUE; -} - -LRESULT CALLBACK LogRegProc (HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - if (TempOptions.LogRDRamRegisters) { CheckDlgButton(hDlg,IDC_RDRAM,BST_CHECKED); } - if (TempOptions.LogSPRegisters) { CheckDlgButton(hDlg,IDC_SP_REG,BST_CHECKED); } - if (TempOptions.LogDPCRegisters) { CheckDlgButton(hDlg,IDC_DPC_REG,BST_CHECKED); } - if (TempOptions.LogDPSRegisters) { CheckDlgButton(hDlg,IDC_DPS_REG,BST_CHECKED); } - if (TempOptions.LogMIPSInterface) { CheckDlgButton(hDlg,IDC_MI_REG,BST_CHECKED); } - if (TempOptions.LogVideoInterface) { CheckDlgButton(hDlg,IDC_VI_REG,BST_CHECKED); } - if (TempOptions.LogAudioInterface) { CheckDlgButton(hDlg,IDC_AI_REG,BST_CHECKED); } - if (TempOptions.LogPerInterface) { CheckDlgButton(hDlg,IDC_PI_REG,BST_CHECKED); } - if (TempOptions.LogRDRAMInterface) { CheckDlgButton(hDlg,IDC_RI_REG,BST_CHECKED); } - if (TempOptions.LogSerialInterface) { CheckDlgButton(hDlg,IDC_SI_REG,BST_CHECKED); } - break; - case WM_NOTIFY: - if (((NMHDR FAR *) lParam)->code != PSN_APPLY) - { - break; - } - TempOptions.LogRDRamRegisters = IsDlgButtonChecked(hDlg,IDC_RDRAM) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogSPRegisters = IsDlgButtonChecked(hDlg,IDC_SP_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogDPCRegisters = IsDlgButtonChecked(hDlg,IDC_DPC_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogDPSRegisters = IsDlgButtonChecked(hDlg,IDC_DPS_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogMIPSInterface = IsDlgButtonChecked(hDlg,IDC_MI_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogVideoInterface = IsDlgButtonChecked(hDlg,IDC_VI_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogAudioInterface = IsDlgButtonChecked(hDlg,IDC_AI_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogPerInterface = IsDlgButtonChecked(hDlg,IDC_PI_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogRDRAMInterface = IsDlgButtonChecked(hDlg,IDC_RI_REG) == BST_CHECKED?TRUE:FALSE; - TempOptions.LogSerialInterface = IsDlgButtonChecked(hDlg,IDC_SI_REG) == BST_CHECKED?TRUE:FALSE; - break; - default: - return FALSE; - } - return TRUE; -} - -void SaveLogSetting (HKEY hKey,char * String, BOOL Value) -{ - DWORD StoreValue = Value; - RegSetValueEx(hKey,String,0,REG_DWORD,(CONST BYTE *)&StoreValue,sizeof(DWORD)); -} - -void SaveLogOptions (void) -{ - long lResult; - HKEY hKeyResults = 0; - DWORD Disposition = 0; - char String[200]; - - sprintf(String,"Software\\N64 Emulation\\%s\\Logging",g_Settings->LoadStringVal(Setting_ApplicationName).c_str()); - lResult = RegCreateKeyEx( HKEY_CURRENT_USER,String,0,"", REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS,NULL,&hKeyResults,&Disposition); - - SaveLogSetting(hKeyResults,"Log RDRAM",TempOptions.LogRDRamRegisters); - SaveLogSetting(hKeyResults,"Log SP",TempOptions.LogSPRegisters); - SaveLogSetting(hKeyResults,"Log DP Command",TempOptions.LogDPCRegisters); - SaveLogSetting(hKeyResults,"Log DP Span",TempOptions.LogDPSRegisters); - SaveLogSetting(hKeyResults,"Log MIPS Interface (MI)",TempOptions.LogMIPSInterface); - SaveLogSetting(hKeyResults,"Log Video Interface (VI)",TempOptions.LogVideoInterface); - SaveLogSetting(hKeyResults,"Log Audio Interface (AI)",TempOptions.LogAudioInterface); - SaveLogSetting(hKeyResults,"Log Peripheral Interface (PI)",TempOptions.LogPerInterface); - SaveLogSetting(hKeyResults,"Log RDRAM Interface (RI)",TempOptions.LogRDRAMInterface); - SaveLogSetting(hKeyResults,"Log Serial Interface (SI)",TempOptions.LogSerialInterface); - SaveLogSetting(hKeyResults,"Log PifRam DMA Operations",TempOptions.LogPRDMAOperations); - SaveLogSetting(hKeyResults,"Log PifRam Direct Memory Loads",TempOptions.LogPRDirectMemLoads); - SaveLogSetting(hKeyResults,"Log PifRam DMA Memory Loads",TempOptions.LogPRDMAMemLoads); - SaveLogSetting(hKeyResults,"Log PifRam Direct Memory Stores",TempOptions.LogPRDirectMemStores); - SaveLogSetting(hKeyResults,"Log PifRam DMA Memory Stores",TempOptions.LogPRDMAMemStores); - SaveLogSetting(hKeyResults,"Log Controller Pak",TempOptions.LogControllerPak); - SaveLogSetting(hKeyResults,"Log CP0 changes",TempOptions.LogCP0changes); - SaveLogSetting(hKeyResults,"Log CP0 reads",TempOptions.LogCP0reads); - SaveLogSetting(hKeyResults,"Log Exceptions",TempOptions.LogExceptions); - SaveLogSetting(hKeyResults,"No Interrupts",TempOptions.NoInterrupts); - SaveLogSetting(hKeyResults,"Log TLB",TempOptions.LogTLB); - SaveLogSetting(hKeyResults,"Log Cache Operations",TempOptions.LogCache); - SaveLogSetting(hKeyResults,"Log Rom Header",TempOptions.LogRomHeader); - SaveLogSetting(hKeyResults,"Log Unknown access",TempOptions.LogUnknown); - - RegCloseKey(hKeyResults); -} - -void LogMessage (const char * Message, ...) -{ - DWORD dwWritten; - char Msg[400]; - va_list ap; - - if (!g_Settings->LoadBool(Debugger_Enabled)) - { - return; - } - if (g_hLogFile == NULL) - { - return; - } - - va_start( ap, Message ); - vsprintf( Msg, Message, ap ); - va_end( ap ); - - strcat(Msg,"\r\n"); - - WriteFile( g_hLogFile,Msg,strlen(Msg),&dwWritten,NULL ); -} - -void StartLog (void) -{ - if (!g_LogOptions.GenerateLog) - { - StopLog(); - return; - } - if (g_hLogFile) - { - return; - } - - CPath LogFile(CPath::MODULE_DIRECTORY); - LogFile.AppendDirectory("Logs"); - LogFile.SetNameExtension("cpudebug.log"); - - g_hLogFile = CreateFile(LogFile,GENERIC_WRITE, FILE_SHARE_READ,NULL,CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); - SetFilePointer(g_hLogFile,0,NULL,FILE_BEGIN); -} - -void StopLog (void) -{ - if (g_hLogFile) - { - CloseHandle(g_hLogFile); - } - g_hLogFile = NULL; -} diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp index 339a208e3..217a28188 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp @@ -9,8 +9,9 @@ * * ****************************************************************************/ #include "stdafx.h" +#include -bool DelaySlotEffectsCompare ( uint32_t PC, uint32_t Reg1, uint32_t Reg2 ); +bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2); #define ADDRESS_ERROR_EXCEPTION(Address,FromRead) \ g_Reg->DoAddressError(m_NextInstruction == JUMP,Address,FromRead);\ @@ -25,7 +26,7 @@ bool DelaySlotEffectsCompare ( uint32_t PC, uint32_t Reg1, uint32_t Reg2 ); m_NextInstruction = JUMP;\ m_JumpToLocation = (*_PROGRAM_COUNTER);\ return;\ - } + } #define TLB_READ_EXCEPTION(Address) \ g_Reg->DoTLBReadMiss(m_NextInstruction == JUMP,Address);\ @@ -35,16 +36,16 @@ bool DelaySlotEffectsCompare ( uint32_t PC, uint32_t Reg1, uint32_t Reg2 ); R4300iOp32::Func * R4300iOp32::BuildInterpreter() { - Jump_Opcode[ 0] = SPECIAL; - Jump_Opcode[ 1] = REGIMM; - Jump_Opcode[ 2] = R4300iOp::J; - Jump_Opcode[ 3] = JAL; - Jump_Opcode[ 4] = BEQ; - Jump_Opcode[ 5] = BNE; - Jump_Opcode[ 6] = BLEZ; - Jump_Opcode[ 7] = BGTZ; - Jump_Opcode[ 8] = ADDI; - Jump_Opcode[ 9] = ADDIU; + Jump_Opcode[0] = SPECIAL; + Jump_Opcode[1] = REGIMM; + Jump_Opcode[2] = R4300iOp::J; + Jump_Opcode[3] = JAL; + Jump_Opcode[4] = BEQ; + Jump_Opcode[5] = BNE; + Jump_Opcode[6] = BLEZ; + Jump_Opcode[7] = BGTZ; + Jump_Opcode[8] = ADDI; + Jump_Opcode[9] = ADDIU; Jump_Opcode[10] = SLTI; Jump_Opcode[11] = SLTIU; Jump_Opcode[12] = ANDI; @@ -100,16 +101,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_Opcode[62] = R4300iOp::UnknownOpcode; Jump_Opcode[63] = R4300iOp::SD; - Jump_Special[ 0] = SPECIAL_SLL; - Jump_Special[ 1] = R4300iOp::UnknownOpcode; - Jump_Special[ 2] = SPECIAL_SRL; - Jump_Special[ 3] = SPECIAL_SRA; - Jump_Special[ 4] = SPECIAL_SLLV; - Jump_Special[ 5] = R4300iOp::UnknownOpcode; - Jump_Special[ 6] = SPECIAL_SRLV; - Jump_Special[ 7] = SPECIAL_SRAV; - Jump_Special[ 8] = SPECIAL_JR; - Jump_Special[ 9] = SPECIAL_JALR; + Jump_Special[0] = SPECIAL_SLL; + Jump_Special[1] = R4300iOp::UnknownOpcode; + Jump_Special[2] = SPECIAL_SRL; + Jump_Special[3] = SPECIAL_SRA; + Jump_Special[4] = SPECIAL_SLLV; + Jump_Special[5] = R4300iOp::UnknownOpcode; + Jump_Special[6] = SPECIAL_SRLV; + Jump_Special[7] = SPECIAL_SRAV; + Jump_Special[8] = SPECIAL_JR; + Jump_Special[9] = SPECIAL_JALR; Jump_Special[10] = R4300iOp::UnknownOpcode; Jump_Special[11] = R4300iOp::UnknownOpcode; Jump_Special[12] = R4300iOp::SPECIAL_SYSCALL; @@ -165,16 +166,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_Special[62] = R4300iOp::SPECIAL_DSRL32; Jump_Special[63] = R4300iOp::SPECIAL_DSRA32; - Jump_Regimm[ 0] = REGIMM_BLTZ; - Jump_Regimm[ 1] = REGIMM_BGEZ; - Jump_Regimm[ 2] = REGIMM_BLTZL; - Jump_Regimm[ 3] = REGIMM_BGEZL; - Jump_Regimm[ 4] = R4300iOp::UnknownOpcode; - Jump_Regimm[ 5] = R4300iOp::UnknownOpcode; - Jump_Regimm[ 6] = R4300iOp::UnknownOpcode; - Jump_Regimm[ 7] = R4300iOp::UnknownOpcode; - Jump_Regimm[ 8] = R4300iOp::UnknownOpcode; - Jump_Regimm[ 9] = R4300iOp::UnknownOpcode; + Jump_Regimm[0] = REGIMM_BLTZ; + Jump_Regimm[1] = REGIMM_BGEZ; + Jump_Regimm[2] = REGIMM_BLTZL; + Jump_Regimm[3] = REGIMM_BGEZL; + Jump_Regimm[4] = R4300iOp::UnknownOpcode; + Jump_Regimm[5] = R4300iOp::UnknownOpcode; + Jump_Regimm[6] = R4300iOp::UnknownOpcode; + Jump_Regimm[7] = R4300iOp::UnknownOpcode; + Jump_Regimm[8] = R4300iOp::UnknownOpcode; + Jump_Regimm[9] = R4300iOp::UnknownOpcode; Jump_Regimm[10] = R4300iOp::UnknownOpcode; Jump_Regimm[11] = R4300iOp::UnknownOpcode; Jump_Regimm[12] = R4300iOp::UnknownOpcode; @@ -198,16 +199,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_Regimm[30] = R4300iOp::UnknownOpcode; Jump_Regimm[31] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 0] = COP0_MF; - Jump_CoP0[ 1] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 2] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 3] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 4] = COP0_MT; - Jump_CoP0[ 5] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 6] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 7] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 8] = R4300iOp::UnknownOpcode; - Jump_CoP0[ 9] = R4300iOp::UnknownOpcode; + Jump_CoP0[0] = COP0_MF; + Jump_CoP0[1] = R4300iOp::UnknownOpcode; + Jump_CoP0[2] = R4300iOp::UnknownOpcode; + Jump_CoP0[3] = R4300iOp::UnknownOpcode; + Jump_CoP0[4] = COP0_MT; + Jump_CoP0[5] = R4300iOp::UnknownOpcode; + Jump_CoP0[6] = R4300iOp::UnknownOpcode; + Jump_CoP0[7] = R4300iOp::UnknownOpcode; + Jump_CoP0[8] = R4300iOp::UnknownOpcode; + Jump_CoP0[9] = R4300iOp::UnknownOpcode; Jump_CoP0[10] = R4300iOp::UnknownOpcode; Jump_CoP0[11] = R4300iOp::UnknownOpcode; Jump_CoP0[12] = R4300iOp::UnknownOpcode; @@ -231,16 +232,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP0[30] = R4300iOp::COP0_CO; Jump_CoP0[31] = R4300iOp::COP0_CO; - Jump_CoP0_Function[ 0] = R4300iOp::UnknownOpcode; - Jump_CoP0_Function[ 1] = R4300iOp::COP0_CO_TLBR; - Jump_CoP0_Function[ 2] = R4300iOp::COP0_CO_TLBWI; - Jump_CoP0_Function[ 3] = R4300iOp::UnknownOpcode; - Jump_CoP0_Function[ 4] = R4300iOp::UnknownOpcode; - Jump_CoP0_Function[ 5] = R4300iOp::UnknownOpcode; - Jump_CoP0_Function[ 6] = R4300iOp::COP0_CO_TLBWR; - Jump_CoP0_Function[ 7] = R4300iOp::UnknownOpcode; - Jump_CoP0_Function[ 8] = R4300iOp::COP0_CO_TLBP; - Jump_CoP0_Function[ 9] = R4300iOp::UnknownOpcode; + Jump_CoP0_Function[0] = R4300iOp::UnknownOpcode; + Jump_CoP0_Function[1] = R4300iOp::COP0_CO_TLBR; + Jump_CoP0_Function[2] = R4300iOp::COP0_CO_TLBWI; + Jump_CoP0_Function[3] = R4300iOp::UnknownOpcode; + Jump_CoP0_Function[4] = R4300iOp::UnknownOpcode; + Jump_CoP0_Function[5] = R4300iOp::UnknownOpcode; + Jump_CoP0_Function[6] = R4300iOp::COP0_CO_TLBWR; + Jump_CoP0_Function[7] = R4300iOp::UnknownOpcode; + Jump_CoP0_Function[8] = R4300iOp::COP0_CO_TLBP; + Jump_CoP0_Function[9] = R4300iOp::UnknownOpcode; Jump_CoP0_Function[10] = R4300iOp::UnknownOpcode; Jump_CoP0_Function[11] = R4300iOp::UnknownOpcode; Jump_CoP0_Function[12] = R4300iOp::UnknownOpcode; @@ -296,16 +297,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP0_Function[62] = R4300iOp::UnknownOpcode; Jump_CoP0_Function[63] = R4300iOp::UnknownOpcode; - Jump_CoP1[ 0] = COP1_MF; - Jump_CoP1[ 1] = R4300iOp::COP1_DMF; - Jump_CoP1[ 2] = COP1_CF; - Jump_CoP1[ 3] = R4300iOp::UnknownOpcode; - Jump_CoP1[ 4] = R4300iOp::COP1_MT; - Jump_CoP1[ 5] = COP1_DMT; - Jump_CoP1[ 6] = R4300iOp::COP1_CT; - Jump_CoP1[ 7] = R4300iOp::UnknownOpcode; - Jump_CoP1[ 8] = R4300iOp::COP1_BC; - Jump_CoP1[ 9] = R4300iOp::UnknownOpcode; + Jump_CoP1[0] = COP1_MF; + Jump_CoP1[1] = R4300iOp::COP1_DMF; + Jump_CoP1[2] = COP1_CF; + Jump_CoP1[3] = R4300iOp::UnknownOpcode; + Jump_CoP1[4] = R4300iOp::COP1_MT; + Jump_CoP1[5] = COP1_DMT; + Jump_CoP1[6] = R4300iOp::COP1_CT; + Jump_CoP1[7] = R4300iOp::UnknownOpcode; + Jump_CoP1[8] = R4300iOp::COP1_BC; + Jump_CoP1[9] = R4300iOp::UnknownOpcode; Jump_CoP1[10] = R4300iOp::UnknownOpcode; Jump_CoP1[11] = R4300iOp::UnknownOpcode; Jump_CoP1[12] = R4300iOp::UnknownOpcode; @@ -329,16 +330,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP1[30] = R4300iOp::UnknownOpcode; Jump_CoP1[31] = R4300iOp::UnknownOpcode; - Jump_CoP1_BC[ 0] = R4300iOp::COP1_BCF; - Jump_CoP1_BC[ 1] = R4300iOp::COP1_BCT; - Jump_CoP1_BC[ 2] = R4300iOp::COP1_BCFL; - Jump_CoP1_BC[ 3] = R4300iOp::COP1_BCTL; - Jump_CoP1_BC[ 4] = R4300iOp::UnknownOpcode; - Jump_CoP1_BC[ 5] = R4300iOp::UnknownOpcode; - Jump_CoP1_BC[ 6] = R4300iOp::UnknownOpcode; - Jump_CoP1_BC[ 7] = R4300iOp::UnknownOpcode; - Jump_CoP1_BC[ 8] = R4300iOp::UnknownOpcode; - Jump_CoP1_BC[ 9] = R4300iOp::UnknownOpcode; + Jump_CoP1_BC[0] = R4300iOp::COP1_BCF; + Jump_CoP1_BC[1] = R4300iOp::COP1_BCT; + Jump_CoP1_BC[2] = R4300iOp::COP1_BCFL; + Jump_CoP1_BC[3] = R4300iOp::COP1_BCTL; + Jump_CoP1_BC[4] = R4300iOp::UnknownOpcode; + Jump_CoP1_BC[5] = R4300iOp::UnknownOpcode; + Jump_CoP1_BC[6] = R4300iOp::UnknownOpcode; + Jump_CoP1_BC[7] = R4300iOp::UnknownOpcode; + Jump_CoP1_BC[8] = R4300iOp::UnknownOpcode; + Jump_CoP1_BC[9] = R4300iOp::UnknownOpcode; Jump_CoP1_BC[10] = R4300iOp::UnknownOpcode; Jump_CoP1_BC[11] = R4300iOp::UnknownOpcode; Jump_CoP1_BC[12] = R4300iOp::UnknownOpcode; @@ -362,16 +363,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP1_BC[30] = R4300iOp::UnknownOpcode; Jump_CoP1_BC[31] = R4300iOp::UnknownOpcode; - Jump_CoP1_S[ 0] = R4300iOp::COP1_S_ADD; - Jump_CoP1_S[ 1] = R4300iOp::COP1_S_SUB; - Jump_CoP1_S[ 2] = R4300iOp::COP1_S_MUL; - Jump_CoP1_S[ 3] = R4300iOp::COP1_S_DIV; - Jump_CoP1_S[ 4] = R4300iOp::COP1_S_SQRT; - Jump_CoP1_S[ 5] = R4300iOp::COP1_S_ABS; - Jump_CoP1_S[ 6] = R4300iOp::COP1_S_MOV; - Jump_CoP1_S[ 7] = R4300iOp::COP1_S_NEG; - Jump_CoP1_S[ 8] = R4300iOp::UnknownOpcode; - Jump_CoP1_S[ 9] = R4300iOp::COP1_S_TRUNC_L; + Jump_CoP1_S[0] = R4300iOp::COP1_S_ADD; + Jump_CoP1_S[1] = R4300iOp::COP1_S_SUB; + Jump_CoP1_S[2] = R4300iOp::COP1_S_MUL; + Jump_CoP1_S[3] = R4300iOp::COP1_S_DIV; + Jump_CoP1_S[4] = R4300iOp::COP1_S_SQRT; + Jump_CoP1_S[5] = R4300iOp::COP1_S_ABS; + Jump_CoP1_S[6] = R4300iOp::COP1_S_MOV; + Jump_CoP1_S[7] = R4300iOp::COP1_S_NEG; + Jump_CoP1_S[8] = R4300iOp::UnknownOpcode; + Jump_CoP1_S[9] = R4300iOp::COP1_S_TRUNC_L; Jump_CoP1_S[10] = R4300iOp::COP1_S_CEIL_L; //added by Witten Jump_CoP1_S[11] = R4300iOp::COP1_S_FLOOR_L; //added by Witten Jump_CoP1_S[12] = R4300iOp::COP1_S_ROUND_W; @@ -427,16 +428,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP1_S[62] = R4300iOp::COP1_S_CMP; Jump_CoP1_S[63] = R4300iOp::COP1_S_CMP; - Jump_CoP1_D[ 0] = R4300iOp::COP1_D_ADD; - Jump_CoP1_D[ 1] = R4300iOp::COP1_D_SUB; - Jump_CoP1_D[ 2] = R4300iOp::COP1_D_MUL; - Jump_CoP1_D[ 3] = R4300iOp::COP1_D_DIV; - Jump_CoP1_D[ 4] = R4300iOp::COP1_D_SQRT; - Jump_CoP1_D[ 5] = R4300iOp::COP1_D_ABS; - Jump_CoP1_D[ 6] = R4300iOp::COP1_D_MOV; - Jump_CoP1_D[ 7] = R4300iOp::COP1_D_NEG; - Jump_CoP1_D[ 8] = R4300iOp::UnknownOpcode; - Jump_CoP1_D[ 9] = R4300iOp::COP1_D_TRUNC_L; //added by Witten + Jump_CoP1_D[0] = R4300iOp::COP1_D_ADD; + Jump_CoP1_D[1] = R4300iOp::COP1_D_SUB; + Jump_CoP1_D[2] = R4300iOp::COP1_D_MUL; + Jump_CoP1_D[3] = R4300iOp::COP1_D_DIV; + Jump_CoP1_D[4] = R4300iOp::COP1_D_SQRT; + Jump_CoP1_D[5] = R4300iOp::COP1_D_ABS; + Jump_CoP1_D[6] = R4300iOp::COP1_D_MOV; + Jump_CoP1_D[7] = R4300iOp::COP1_D_NEG; + Jump_CoP1_D[8] = R4300iOp::UnknownOpcode; + Jump_CoP1_D[9] = R4300iOp::COP1_D_TRUNC_L; //added by Witten Jump_CoP1_D[10] = R4300iOp::COP1_D_CEIL_L; //added by Witten Jump_CoP1_D[11] = R4300iOp::COP1_D_FLOOR_L; //added by Witten Jump_CoP1_D[12] = R4300iOp::COP1_D_ROUND_W; @@ -492,16 +493,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP1_D[62] = R4300iOp::COP1_D_CMP; Jump_CoP1_D[63] = R4300iOp::COP1_D_CMP; - Jump_CoP1_W[ 0] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 1] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 2] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 3] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 4] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 5] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 6] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 7] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 8] = R4300iOp::UnknownOpcode; - Jump_CoP1_W[ 9] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[0] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[1] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[2] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[3] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[4] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[5] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[6] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[7] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[8] = R4300iOp::UnknownOpcode; + Jump_CoP1_W[9] = R4300iOp::UnknownOpcode; Jump_CoP1_W[10] = R4300iOp::UnknownOpcode; Jump_CoP1_W[11] = R4300iOp::UnknownOpcode; Jump_CoP1_W[12] = R4300iOp::UnknownOpcode; @@ -557,16 +558,16 @@ R4300iOp32::Func * R4300iOp32::BuildInterpreter() Jump_CoP1_W[62] = R4300iOp::UnknownOpcode; Jump_CoP1_W[63] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 0] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 1] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 2] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 3] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 4] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 5] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 6] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 7] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 8] = R4300iOp::UnknownOpcode; - Jump_CoP1_L[ 9] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[0] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[1] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[2] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[3] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[4] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[5] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[6] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[7] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[8] = R4300iOp::UnknownOpcode; + Jump_CoP1_L[9] = R4300iOp::UnknownOpcode; Jump_CoP1_L[10] = R4300iOp::UnknownOpcode; Jump_CoP1_L[11] = R4300iOp::UnknownOpcode; Jump_CoP1_L[12] = R4300iOp::UnknownOpcode; @@ -646,7 +647,7 @@ void R4300iOp32::BEQ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -666,7 +667,7 @@ void R4300iOp32::BNE() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -685,7 +686,7 @@ void R4300iOp32::BLEZ() { m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -705,7 +706,7 @@ void R4300iOp32::BGTZ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -769,7 +770,7 @@ void R4300iOp32::SLTIU() int64_t imm64; imm64 = imm32; - _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].UW[0] < (uint64_t)imm64?1:0; + _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rs].UW[0] < (uint64_t)imm64 ? 1 : 0; } void R4300iOp32::ANDI() @@ -806,7 +807,7 @@ void R4300iOp32::BEQL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -827,7 +828,7 @@ void R4300iOp32::BNEL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -848,7 +849,7 @@ void R4300iOp32::BLEZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -869,7 +870,7 @@ void R4300iOp32::BGTZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -884,8 +885,8 @@ void R4300iOp32::BGTZL() void R4300iOp32::LB() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + if (!g_MMU->LB_VAddr(Address, _GPR[m_Opcode.rt].UB[0])) { if (bShowTLBMisses()) { @@ -901,12 +902,12 @@ void R4300iOp32::LB() void R4300iOp32::LH() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) + if (!g_MMU->LH_VAddr(Address, _GPR[m_Opcode.rt].UHW[0])) { if (bShowTLBMisses()) { @@ -925,9 +926,9 @@ void R4300iOp32::LWL() uint32_t Offset, Address, Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 3; + Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) + if (!g_MMU->LW_VAddr((Address & ~3), Value)) { if (bShowTLBMisses()) { @@ -943,7 +944,7 @@ void R4300iOp32::LWL() void R4300iOp32::LW() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); @@ -951,10 +952,10 @@ void R4300iOp32::LW() if (g_LogOptions.GenerateLog) { - Log_LW((*_PROGRAM_COUNTER),Address); + Log_LW((*_PROGRAM_COUNTER), Address); } - if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->LW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { if (bShowTLBMisses()) { @@ -970,8 +971,8 @@ void R4300iOp32::LW() void R4300iOp32::LBU() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + if (!g_MMU->LB_VAddr(Address, _GPR[m_Opcode.rt].UB[0])) { if (bShowTLBMisses()) { @@ -987,12 +988,12 @@ void R4300iOp32::LBU() void R4300iOp32::LHU() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) + if (!g_MMU->LH_VAddr(Address, _GPR[m_Opcode.rt].UHW[0])) { if (bShowTLBMisses()) { @@ -1011,11 +1012,11 @@ void R4300iOp32::LWR() uint32_t Offset, Address, Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 3; + Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) + if (!g_MMU->LW_VAddr((Address & ~3), Value)) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); if (bShowTLBMisses()) { g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); @@ -1029,13 +1030,13 @@ void R4300iOp32::LWR() void R4300iOp32::LWU() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->LW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { if (bShowTLBMisses()) { @@ -1051,13 +1052,13 @@ void R4300iOp32::LWU() void R4300iOp32::LL() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->LW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { if (bShowTLBMisses()) { @@ -1203,7 +1204,7 @@ void R4300iOp32::REGIMM_BLTZ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -1223,7 +1224,7 @@ void R4300iOp32::REGIMM_BGEZ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -1243,7 +1244,7 @@ void R4300iOp32::REGIMM_BLTZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -1264,7 +1265,7 @@ void R4300iOp32::REGIMM_BGEZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -1285,7 +1286,7 @@ void R4300iOp32::REGIMM_BLTZAL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -1295,7 +1296,7 @@ void R4300iOp32::REGIMM_BLTZAL() { m_JumpToLocation = (*_PROGRAM_COUNTER) + 8; } - _GPR[31].W[0]= (int32_t)((*_PROGRAM_COUNTER) + 8); + _GPR[31].W[0] = (int32_t)((*_PROGRAM_COUNTER) + 8); } void R4300iOp32::REGIMM_BGEZAL() @@ -1306,7 +1307,7 @@ void R4300iOp32::REGIMM_BGEZAL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -1338,10 +1339,10 @@ void R4300iOp32::COP0_MT() { if (g_LogOptions.LogCP0changes) { - LogMessage("%08X: Writing 0x%X to %s register (Originally: 0x%08X)",(*_PROGRAM_COUNTER), _GPR[m_Opcode.rt].UW[0],CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); + LogMessage("%08X: Writing 0x%X to %s register (Originally: 0x%08X)", (*_PROGRAM_COUNTER), _GPR[m_Opcode.rt].UW[0], CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); if (m_Opcode.rd == 11) //Compare { - LogMessage("%08X: Cause register changed from %08X to %08X",(*_PROGRAM_COUNTER), g_Reg->CAUSE_REGISTER, (g_Reg->CAUSE_REGISTER & ~CAUSE_IP7)); + LogMessage("%08X: Cause register changed from %08X to %08X", (*_PROGRAM_COUNTER), g_Reg->CAUSE_REGISTER, (g_Reg->CAUSE_REGISTER & ~CAUSE_IP7)); } } @@ -1397,7 +1398,7 @@ void R4300iOp32::COP0_MT() break; case 13: //cause _CP0[m_Opcode.rd] &= 0xFFFFCFF; - if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && g_Settings->LoadBool(Debugger_Enabled) ) + if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && g_Settings->LoadBool(Debugger_Enabled)) { g_Notify->DisplayError(L"Set IP0 or IP1"); } @@ -1422,11 +1423,11 @@ void R4300iOp32::COP1_CF() if (g_Settings->LoadBool(Debugger_Enabled)) { g_Notify->DisplayError(L"CFC1 what register are you writing to ?"); } return; } - _GPR[m_Opcode.rt].W[0] = (int32_t)_FPCR[m_Opcode.fs]; + _GPR[m_Opcode.rt].W[0] = (int32_t)_FPCR[m_Opcode.fs]; } void R4300iOp32::COP1_DMT() { TEST_COP1_USABLE_EXCEPTION *(int64_t *)_FPR_D[m_Opcode.fs] = _GPR[m_Opcode.rt].W[0]; -} +} \ No newline at end of file diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp index 1282ed151..49c81c22a 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp @@ -9,6 +9,7 @@ * * ****************************************************************************/ #include "stdafx.h" +#include void InPermLoop(); void TestInterpreterJump(uint32_t PC, uint32_t TargetPC, int32_t Reg1, int32_t Reg2); @@ -30,15 +31,15 @@ R4300iOp::Func R4300iOp::Jump_CoP1_D[64]; R4300iOp::Func R4300iOp::Jump_CoP1_W[64]; R4300iOp::Func R4300iOp::Jump_CoP1_L[64]; -const uint32_t R4300iOp::SWL_MASK[4] = { 0x00000000, 0xFF000000,0xFFFF0000,0xFFFFFF00 }; -const uint32_t R4300iOp::SWR_MASK[4] = { 0x00FFFFFF, 0x0000FFFF,0x000000FF,0x00000000 }; -const uint32_t R4300iOp::LWL_MASK[4] = { 0x00000000, 0x000000FF,0x0000FFFF,0x00FFFFFF }; -const uint32_t R4300iOp::LWR_MASK[4] = { 0xFFFFFF00, 0xFFFF0000,0xFF000000,0x0000000 }; +const uint32_t R4300iOp::SWL_MASK[4] = { 0x00000000, 0xFF000000, 0xFFFF0000, 0xFFFFFF00 }; +const uint32_t R4300iOp::SWR_MASK[4] = { 0x00FFFFFF, 0x0000FFFF, 0x000000FF, 0x00000000 }; +const uint32_t R4300iOp::LWL_MASK[4] = { 0x00000000, 0x000000FF, 0x0000FFFF, 0x00FFFFFF }; +const uint32_t R4300iOp::LWR_MASK[4] = { 0xFFFFFF00, 0xFFFF0000, 0xFF000000, 0x0000000 }; const int32_t R4300iOp::SWL_SHIFT[4] = { 0, 8, 16, 24 }; -const int32_t R4300iOp::SWR_SHIFT[4] = { 24, 16 , 8, 0 }; -const int32_t R4300iOp::LWL_SHIFT[4] = { 0, 8, 16, 24}; -const int32_t R4300iOp::LWR_SHIFT[4] = { 24, 16 ,8, 0 }; +const int32_t R4300iOp::SWR_SHIFT[4] = { 24, 16, 8, 0 }; +const int32_t R4300iOp::LWL_SHIFT[4] = { 0, 8, 16, 24 }; +const int32_t R4300iOp::LWR_SHIFT[4] = { 24, 16, 8, 0 }; #define ADDRESS_ERROR_EXCEPTION(Address,FromRead) \ g_Reg->DoAddressError(m_NextInstruction == JUMP,Address,FromRead);\ @@ -53,7 +54,7 @@ const int32_t R4300iOp::LWR_SHIFT[4] = { 24, 16 ,8, 0 }; m_NextInstruction = JUMP;\ m_JumpToLocation = (*_PROGRAM_COUNTER);\ return;\ - } + } #define TLB_READ_EXCEPTION(Address) \ g_Reg->DoTLBReadMiss(m_NextInstruction == JUMP,Address);\ @@ -63,68 +64,68 @@ const int32_t R4300iOp::LWR_SHIFT[4] = { 24, 16 ,8, 0 }; void R4300iOp::SPECIAL() { - Jump_Special[ m_Opcode.funct ](); + Jump_Special[m_Opcode.funct](); } void R4300iOp::REGIMM() { - Jump_Regimm[ m_Opcode.rt ](); + Jump_Regimm[m_Opcode.rt](); } void R4300iOp::COP0() { - Jump_CoP0[ m_Opcode.rs ](); + Jump_CoP0[m_Opcode.rs](); } void R4300iOp::COP0_CO() { - Jump_CoP0_Function[ m_Opcode.funct ](); + Jump_CoP0_Function[m_Opcode.funct](); } void R4300iOp::COP1() { - Jump_CoP1[ m_Opcode.fmt ](); + Jump_CoP1[m_Opcode.fmt](); } void R4300iOp::COP1_BC() { - Jump_CoP1_BC[ m_Opcode.ft ](); + Jump_CoP1_BC[m_Opcode.ft](); } void R4300iOp::COP1_S() { - _controlfp(*_RoundingModel,_MCW_RC); - Jump_CoP1_S[ m_Opcode.funct ](); + _controlfp(*_RoundingModel, _MCW_RC); + Jump_CoP1_S[m_Opcode.funct](); } void R4300iOp::COP1_D() { - _controlfp(*_RoundingModel,_MCW_RC); - Jump_CoP1_D[ m_Opcode.funct ](); + _controlfp(*_RoundingModel, _MCW_RC); + Jump_CoP1_D[m_Opcode.funct](); } void R4300iOp::COP1_W() { - Jump_CoP1_W[ m_Opcode.funct ](); + Jump_CoP1_W[m_Opcode.funct](); } void R4300iOp::COP1_L() { - Jump_CoP1_L[ m_Opcode.funct ](); + Jump_CoP1_L[m_Opcode.funct](); } R4300iOp::Func * R4300iOp::BuildInterpreter() { - Jump_Opcode[ 0] = SPECIAL; - Jump_Opcode[ 1] = REGIMM; - Jump_Opcode[ 2] = J; - Jump_Opcode[ 3] = JAL; - Jump_Opcode[ 4] = BEQ; - Jump_Opcode[ 5] = BNE; - Jump_Opcode[ 6] = BLEZ; - Jump_Opcode[ 7] = BGTZ; - Jump_Opcode[ 8] = ADDI; - Jump_Opcode[ 9] = ADDIU; + Jump_Opcode[0] = SPECIAL; + Jump_Opcode[1] = REGIMM; + Jump_Opcode[2] = J; + Jump_Opcode[3] = JAL; + Jump_Opcode[4] = BEQ; + Jump_Opcode[5] = BNE; + Jump_Opcode[6] = BLEZ; + Jump_Opcode[7] = BGTZ; + Jump_Opcode[8] = ADDI; + Jump_Opcode[9] = ADDIU; Jump_Opcode[10] = SLTI; Jump_Opcode[11] = SLTIU; Jump_Opcode[12] = ANDI; @@ -180,16 +181,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_Opcode[62] = UnknownOpcode; Jump_Opcode[63] = SD; - Jump_Special[ 0] = SPECIAL_SLL; - Jump_Special[ 1] = UnknownOpcode; - Jump_Special[ 2] = SPECIAL_SRL; - Jump_Special[ 3] = SPECIAL_SRA; - Jump_Special[ 4] = SPECIAL_SLLV; - Jump_Special[ 5] = UnknownOpcode; - Jump_Special[ 6] = SPECIAL_SRLV; - Jump_Special[ 7] = SPECIAL_SRAV; - Jump_Special[ 8] = SPECIAL_JR; - Jump_Special[ 9] = SPECIAL_JALR; + Jump_Special[0] = SPECIAL_SLL; + Jump_Special[1] = UnknownOpcode; + Jump_Special[2] = SPECIAL_SRL; + Jump_Special[3] = SPECIAL_SRA; + Jump_Special[4] = SPECIAL_SLLV; + Jump_Special[5] = UnknownOpcode; + Jump_Special[6] = SPECIAL_SRLV; + Jump_Special[7] = SPECIAL_SRAV; + Jump_Special[8] = SPECIAL_JR; + Jump_Special[9] = SPECIAL_JALR; Jump_Special[10] = UnknownOpcode; Jump_Special[11] = UnknownOpcode; Jump_Special[12] = SPECIAL_SYSCALL; @@ -245,16 +246,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_Special[62] = SPECIAL_DSRL32; Jump_Special[63] = SPECIAL_DSRA32; - Jump_Regimm[ 0] = REGIMM_BLTZ; - Jump_Regimm[ 1] = REGIMM_BGEZ; - Jump_Regimm[ 2] = REGIMM_BLTZL; - Jump_Regimm[ 3] = REGIMM_BGEZL; - Jump_Regimm[ 4] = UnknownOpcode; - Jump_Regimm[ 5] = UnknownOpcode; - Jump_Regimm[ 6] = UnknownOpcode; - Jump_Regimm[ 7] = UnknownOpcode; - Jump_Regimm[ 8] = UnknownOpcode; - Jump_Regimm[ 9] = UnknownOpcode; + Jump_Regimm[0] = REGIMM_BLTZ; + Jump_Regimm[1] = REGIMM_BGEZ; + Jump_Regimm[2] = REGIMM_BLTZL; + Jump_Regimm[3] = REGIMM_BGEZL; + Jump_Regimm[4] = UnknownOpcode; + Jump_Regimm[5] = UnknownOpcode; + Jump_Regimm[6] = UnknownOpcode; + Jump_Regimm[7] = UnknownOpcode; + Jump_Regimm[8] = UnknownOpcode; + Jump_Regimm[9] = UnknownOpcode; Jump_Regimm[10] = UnknownOpcode; Jump_Regimm[11] = UnknownOpcode; Jump_Regimm[12] = UnknownOpcode; @@ -278,16 +279,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_Regimm[30] = UnknownOpcode; Jump_Regimm[31] = UnknownOpcode; - Jump_CoP0[ 0] = COP0_MF; - Jump_CoP0[ 1] = UnknownOpcode; - Jump_CoP0[ 2] = UnknownOpcode; - Jump_CoP0[ 3] = UnknownOpcode; - Jump_CoP0[ 4] = COP0_MT; - Jump_CoP0[ 5] = UnknownOpcode; - Jump_CoP0[ 6] = UnknownOpcode; - Jump_CoP0[ 7] = UnknownOpcode; - Jump_CoP0[ 8] = UnknownOpcode; - Jump_CoP0[ 9] = UnknownOpcode; + Jump_CoP0[0] = COP0_MF; + Jump_CoP0[1] = UnknownOpcode; + Jump_CoP0[2] = UnknownOpcode; + Jump_CoP0[3] = UnknownOpcode; + Jump_CoP0[4] = COP0_MT; + Jump_CoP0[5] = UnknownOpcode; + Jump_CoP0[6] = UnknownOpcode; + Jump_CoP0[7] = UnknownOpcode; + Jump_CoP0[8] = UnknownOpcode; + Jump_CoP0[9] = UnknownOpcode; Jump_CoP0[10] = UnknownOpcode; Jump_CoP0[11] = UnknownOpcode; Jump_CoP0[12] = UnknownOpcode; @@ -311,16 +312,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP0[30] = COP0_CO; Jump_CoP0[31] = COP0_CO; - Jump_CoP0_Function[ 0] = UnknownOpcode; - Jump_CoP0_Function[ 1] = COP0_CO_TLBR; - Jump_CoP0_Function[ 2] = COP0_CO_TLBWI; - Jump_CoP0_Function[ 3] = UnknownOpcode; - Jump_CoP0_Function[ 4] = UnknownOpcode; - Jump_CoP0_Function[ 5] = UnknownOpcode; - Jump_CoP0_Function[ 6] = COP0_CO_TLBWR; - Jump_CoP0_Function[ 7] = UnknownOpcode; - Jump_CoP0_Function[ 8] = COP0_CO_TLBP; - Jump_CoP0_Function[ 9] = UnknownOpcode; + Jump_CoP0_Function[0] = UnknownOpcode; + Jump_CoP0_Function[1] = COP0_CO_TLBR; + Jump_CoP0_Function[2] = COP0_CO_TLBWI; + Jump_CoP0_Function[3] = UnknownOpcode; + Jump_CoP0_Function[4] = UnknownOpcode; + Jump_CoP0_Function[5] = UnknownOpcode; + Jump_CoP0_Function[6] = COP0_CO_TLBWR; + Jump_CoP0_Function[7] = UnknownOpcode; + Jump_CoP0_Function[8] = COP0_CO_TLBP; + Jump_CoP0_Function[9] = UnknownOpcode; Jump_CoP0_Function[10] = UnknownOpcode; Jump_CoP0_Function[11] = UnknownOpcode; Jump_CoP0_Function[12] = UnknownOpcode; @@ -376,16 +377,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP0_Function[62] = UnknownOpcode; Jump_CoP0_Function[63] = UnknownOpcode; - Jump_CoP1[ 0] = COP1_MF; - Jump_CoP1[ 1] = COP1_DMF; - Jump_CoP1[ 2] = COP1_CF; - Jump_CoP1[ 3] = UnknownOpcode; - Jump_CoP1[ 4] = COP1_MT; - Jump_CoP1[ 5] = COP1_DMT; - Jump_CoP1[ 6] = COP1_CT; - Jump_CoP1[ 7] = UnknownOpcode; - Jump_CoP1[ 8] = COP1_BC; - Jump_CoP1[ 9] = UnknownOpcode; + Jump_CoP1[0] = COP1_MF; + Jump_CoP1[1] = COP1_DMF; + Jump_CoP1[2] = COP1_CF; + Jump_CoP1[3] = UnknownOpcode; + Jump_CoP1[4] = COP1_MT; + Jump_CoP1[5] = COP1_DMT; + Jump_CoP1[6] = COP1_CT; + Jump_CoP1[7] = UnknownOpcode; + Jump_CoP1[8] = COP1_BC; + Jump_CoP1[9] = UnknownOpcode; Jump_CoP1[10] = UnknownOpcode; Jump_CoP1[11] = UnknownOpcode; Jump_CoP1[12] = UnknownOpcode; @@ -409,16 +410,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP1[30] = UnknownOpcode; Jump_CoP1[31] = UnknownOpcode; - Jump_CoP1_BC[ 0] = COP1_BCF; - Jump_CoP1_BC[ 1] = COP1_BCT; - Jump_CoP1_BC[ 2] = COP1_BCFL; - Jump_CoP1_BC[ 3] = COP1_BCTL; - Jump_CoP1_BC[ 4] = UnknownOpcode; - Jump_CoP1_BC[ 5] = UnknownOpcode; - Jump_CoP1_BC[ 6] = UnknownOpcode; - Jump_CoP1_BC[ 7] = UnknownOpcode; - Jump_CoP1_BC[ 8] = UnknownOpcode; - Jump_CoP1_BC[ 9] = UnknownOpcode; + Jump_CoP1_BC[0] = COP1_BCF; + Jump_CoP1_BC[1] = COP1_BCT; + Jump_CoP1_BC[2] = COP1_BCFL; + Jump_CoP1_BC[3] = COP1_BCTL; + Jump_CoP1_BC[4] = UnknownOpcode; + Jump_CoP1_BC[5] = UnknownOpcode; + Jump_CoP1_BC[6] = UnknownOpcode; + Jump_CoP1_BC[7] = UnknownOpcode; + Jump_CoP1_BC[8] = UnknownOpcode; + Jump_CoP1_BC[9] = UnknownOpcode; Jump_CoP1_BC[10] = UnknownOpcode; Jump_CoP1_BC[11] = UnknownOpcode; Jump_CoP1_BC[12] = UnknownOpcode; @@ -442,16 +443,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP1_BC[30] = UnknownOpcode; Jump_CoP1_BC[31] = UnknownOpcode; - Jump_CoP1_S[ 0] = COP1_S_ADD; - Jump_CoP1_S[ 1] = COP1_S_SUB; - Jump_CoP1_S[ 2] = COP1_S_MUL; - Jump_CoP1_S[ 3] = COP1_S_DIV; - Jump_CoP1_S[ 4] = COP1_S_SQRT; - Jump_CoP1_S[ 5] = COP1_S_ABS; - Jump_CoP1_S[ 6] = COP1_S_MOV; - Jump_CoP1_S[ 7] = COP1_S_NEG; - Jump_CoP1_S[ 8] = UnknownOpcode; - Jump_CoP1_S[ 9] = COP1_S_TRUNC_L; + Jump_CoP1_S[0] = COP1_S_ADD; + Jump_CoP1_S[1] = COP1_S_SUB; + Jump_CoP1_S[2] = COP1_S_MUL; + Jump_CoP1_S[3] = COP1_S_DIV; + Jump_CoP1_S[4] = COP1_S_SQRT; + Jump_CoP1_S[5] = COP1_S_ABS; + Jump_CoP1_S[6] = COP1_S_MOV; + Jump_CoP1_S[7] = COP1_S_NEG; + Jump_CoP1_S[8] = UnknownOpcode; + Jump_CoP1_S[9] = COP1_S_TRUNC_L; Jump_CoP1_S[10] = COP1_S_CEIL_L; //added by Witten Jump_CoP1_S[11] = COP1_S_FLOOR_L; //added by Witten Jump_CoP1_S[12] = COP1_S_ROUND_W; @@ -507,16 +508,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP1_S[62] = COP1_S_CMP; Jump_CoP1_S[63] = COP1_S_CMP; - Jump_CoP1_D[ 0] = COP1_D_ADD; - Jump_CoP1_D[ 1] = COP1_D_SUB; - Jump_CoP1_D[ 2] = COP1_D_MUL; - Jump_CoP1_D[ 3] = COP1_D_DIV; - Jump_CoP1_D[ 4] = COP1_D_SQRT; - Jump_CoP1_D[ 5] = COP1_D_ABS; - Jump_CoP1_D[ 6] = COP1_D_MOV; - Jump_CoP1_D[ 7] = COP1_D_NEG; - Jump_CoP1_D[ 8] = UnknownOpcode; - Jump_CoP1_D[ 9] = COP1_D_TRUNC_L; //added by Witten + Jump_CoP1_D[0] = COP1_D_ADD; + Jump_CoP1_D[1] = COP1_D_SUB; + Jump_CoP1_D[2] = COP1_D_MUL; + Jump_CoP1_D[3] = COP1_D_DIV; + Jump_CoP1_D[4] = COP1_D_SQRT; + Jump_CoP1_D[5] = COP1_D_ABS; + Jump_CoP1_D[6] = COP1_D_MOV; + Jump_CoP1_D[7] = COP1_D_NEG; + Jump_CoP1_D[8] = UnknownOpcode; + Jump_CoP1_D[9] = COP1_D_TRUNC_L; //added by Witten Jump_CoP1_D[10] = COP1_D_CEIL_L; //added by Witten Jump_CoP1_D[11] = COP1_D_FLOOR_L; //added by Witten Jump_CoP1_D[12] = COP1_D_ROUND_W; @@ -572,16 +573,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP1_D[62] = COP1_D_CMP; Jump_CoP1_D[63] = COP1_D_CMP; - Jump_CoP1_W[ 0] = UnknownOpcode; - Jump_CoP1_W[ 1] = UnknownOpcode; - Jump_CoP1_W[ 2] = UnknownOpcode; - Jump_CoP1_W[ 3] = UnknownOpcode; - Jump_CoP1_W[ 4] = UnknownOpcode; - Jump_CoP1_W[ 5] = UnknownOpcode; - Jump_CoP1_W[ 6] = UnknownOpcode; - Jump_CoP1_W[ 7] = UnknownOpcode; - Jump_CoP1_W[ 8] = UnknownOpcode; - Jump_CoP1_W[ 9] = UnknownOpcode; + Jump_CoP1_W[0] = UnknownOpcode; + Jump_CoP1_W[1] = UnknownOpcode; + Jump_CoP1_W[2] = UnknownOpcode; + Jump_CoP1_W[3] = UnknownOpcode; + Jump_CoP1_W[4] = UnknownOpcode; + Jump_CoP1_W[5] = UnknownOpcode; + Jump_CoP1_W[6] = UnknownOpcode; + Jump_CoP1_W[7] = UnknownOpcode; + Jump_CoP1_W[8] = UnknownOpcode; + Jump_CoP1_W[9] = UnknownOpcode; Jump_CoP1_W[10] = UnknownOpcode; Jump_CoP1_W[11] = UnknownOpcode; Jump_CoP1_W[12] = UnknownOpcode; @@ -637,16 +638,16 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() Jump_CoP1_W[62] = UnknownOpcode; Jump_CoP1_W[63] = UnknownOpcode; - Jump_CoP1_L[ 0] = UnknownOpcode; - Jump_CoP1_L[ 1] = UnknownOpcode; - Jump_CoP1_L[ 2] = UnknownOpcode; - Jump_CoP1_L[ 3] = UnknownOpcode; - Jump_CoP1_L[ 4] = UnknownOpcode; - Jump_CoP1_L[ 5] = UnknownOpcode; - Jump_CoP1_L[ 6] = UnknownOpcode; - Jump_CoP1_L[ 7] = UnknownOpcode; - Jump_CoP1_L[ 8] = UnknownOpcode; - Jump_CoP1_L[ 9] = UnknownOpcode; + Jump_CoP1_L[0] = UnknownOpcode; + Jump_CoP1_L[1] = UnknownOpcode; + Jump_CoP1_L[2] = UnknownOpcode; + Jump_CoP1_L[3] = UnknownOpcode; + Jump_CoP1_L[4] = UnknownOpcode; + Jump_CoP1_L[5] = UnknownOpcode; + Jump_CoP1_L[6] = UnknownOpcode; + Jump_CoP1_L[7] = UnknownOpcode; + Jump_CoP1_L[8] = UnknownOpcode; + Jump_CoP1_L[9] = UnknownOpcode; Jump_CoP1_L[10] = UnknownOpcode; Jump_CoP1_L[11] = UnknownOpcode; Jump_CoP1_L[12] = UnknownOpcode; @@ -705,15 +706,15 @@ R4300iOp::Func * R4300iOp::BuildInterpreter() return Jump_Opcode; } -bool DelaySlotEffectsCompare (uint32_t PC, uint32_t Reg1, uint32_t Reg2); +bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2); -void TestInterpreterJump (uint32_t PC, uint32_t TargetPC, int32_t Reg1, int32_t Reg2) +void TestInterpreterJump(uint32_t PC, uint32_t TargetPC, int32_t Reg1, int32_t Reg2) { if (PC != TargetPC) { return; } - if (DelaySlotEffectsCompare(PC,Reg1,Reg2)) + if (DelaySlotEffectsCompare(PC, Reg1, Reg2)) { return; } @@ -736,7 +737,7 @@ void R4300iOp::JAL() { m_NextInstruction = DELAY_SLOT; m_JumpToLocation = ((*_PROGRAM_COUNTER) & 0xF0000000) + (m_Opcode.target << 2); - _GPR[31].DW= (int32_t)((*_PROGRAM_COUNTER) + 8); + _GPR[31].DW = (int32_t)((*_PROGRAM_COUNTER) + 8); if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { @@ -752,7 +753,7 @@ void R4300iOp::BEQ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -772,7 +773,7 @@ void R4300iOp::BNE() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -792,7 +793,7 @@ void R4300iOp::BLEZ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -812,7 +813,7 @@ void R4300iOp::BGTZ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -876,7 +877,7 @@ void R4300iOp::SLTIU() int64_t imm64; imm64 = imm32; - _GPR[m_Opcode.rt].DW = _GPR[m_Opcode.rs].UDW < (uint64_t)imm64?1:0; + _GPR[m_Opcode.rt].DW = _GPR[m_Opcode.rs].UDW < (uint64_t)imm64 ? 1 : 0; } void R4300iOp::ANDI() @@ -901,7 +902,7 @@ void R4300iOp::LUI() if (m_Opcode.rt == 29) { StackValue = _GPR[m_Opcode.rt].W[0]; - } +} #endif } @@ -913,7 +914,7 @@ void R4300iOp::BEQL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -934,7 +935,7 @@ void R4300iOp::BNEL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,m_Opcode.rt)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, m_Opcode.rt)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -955,7 +956,7 @@ void R4300iOp::BLEZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -976,7 +977,7 @@ void R4300iOp::BGTZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER,m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare(*_PROGRAM_COUNTER, m_Opcode.rs, 0)) { m_NextInstruction = PERMLOOP_DO_DELAY; } @@ -994,7 +995,7 @@ void R4300iOp::DADDIU() _GPR[m_Opcode.rt].DW = _GPR[m_Opcode.rs].DW + (int64_t)((int16_t)m_Opcode.immediate); } -uint64_t LDL_MASK[8] = { 0,0xFF,0xFFFF,0xFFFFFF,0xFFFFFFFF,0xFFFFFFFFFF, 0xFFFFFFFFFFFF, 0xFFFFFFFFFFFFFF }; +uint64_t LDL_MASK[8] = { 0, 0xFF, 0xFFFF, 0xFFFFFF, 0xFFFFFFFF, 0xFFFFFFFFFF, 0xFFFFFFFFFFFF, 0xFFFFFFFFFFFFFF }; int32_t LDL_SHIFT[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; void R4300iOp::LDL() @@ -1003,11 +1004,11 @@ void R4300iOp::LDL() uint64_t Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 7; + Offset = Address & 7; - if (!g_MMU->LD_VAddr((Address & ~7),Value)) + if (!g_MMU->LD_VAddr((Address & ~7), Value)) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); if (bShowTLBMisses()) { g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); @@ -1019,9 +1020,9 @@ void R4300iOp::LDL() } uint64_t LDR_MASK[8] = { 0xFFFFFFFFFFFFFF00, 0xFFFFFFFFFFFF0000, - 0xFFFFFFFFFF000000, 0xFFFFFFFF00000000, - 0xFFFFFF0000000000, 0xFFFF000000000000, - 0xFF00000000000000, 0 }; +0xFFFFFFFFFF000000, 0xFFFFFFFF00000000, +0xFFFFFF0000000000, 0xFFFF000000000000, +0xFF00000000000000, 0 }; int32_t LDR_SHIFT[8] = { 56, 48, 40, 32, 24, 16, 8, 0 }; void R4300iOp::LDR() @@ -1030,11 +1031,11 @@ void R4300iOp::LDR() uint64_t Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 7; + Offset = Address & 7; - if (!g_MMU->LD_VAddr((Address & ~7),Value)) + if (!g_MMU->LD_VAddr((Address & ~7), Value)) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); if (bShowTLBMisses()) { g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); @@ -1048,8 +1049,8 @@ void R4300iOp::LDR() void R4300iOp::LB() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + if (!g_MMU->LB_VAddr(Address, _GPR[m_Opcode.rt].UB[0])) { if (bShowTLBMisses()) { @@ -1065,12 +1066,12 @@ void R4300iOp::LB() void R4300iOp::LH() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) + if (!g_MMU->LH_VAddr(Address, _GPR[m_Opcode.rt].UHW[0])) { if (bShowTLBMisses()) { @@ -1089,11 +1090,11 @@ void R4300iOp::LWL() uint32_t Offset, Address, Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 3; + Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) + if (!g_MMU->LW_VAddr((Address & ~3), Value)) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); if (bShowTLBMisses()) { g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); @@ -1107,7 +1108,7 @@ void R4300iOp::LWL() void R4300iOp::LW() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); @@ -1115,10 +1116,10 @@ void R4300iOp::LW() if (g_LogOptions.GenerateLog) { - Log_LW((*_PROGRAM_COUNTER),Address); + Log_LW((*_PROGRAM_COUNTER), Address); } - if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->LW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { if (bShowTLBMisses()) { @@ -1134,8 +1135,8 @@ void R4300iOp::LW() void R4300iOp::LBU() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + if (!g_MMU->LB_VAddr(Address, _GPR[m_Opcode.rt].UB[0])) { if (bShowTLBMisses()) { @@ -1151,12 +1152,12 @@ void R4300iOp::LBU() void R4300iOp::LHU() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) + if (!g_MMU->LH_VAddr(Address, _GPR[m_Opcode.rt].UHW[0])) { if (bShowTLBMisses()) { @@ -1175,11 +1176,11 @@ void R4300iOp::LWR() uint32_t Offset, Address, Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 3; + Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) + if (!g_MMU->LW_VAddr((Address & ~3), Value)) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); if (bShowTLBMisses()) { g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); @@ -1193,13 +1194,13 @@ void R4300iOp::LWR() void R4300iOp::LWU() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->LW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { if (bShowTLBMisses()) { @@ -1215,12 +1216,12 @@ void R4300iOp::LWU() void R4300iOp::SB() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - if (!g_MMU->SB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + if (!g_MMU->SB_VAddr(Address, _GPR[m_Opcode.rt].UB[0])) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1231,16 +1232,16 @@ void R4300iOp::SB() void R4300iOp::SH() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address, false); } - if (!g_MMU->SH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) + if (!g_MMU->SH_VAddr(Address, _GPR[m_Opcode.rt].UHW[0])) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1254,13 +1255,13 @@ void R4300iOp::SWL() uint32_t Offset, Address, Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 3; + Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) + if (!g_MMU->LW_VAddr((Address & ~3), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1272,11 +1273,11 @@ void R4300iOp::SWL() Value &= SWL_MASK[Offset]; Value += _GPR[m_Opcode.rt].UW[0] >> SWL_SHIFT[Offset]; - if (!g_MMU->SW_VAddr((Address & ~0x03),Value)) + if (!g_MMU->SW_VAddr((Address & ~0x03), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1287,20 +1288,20 @@ void R4300iOp::SWL() void R4300iOp::SW() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, false); } if (g_LogOptions.GenerateLog) { - Log_SW((*_PROGRAM_COUNTER),Address,_GPR[m_Opcode.rt].UW[0]); + Log_SW((*_PROGRAM_COUNTER), Address, _GPR[m_Opcode.rt].UW[0]); } - if (!g_MMU->SW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->SW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1309,13 +1310,13 @@ void R4300iOp::SW() } } -uint64_t SDL_MASK[8] = { 0,0xFF00000000000000, - 0xFFFF000000000000, - 0xFFFFFF0000000000, - 0xFFFFFFFF00000000, - 0xFFFFFFFFFF000000, - 0xFFFFFFFFFFFF0000, - 0xFFFFFFFFFFFFFF00 }; +uint64_t SDL_MASK[8] = { 0, 0xFF00000000000000, +0xFFFF000000000000, +0xFFFFFF0000000000, +0xFFFFFFFF00000000, +0xFFFFFFFFFF000000, +0xFFFFFFFFFFFF0000, +0xFFFFFFFFFFFFFF00 }; int32_t SDL_SHIFT[8] = { 0, 8, 16, 24, 32, 40, 48, 56 }; @@ -1325,13 +1326,13 @@ void R4300iOp::SDL() uint64_t Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 7; + Offset = Address & 7; - if (!g_MMU->LD_VAddr((Address & ~7),Value)) + if (!g_MMU->LD_VAddr((Address & ~7), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1343,11 +1344,11 @@ void R4300iOp::SDL() Value &= SDL_MASK[Offset]; Value += _GPR[m_Opcode.rt].UDW >> SDL_SHIFT[Offset]; - if (!g_MMU->SD_VAddr((Address & ~7),Value)) + if (!g_MMU->SD_VAddr((Address & ~7), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1357,15 +1358,15 @@ void R4300iOp::SDL() } uint64_t SDR_MASK[8] = { 0x00FFFFFFFFFFFFFF, - 0x0000FFFFFFFFFFFF, - 0x000000FFFFFFFFFF, - 0x00000000FFFFFFFF, - 0x0000000000FFFFFF, - 0x000000000000FFFF, - 0x00000000000000FF, - 0x0000000000000000 }; +0x0000FFFFFFFFFFFF, +0x000000FFFFFFFFFF, +0x00000000FFFFFFFF, +0x0000000000FFFFFF, +0x000000000000FFFF, +0x00000000000000FF, +0x0000000000000000 }; -int32_t SDR_SHIFT[8] = { 56,48,40,32,24,16,8,0 }; +int32_t SDR_SHIFT[8] = { 56, 48, 40, 32, 24, 16, 8, 0 }; void R4300iOp::SDR() { @@ -1373,13 +1374,13 @@ void R4300iOp::SDR() uint64_t Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 7; + Offset = Address & 7; - if (!g_MMU->LD_VAddr((Address & ~7),Value)) + if (!g_MMU->LD_VAddr((Address & ~7), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1391,11 +1392,11 @@ void R4300iOp::SDR() Value &= SDR_MASK[Offset]; Value += _GPR[m_Opcode.rt].UDW << SDR_SHIFT[Offset]; - if (!g_MMU->SD_VAddr((Address & ~7),Value)) + if (!g_MMU->SD_VAddr((Address & ~7), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1409,13 +1410,13 @@ void R4300iOp::SWR() uint32_t Offset, Address, Value; Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; - Offset = Address & 3; + Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) + if (!g_MMU->LW_VAddr((Address & ~3), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1427,11 +1428,11 @@ void R4300iOp::SWR() Value &= SWR_MASK[Offset]; Value += _GPR[m_Opcode.rt].UW[0] << SWR_SHIFT[Offset]; - if (!g_MMU->SW_VAddr((Address & ~0x03),Value)) + if (!g_MMU->SW_VAddr((Address & ~0x03), Value)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1446,18 +1447,18 @@ void R4300iOp::CACHE() { return; } - LogMessage("%08X: Cache operation %d, 0x%08X", (*_PROGRAM_COUNTER), m_Opcode.rt, _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset ); + LogMessage("%08X: Cache operation %d, 0x%08X", (*_PROGRAM_COUNTER), m_Opcode.rt, _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset); } void R4300iOp::LL() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->LW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { if (bShowTLBMisses()) { @@ -1474,35 +1475,35 @@ void R4300iOp::LL() void R4300iOp::LWC1() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (uint32_t)((int16_t)m_Opcode.offset); + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (uint32_t)((int16_t)m_Opcode.offset); TEST_COP1_USABLE_EXCEPTION if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LW_VAddr(Address,*(uint32_t *)_FPR_S[m_Opcode.ft])) + if (!g_MMU->LW_VAddr(Address, *(uint32_t *)_FPR_S[m_Opcode.ft])) + { + if (bShowTLBMisses()) { - if (bShowTLBMisses()) - { - g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); - } - TLB_READ_EXCEPTION(Address); + g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); } + TLB_READ_EXCEPTION(Address); + } } void R4300iOp::SC() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, false); } - Log_SW((*_PROGRAM_COUNTER),Address,_GPR[m_Opcode.rt].UW[0]); + Log_SW((*_PROGRAM_COUNTER), Address, _GPR[m_Opcode.rt].UW[0]); if ((*_LLBit) == 1) { - if (!g_MMU->SW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + if (!g_MMU->SW_VAddr(Address, _GPR[m_Opcode.rt].UW[0])) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); if (bShowTLBMisses()) { g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); @@ -1514,16 +1515,16 @@ void R4300iOp::SC() void R4300iOp::LD() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LD_VAddr(Address,_GPR[m_Opcode.rt].UDW)) + if (!g_MMU->LD_VAddr(Address, _GPR[m_Opcode.rt].UDW)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1541,82 +1542,82 @@ void R4300iOp::LD() void R4300iOp::LDC1() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; TEST_COP1_USABLE_EXCEPTION if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address, true); } - if (!g_MMU->LD_VAddr(Address,*(uint64_t *)_FPR_D[m_Opcode.ft])) + if (!g_MMU->LD_VAddr(Address, *(uint64_t *)_FPR_D[m_Opcode.ft])) + { + if (bHaveDebugger()) { - if (bHaveDebugger()) - { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } - if (bShowTLBMisses()) - { - g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); - } + g_Notify->BreakPoint(__FILEW__, __LINE__); } + if (bShowTLBMisses()) + { + g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); + } + } } void R4300iOp::SWC1() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; TEST_COP1_USABLE_EXCEPTION if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address, false); } - if (!g_MMU->SW_VAddr(Address,*(uint32_t *)_FPR_S[m_Opcode.ft])) + if (!g_MMU->SW_VAddr(Address, *(uint32_t *)_FPR_S[m_Opcode.ft])) + { + if (bHaveDebugger()) { - if (bHaveDebugger()) - { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } - if (bShowTLBMisses()) - { - g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); - } + g_Notify->BreakPoint(__FILEW__, __LINE__); } + if (bShowTLBMisses()) + { + g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); + } + } } void R4300iOp::SDC1() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; TEST_COP1_USABLE_EXCEPTION if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address, false); } - if (!g_MMU->SD_VAddr(Address,*(int64_t *)_FPR_D[m_Opcode.ft])) + if (!g_MMU->SD_VAddr(Address, *(int64_t *)_FPR_D[m_Opcode.ft])) + { + if (bHaveDebugger()) { - if (bHaveDebugger()) - { - g_Notify->BreakPoint(__FILEW__,__LINE__); - } - if (bShowTLBMisses()) - { - g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); - } + g_Notify->BreakPoint(__FILEW__, __LINE__); } + if (bShowTLBMisses()) + { + g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str()); + } + } } void R4300iOp::SD() { - uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; + uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address, false); } - if (!g_MMU->SD_VAddr(Address,_GPR[m_Opcode.rt].UDW)) + if (!g_MMU->SD_VAddr(Address, _GPR[m_Opcode.rt].UDW)) { if (bHaveDebugger()) { - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__, __LINE__); } if (bShowTLBMisses()) { @@ -1739,7 +1740,7 @@ void R4300iOp::SPECIAL_MULTU() void R4300iOp::SPECIAL_DIV() { - if ( _GPR[m_Opcode.rt].UDW != 0 ) + if (_GPR[m_Opcode.rt].UDW != 0) { _RegLO->DW = _GPR[m_Opcode.rs].W[0] / _GPR[m_Opcode.rt].W[0]; _RegHI->DW = _GPR[m_Opcode.rs].W[0] % _GPR[m_Opcode.rt].W[0]; @@ -1803,7 +1804,7 @@ void R4300iOp::SPECIAL_DMULTU() void R4300iOp::SPECIAL_DDIV() { - if ( _GPR[m_Opcode.rt].UDW != 0 ) + if (_GPR[m_Opcode.rt].UDW != 0) { _RegLO->DW = _GPR[m_Opcode.rs].DW / _GPR[m_Opcode.rt].DW; _RegHI->DW = _GPR[m_Opcode.rs].DW % _GPR[m_Opcode.rt].DW; @@ -1819,7 +1820,7 @@ void R4300iOp::SPECIAL_DDIV() void R4300iOp::SPECIAL_DDIVU() { - if ( _GPR[m_Opcode.rt].UDW != 0 ) + if (_GPR[m_Opcode.rt].UDW != 0) { _RegLO->UDW = _GPR[m_Opcode.rs].UDW / _GPR[m_Opcode.rt].UDW; _RegHI->UDW = _GPR[m_Opcode.rs].UDW % _GPR[m_Opcode.rt].UDW; @@ -1865,7 +1866,7 @@ void R4300iOp::SPECIAL_OR() if (m_Opcode.rd == 29) { StackValue = _GPR[m_Opcode.rd].W[0]; - } +} #endif } @@ -1970,7 +1971,7 @@ void R4300iOp::REGIMM_BLTZ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -1990,7 +1991,7 @@ void R4300iOp::REGIMM_BGEZ() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -2010,7 +2011,7 @@ void R4300iOp::REGIMM_BLTZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -2031,7 +2032,7 @@ void R4300iOp::REGIMM_BGEZL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -2052,7 +2053,7 @@ void R4300iOp::REGIMM_BLTZAL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -2062,7 +2063,7 @@ void R4300iOp::REGIMM_BLTZAL() { m_JumpToLocation = (*_PROGRAM_COUNTER) + 8; } - _GPR[31].DW= (int32_t)((*_PROGRAM_COUNTER) + 8); + _GPR[31].DW = (int32_t)((*_PROGRAM_COUNTER) + 8); } void R4300iOp::REGIMM_BGEZAL() @@ -2073,7 +2074,7 @@ void R4300iOp::REGIMM_BGEZAL() m_JumpToLocation = (*_PROGRAM_COUNTER) + ((int16_t)m_Opcode.offset << 2) + 4; if ((*_PROGRAM_COUNTER) == m_JumpToLocation) { - if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER),m_Opcode.rs,0)) + if (!DelaySlotEffectsCompare((*_PROGRAM_COUNTER), m_Opcode.rs, 0)) { CInterpreterCPU::InPermLoop(); } @@ -2104,10 +2105,10 @@ void R4300iOp::COP0_MT() { if (g_LogOptions.LogCP0changes) { - LogMessage("%08X: Writing 0x%X to %s register (Originally: 0x%08X)",(*_PROGRAM_COUNTER), _GPR[m_Opcode.rt].UW[0],CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); + LogMessage("%08X: Writing 0x%X to %s register (Originally: 0x%08X)", (*_PROGRAM_COUNTER), _GPR[m_Opcode.rt].UW[0], CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); if (m_Opcode.rd == 11) //Compare { - LogMessage("%08X: Cause register changed from %08X to %08X",(*_PROGRAM_COUNTER), g_Reg->CAUSE_REGISTER, (g_Reg->CAUSE_REGISTER & ~CAUSE_IP7)); + LogMessage("%08X: Cause register changed from %08X to %08X", (*_PROGRAM_COUNTER), g_Reg->CAUSE_REGISTER, (g_Reg->CAUSE_REGISTER & ~CAUSE_IP7)); } } @@ -2198,7 +2199,7 @@ void R4300iOp::COP0_CO_TLBWR() { return; } - g_TLB->WriteEntry(g_Reg->RANDOM_REGISTER & 0x1F,true); + g_TLB->WriteEntry(g_Reg->RANDOM_REGISTER & 0x1F, true); } void R4300iOp::COP0_CO_TLBP() @@ -2252,7 +2253,7 @@ void R4300iOp::COP1_CF() } return; } - _GPR[m_Opcode.rt].DW = (int32_t)_FPCR[m_Opcode.fs]; + _GPR[m_Opcode.rt].DW = (int32_t)_FPCR[m_Opcode.fs]; } void R4300iOp::COP1_MT() @@ -2281,10 +2282,10 @@ void R4300iOp::COP1_CT() } return; } - if (bHaveDebugger()) - { - g_Notify->DisplayError(L"CTC1 what register are you writing to ?"); - } + if (bHaveDebugger()) + { + g_Notify->DisplayError(L"CTC1 what register are you writing to ?"); + } } /************************* COP1: BC1 functions ***********************/ @@ -2346,15 +2347,15 @@ void R4300iOp::COP1_BCTL() } } /************************** COP1: S functions ************************/ -__inline void Float_RoundToInteger32( int32_t * Dest, float * Source ) +__inline void Float_RoundToInteger32(int32_t * Dest, float * Source) { #ifdef _M_IX86 _asm { mov esi, [Source] - mov edi, [Dest] - fld dword ptr [esi] - fistp dword ptr [edi] + mov edi, [Dest] + fld dword ptr[esi] + fistp dword ptr[edi] } #else __m128 xmm; @@ -2362,17 +2363,17 @@ __inline void Float_RoundToInteger32( int32_t * Dest, float * Source ) xmm = _mm_load_ss(Source); *(Dest) = _mm_cvt_ss2si(xmm); #endif -} + } -__inline void Float_RoundToInteger64( int64_t * Dest, float * Source ) +__inline void Float_RoundToInteger64(int64_t * Dest, float * Source) { #ifdef _M_IX86 _asm { mov esi, [Source] - mov edi, [Dest] - fld dword ptr [esi] - fistp qword ptr [edi] + mov edi, [Dest] + fld dword ptr[esi] + fistp qword ptr[edi] } #else __m128 xmm; @@ -2380,53 +2381,53 @@ __inline void Float_RoundToInteger64( int64_t * Dest, float * Source ) xmm = _mm_load_ss(Source); *(Dest) = _mm_cvtss_si64(xmm); #endif -} + } void R4300iOp::COP1_S_ADD() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] + *(float *)_FPR_S[m_Opcode.ft]); } void R4300iOp::COP1_S_SUB() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] - *(float *)_FPR_S[m_Opcode.ft]); } void R4300iOp::COP1_S_MUL() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] * *(float *)_FPR_S[m_Opcode.ft]); } void R4300iOp::COP1_S_DIV() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] / *(float *)_FPR_S[m_Opcode.ft]); } void R4300iOp::COP1_S_SQRT() { - float * Dest = (float *)(_FPR_S[m_Opcode.fd]); + float * Dest = (float *)(_FPR_S[m_Opcode.fd]); float * Source = (float *)(_FPR_S[m_Opcode.fs]); TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); #ifdef _M_IX86 _asm { push esi - mov esi, dword ptr [Source] - fld dword ptr [esi] - fsqrt - mov esi, dword ptr [Dest] - fstp dword ptr [esi] - pop esi + mov esi, dword ptr[Source] + fld dword ptr[esi] + fsqrt + mov esi, dword ptr[Dest] + fstp dword ptr[esi] + pop esi } #else __m128 xmm; @@ -2435,97 +2436,97 @@ void R4300iOp::COP1_S_SQRT() xmm = _mm_sqrt_ss(xmm); *(Dest) = _mm_cvtss_f32(xmm); #endif -} + } void R4300iOp::COP1_S_ABS() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (float)fabs(*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_MOV() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = *(float *)_FPR_S[m_Opcode.fs]; } void R4300iOp::COP1_S_NEG() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] * -1.0f); } void R4300iOp::COP1_S_TRUNC_L() { TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_CHOP,_MCW_RC); - Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_CHOP, _MCW_RC); + Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_CEIL_L() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_UP,_MCW_RC); - Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_UP, _MCW_RC); + Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_FLOOR_L() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_DOWN,_MCW_RC); - Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_DOWN, _MCW_RC); + Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_ROUND_W() { TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_NEAR,_MCW_RC); - Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_NEAR, _MCW_RC); + Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_TRUNC_W() { TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_CHOP,_MCW_RC); - Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_CHOP, _MCW_RC); + Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_CEIL_W() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_UP,_MCW_RC); - Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_UP, _MCW_RC); + Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_FLOOR_W() { TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_DOWN,_MCW_RC); - Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_DOWN, _MCW_RC); + Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_CVT_D() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = (double)(*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_CVT_W() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); - Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(*_RoundingModel, _MCW_RC); + Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_CVT_L() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); - Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd],&*(float *)_FPR_S[m_Opcode.fs]); + _controlfp(*_RoundingModel, _MCW_RC); + Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_S_CMP() @@ -2552,7 +2553,7 @@ void R4300iOp::COP1_S_CMP() { if (bHaveDebugger()) { - g_Notify->DisplayError(stdstr_f("Signal InvalidOperationException\nin r4300i_COP1_S_CMP\n%X %ff\n%X %ff", Temp0,Temp0,Temp1,Temp1).ToUTF16().c_str()); + g_Notify->DisplayError(stdstr_f("Signal InvalidOperationException\nin r4300i_COP1_S_CMP\n%X %ff\n%X %ff", Temp0, Temp0, Temp1, Temp1).ToUTF16().c_str()); } } } @@ -2577,15 +2578,15 @@ void R4300iOp::COP1_S_CMP() } /************************** COP1: D functions ************************/ -__inline void Double_RoundToInteger32( uint32_t * Dest, double * Source ) +__inline void Double_RoundToInteger32(uint32_t * Dest, double * Source) { #ifdef _M_IX86 _asm { mov esi, [Source] - mov edi, [Dest] - fld qword ptr [esi] - fistp dword ptr [edi] + mov edi, [Dest] + fld qword ptr[esi] + fistp dword ptr[edi] } #else __m128d xmm; @@ -2593,17 +2594,17 @@ __inline void Double_RoundToInteger32( uint32_t * Dest, double * Source ) xmm = _mm_load_sd(Source); *(Dest) = _mm_cvtsd_si32(xmm); #endif -} + } -__inline void Double_RoundToInteger64( uint64_t * Dest, double * Source ) +__inline void Double_RoundToInteger64(uint64_t * Dest, double * Source) { #ifdef _M_IX86 _asm { mov esi, [Source] - mov edi, [Dest] - fld qword ptr [esi] - fistp qword ptr [edi] + mov edi, [Dest] + fld qword ptr[esi] + fistp qword ptr[edi] } #else __m128d xmm; @@ -2611,132 +2612,132 @@ __inline void Double_RoundToInteger64( uint64_t * Dest, double * Source ) xmm = _mm_load_sd(Source); *(Dest) = _mm_cvtsd_si64(xmm); #endif -} + } void R4300iOp::COP1_D_ADD() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] + *(double *)_FPR_D[m_Opcode.ft]; } void R4300iOp::COP1_D_SUB() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] - *(double *)_FPR_D[m_Opcode.ft]; } void R4300iOp::COP1_D_MUL() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] * *(double *)_FPR_D[m_Opcode.ft]; } void R4300iOp::COP1_D_DIV() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] / *(double *)_FPR_D[m_Opcode.ft]; } void R4300iOp::COP1_D_SQRT() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = (double)sqrt(*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_ABS() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = fabs(*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_MOV() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(int64_t *)_FPR_D[m_Opcode.fd] = *(int64_t *)_FPR_D[m_Opcode.fs]; } void R4300iOp::COP1_D_NEG() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = (*(double *)_FPR_D[m_Opcode.fs] * -1.0); } void R4300iOp::COP1_D_TRUNC_L() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(RC_CHOP,_MCW_RC); - Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd],&*(double *)_FPR_D[m_Opcode.fs] ); + _controlfp(RC_CHOP, _MCW_RC); + Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_CEIL_L() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(RC_UP,_MCW_RC); - Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd],&*(double *)_FPR_D[m_Opcode.fs] ); + _controlfp(RC_UP, _MCW_RC); + Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_FLOOR_L() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_DOWN,_MCW_RC); - Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd],&*(double *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_DOWN, _MCW_RC); + Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_D_ROUND_W() { TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_NEAR,_MCW_RC); - Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd],&*(double *)_FPR_D[m_Opcode.fs] ); + _controlfp(_RC_NEAR, _MCW_RC); + Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_TRUNC_W() { TEST_COP1_USABLE_EXCEPTION - _controlfp(RC_CHOP,_MCW_RC); - Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd],&*(double *)_FPR_D[m_Opcode.fs] ); + _controlfp(RC_CHOP, _MCW_RC); + Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_CEIL_W() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(RC_UP,_MCW_RC); - Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd],&*(double *)_FPR_D[m_Opcode.fs] ); + _controlfp(RC_UP, _MCW_RC); + Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_FLOOR_W() { //added by Witten TEST_COP1_USABLE_EXCEPTION - _controlfp(_RC_DOWN,_MCW_RC); - Double_RoundToInteger32(&*(uint32_t *)_FPR_D[m_Opcode.fd],&*(double *)_FPR_S[m_Opcode.fs]); + _controlfp(_RC_DOWN, _MCW_RC); + Double_RoundToInteger32(&*(uint32_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_S[m_Opcode.fs]); } void R4300iOp::COP1_D_CVT_S() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (float)*(double *)_FPR_D[m_Opcode.fs]; } void R4300iOp::COP1_D_CVT_W() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); - Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd],&*(double *)_FPR_D[m_Opcode.fs] ); + _controlfp(*_RoundingModel, _MCW_RC); + Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_CVT_L() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); - Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd],&*(double *)_FPR_D[m_Opcode.fs]); + _controlfp(*_RoundingModel, _MCW_RC); + Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); } void R4300iOp::COP1_D_CMP() @@ -2791,14 +2792,14 @@ void R4300iOp::COP1_D_CMP() void R4300iOp::COP1_W_CVT_S() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (float)*(int32_t *)_FPR_S[m_Opcode.fs]; } void R4300iOp::COP1_W_CVT_D() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = (double)*(int32_t *)_FPR_S[m_Opcode.fs]; } @@ -2806,14 +2807,14 @@ void R4300iOp::COP1_W_CVT_D() void R4300iOp::COP1_L_CVT_S() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(float *)_FPR_S[m_Opcode.fd] = (float)*(int64_t *)_FPR_D[m_Opcode.fs]; } void R4300iOp::COP1_L_CVT_D() { TEST_COP1_USABLE_EXCEPTION - _controlfp(*_RoundingModel,_MCW_RC); + _controlfp(*_RoundingModel, _MCW_RC); *(double *)_FPR_D[m_Opcode.fd] = (double)*(int64_t *)_FPR_D[m_Opcode.fs]; } @@ -2821,10 +2822,10 @@ void R4300iOp::COP1_L_CVT_D() void R4300iOp::UnknownOpcode() { g_Notify->DisplayError(stdstr_f("%s: %08X\n%s\n\nStopping Emulation !", GS(MSG_UNHANDLED_OP), (*_PROGRAM_COUNTER), - R4300iOpcodeName(m_Opcode.Hex,(*_PROGRAM_COUNTER))).ToUTF16().c_str()); + R4300iOpcodeName(m_Opcode.Hex, (*_PROGRAM_COUNTER))).ToUTF16().c_str()); g_System->m_EndEmulation = true; - g_Notify->BreakPoint(__FILEW__,__LINE__); + g_Notify->BreakPoint(__FILEW__,__LINE__); #ifdef tofix if (HaveDebugger && !inFullScreen) { @@ -2838,6 +2839,6 @@ void R4300iOp::UnknownOpcode() Enter_R4300i_Commands_Window (); } ExitThread(0); - } -#endif } +#endif +} \ No newline at end of file diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index b732877be..05707b241 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -9,271 +9,270 @@ * * ****************************************************************************/ #include "stdafx.h" +#include int CPifRamSettings::m_RefCount = 0; bool CPifRamSettings::m_bShowPifRamErrors = false; CPifRamSettings::CPifRamSettings() { - m_RefCount += 1; - if (m_RefCount == 1) - { - g_Settings->RegisterChangeCB(Debugger_ShowPifErrors,NULL,RefreshSettings); - RefreshSettings(NULL); - } + m_RefCount += 1; + if (m_RefCount == 1) + { + g_Settings->RegisterChangeCB(Debugger_ShowPifErrors, NULL, RefreshSettings); + RefreshSettings(NULL); + } } CPifRamSettings::~CPifRamSettings() { - m_RefCount -= 1; - if (m_RefCount == 0) - { - g_Settings->UnregisterChangeCB(Debugger_ShowPifErrors,NULL,RefreshSettings); - } + m_RefCount -= 1; + if (m_RefCount == 0) + { + g_Settings->UnregisterChangeCB(Debugger_ShowPifErrors, NULL, RefreshSettings); + } } void CPifRamSettings::RefreshSettings(void *) { - m_bShowPifRamErrors = g_Settings->LoadBool(Debugger_ShowPifErrors); + m_bShowPifRamErrors = g_Settings->LoadBool(Debugger_ShowPifErrors); } -CPifRam::CPifRam( bool SavesReadOnly ) : - CEeprom(SavesReadOnly) +CPifRam::CPifRam(bool SavesReadOnly) : +CEeprom(SavesReadOnly) { - Reset(); + Reset(); } CPifRam::~CPifRam() { - } void CPifRam::Reset() { - memset(m_PifRam,0,sizeof(m_PifRam)); - memset(m_PifRom,0,sizeof(m_PifRom)); + memset(m_PifRam, 0, sizeof(m_PifRam)); + memset(m_PifRom, 0, sizeof(m_PifRom)); } void CPifRam::n64_cic_nus_6105(char challenge[], char respone[], int length) { - static char lut0[0x10] = { - 0x4, 0x7, 0xA, 0x7, 0xE, 0x5, 0xE, 0x1, - 0xC, 0xF, 0x8, 0xF, 0x6, 0x3, 0x6, 0x9 - }; - static char lut1[0x10] = { - 0x4, 0x1, 0xA, 0x7, 0xE, 0x5, 0xE, 0x1, - 0xC, 0x9, 0x8, 0x5, 0x6, 0x3, 0xC, 0x9 - }; - char key, *lut; - int i, sgn, mag, mod; + static char lut0[0x10] = { + 0x4, 0x7, 0xA, 0x7, 0xE, 0x5, 0xE, 0x1, + 0xC, 0xF, 0x8, 0xF, 0x6, 0x3, 0x6, 0x9 + }; + static char lut1[0x10] = { + 0x4, 0x1, 0xA, 0x7, 0xE, 0x5, 0xE, 0x1, + 0xC, 0x9, 0x8, 0x5, 0x6, 0x3, 0xC, 0x9 + }; + char key, *lut; + int i, sgn, mag, mod; - for (key = 0xB, lut = lut0, i = 0; i < length; i++) - { - respone[i] = (key + 5 * challenge[i]) & 0xF; - key = lut[respone[i]]; - sgn = (respone[i] >> 3) & 0x1; - mag = ((sgn == 1) ? ~respone[i] : respone[i]) & 0x7; - mod = (mag % 3 == 1) ? sgn : 1 - sgn; - if (lut == lut1 && (respone[i] == 0x1 || respone[i] == 0x9)) - { - mod = 1; - } - if (lut == lut1 && (respone[i] == 0xB || respone[i] == 0xE)) - { - mod = 0; - } - lut = (mod == 1) ? lut1 : lut0; - } + for (key = 0xB, lut = lut0, i = 0; i < length; i++) + { + respone[i] = (key + 5 * challenge[i]) & 0xF; + key = lut[respone[i]]; + sgn = (respone[i] >> 3) & 0x1; + mag = ((sgn == 1) ? ~respone[i] : respone[i]) & 0x7; + mod = (mag % 3 == 1) ? sgn : 1 - sgn; + if (lut == lut1 && (respone[i] == 0x1 || respone[i] == 0x9)) + { + mod = 1; + } + if (lut == lut1 && (respone[i] == 0xB || respone[i] == 0xE)) + { + mod = 0; + } + lut = (mod == 1) ? lut1 : lut0; + } } - void CPifRam::PifRamRead() { - if (m_PifRam[0x3F] == 0x2) - { - return; - } + if (m_PifRam[0x3F] == 0x2) + { + return; + } - CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); + CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); - int Channel = 0; - for (int CurPos = 0; CurPos < 0x40; CurPos ++) - { - switch (m_PifRam[CurPos]) - { - case 0x00: - Channel += 1; - if (Channel > 6) - { - CurPos = 0x40; - } - break; - case 0xFE: CurPos = 0x40; break; - case 0xFF: break; - case 0xB4: case 0x56: case 0xB8: break; /* ??? */ - default: - if ((m_PifRam[CurPos] & 0xC0) == 0) - { - if (Channel < 4) - { - if (Controllers[Channel].Present && Controllers[Channel].RawData) - { - if (g_Plugins->Control()->ReadController) - { - g_Plugins->Control()->ReadController(Channel,&m_PifRam[CurPos]); - } - } - else - { - ReadControllerCommand(Channel,&m_PifRam[CurPos]); - } - } - CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1; - Channel += 1; - } - else - { - if (bShowPifRamErrors()) - { - g_Notify->DisplayError(stdstr_f("Unknown Command in PifRamRead(%X)",m_PifRam[CurPos]).ToUTF16().c_str()); - } - CurPos = 0x40; - } - break; - } - } - if (g_Plugins->Control()->ReadController) - { - g_Plugins->Control()->ReadController(-1,NULL); - } + int Channel = 0; + for (int CurPos = 0; CurPos < 0x40; CurPos++) + { + switch (m_PifRam[CurPos]) + { + case 0x00: + Channel += 1; + if (Channel > 6) + { + CurPos = 0x40; + } + break; + case 0xFE: CurPos = 0x40; break; + case 0xFF: break; + case 0xB4: case 0x56: case 0xB8: break; /* ??? */ + default: + if ((m_PifRam[CurPos] & 0xC0) == 0) + { + if (Channel < 4) + { + if (Controllers[Channel].Present && Controllers[Channel].RawData) + { + if (g_Plugins->Control()->ReadController) + { + g_Plugins->Control()->ReadController(Channel, &m_PifRam[CurPos]); + } + } + else + { + ReadControllerCommand(Channel, &m_PifRam[CurPos]); + } + } + CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1; + Channel += 1; + } + else + { + if (bShowPifRamErrors()) + { + g_Notify->DisplayError(stdstr_f("Unknown Command in PifRamRead(%X)", m_PifRam[CurPos]).ToUTF16().c_str()); + } + CurPos = 0x40; + } + break; + } + } + if (g_Plugins->Control()->ReadController) + { + g_Plugins->Control()->ReadController(-1, NULL); + } } void CPifRam::PifRamWrite() { - CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); - int Channel = 0, CurPos; + CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); + int Channel = 0, CurPos; - if ( m_PifRam[0x3F] > 0x1) - { - switch (m_PifRam[0x3F]) - { - case 0x02: - // format the 'challenge' message into 30 nibbles for X-Scale's CIC code - { - char Challenge[30], Response[30]; - for (int i = 0; i < 15; i++) - { - Challenge[i*2] = (m_PifRam[48+i] >> 4) & 0x0f; - Challenge[i*2+1] = m_PifRam[48+i] & 0x0f; - } - n64_cic_nus_6105(Challenge, Response, CHALLENGE_LENGTH - 2); - QWORD ResponseValue = 0; - m_PifRam[46] = m_PifRam[47] = 0x00; - for (int z = 8; z > 0; z--) - { - ResponseValue = (ResponseValue << 8) | ((Response[(z - 1)*2] << 4) + Response[(z - 1)*2+1]); - } - 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]); - } - std::memcpy(&m_PifRam[56], &ResponseValue, sizeof(QWORD)); - } - break; - case 0x08: - m_PifRam[0x3F] = 0; - g_Reg->MI_INTR_REG |= MI_INTR_SI; - g_Reg->SI_STATUS_REG |= SI_STATUS_INTERRUPT; - g_Reg->CheckInterrupts(); - break; - case 0x10: - memset(m_PifRom,0,0x7C0); - break; - case 0x30: - m_PifRam[0x3F] = 0x80; - break; - case 0xC0: - memset(m_PifRam,0,0x40); - break; - default: - if (bShowPifRamErrors()) - { - g_Notify->DisplayError(stdstr_f("Unkown PifRam control: %d",m_PifRam[0x3F]).ToUTF16().c_str()); - } - } - return; - } + if (m_PifRam[0x3F] > 0x1) + { + switch (m_PifRam[0x3F]) + { + case 0x02: + // format the 'challenge' message into 30 nibbles for X-Scale's CIC code + { + char Challenge[30], Response[30]; + for (int i = 0; i < 15; i++) + { + Challenge[i * 2] = (m_PifRam[48 + i] >> 4) & 0x0f; + Challenge[i * 2 + 1] = m_PifRam[48 + i] & 0x0f; + } + n64_cic_nus_6105(Challenge, Response, CHALLENGE_LENGTH - 2); + QWORD ResponseValue = 0; + m_PifRam[46] = m_PifRam[47] = 0x00; + for (int z = 8; z > 0; z--) + { + ResponseValue = (ResponseValue << 8) | ((Response[(z - 1) * 2] << 4) + Response[(z - 1) * 2 + 1]); + } + 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]); + } + std::memcpy(&m_PifRam[56], &ResponseValue, sizeof(QWORD)); + } + break; + case 0x08: + m_PifRam[0x3F] = 0; + g_Reg->MI_INTR_REG |= MI_INTR_SI; + g_Reg->SI_STATUS_REG |= SI_STATUS_INTERRUPT; + g_Reg->CheckInterrupts(); + break; + case 0x10: + memset(m_PifRom, 0, 0x7C0); + break; + case 0x30: + m_PifRam[0x3F] = 0x80; + break; + case 0xC0: + memset(m_PifRam, 0, 0x40); + break; + default: + if (bShowPifRamErrors()) + { + g_Notify->DisplayError(stdstr_f("Unkown PifRam control: %d", m_PifRam[0x3F]).ToUTF16().c_str()); + } + } + return; + } - for (CurPos = 0; CurPos < 0x40; CurPos++) - { - switch (m_PifRam[CurPos]) - { - case 0x00: - Channel += 1; - if (Channel > 6) - { - CurPos = 0x40; - } - break; - case 0xFE: CurPos = 0x40; break; - case 0xFF: break; - case 0xB4: case 0x56: case 0xB8: break; /* ??? */ - default: - if ((m_PifRam[CurPos] & 0xC0) == 0) - { - if (Channel < 4) - { - if (Controllers[Channel].Present && Controllers[Channel].RawData) - { - if (g_Plugins->Control()->ControllerCommand) - { - g_Plugins->Control()->ControllerCommand(Channel,&m_PifRam[CurPos]); - } - } - else - { - ProcessControllerCommand(Channel,&m_PifRam[CurPos]); - } - } - else if (Channel == 4) - { - EepromCommand(&m_PifRam[CurPos]); - } - else - { - if (bShowPifRamErrors()) - { - g_Notify->DisplayError(L"Command on channel 5?"); - } - } - CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1; - Channel += 1; - } - else - { - if (bShowPifRamErrors()) - { - g_Notify->DisplayError(stdstr_f("Unknown Command in PifRamWrite(%X)",m_PifRam[CurPos]).ToUTF16().c_str()); - } - CurPos = 0x40; - } - break; - } - } - m_PifRam[0x3F] = 0; - if (g_Plugins->Control()->ControllerCommand) - { - g_Plugins->Control()->ControllerCommand(-1,NULL); - } + for (CurPos = 0; CurPos < 0x40; CurPos++) + { + switch (m_PifRam[CurPos]) + { + case 0x00: + Channel += 1; + if (Channel > 6) + { + CurPos = 0x40; + } + break; + case 0xFE: CurPos = 0x40; break; + case 0xFF: break; + case 0xB4: case 0x56: case 0xB8: break; /* ??? */ + default: + if ((m_PifRam[CurPos] & 0xC0) == 0) + { + if (Channel < 4) + { + if (Controllers[Channel].Present && Controllers[Channel].RawData) + { + if (g_Plugins->Control()->ControllerCommand) + { + g_Plugins->Control()->ControllerCommand(Channel, &m_PifRam[CurPos]); + } + } + else + { + ProcessControllerCommand(Channel, &m_PifRam[CurPos]); + } + } + else if (Channel == 4) + { + EepromCommand(&m_PifRam[CurPos]); + } + else + { + if (bShowPifRamErrors()) + { + g_Notify->DisplayError(L"Command on channel 5?"); + } + } + CurPos += m_PifRam[CurPos] + (m_PifRam[CurPos + 1] & 0x3F) + 1; + Channel += 1; + } + else + { + if (bShowPifRamErrors()) + { + g_Notify->DisplayError(stdstr_f("Unknown Command in PifRamWrite(%X)", m_PifRam[CurPos]).ToUTF16().c_str()); + } + CurPos = 0x40; + } + break; + } + } + m_PifRam[0x3F] = 0; + if (g_Plugins->Control()->ControllerCommand) + { + g_Plugins->Control()->ControllerCommand(-1, NULL); + } } -void CPifRam::SI_DMA_READ() +void CPifRam::SI_DMA_READ() { - BYTE * PifRamPos = m_PifRam; - BYTE * RDRAM = g_MMU->Rdram(); - + BYTE * PifRamPos = m_PifRam; + BYTE * RDRAM = g_MMU->Rdram(); + uint32_t & SI_DRAM_ADDR_REG = (uint32_t &)g_Reg->SI_DRAM_ADDR_REG; if ((int32_t)SI_DRAM_ADDR_REG > (int32_t)g_System->RdramSize()) { @@ -302,9 +301,9 @@ void CPifRam::SI_DMA_READ() } else { - for (size_t i = 0; i < 64; i++) - { - RDRAM[(SI_DRAM_ADDR_REG + i) ^ 3] = PifRamPos[i]; + for (size_t i = 0; i < 64; i++) + { + RDRAM[(SI_DRAM_ADDR_REG + i) ^ 3] = PifRamPos[i]; } } @@ -314,31 +313,31 @@ void CPifRam::SI_DMA_READ() char HexData[100], AsciiData[100], Addon[20]; LogMessage("\tData DMAed to RDRAM:"); LogMessage("\t--------------------"); - for (count = 0; count < 16; count ++ ) + for (count = 0; count < 16; count++) { if ((count % 4) == 0) { - sprintf(HexData,"\0"); - sprintf(AsciiData,"\0"); + sprintf(HexData, "\0"); + sprintf(AsciiData, "\0"); } - sprintf(Addon,"%02X %02X %02X %02X", + sprintf(Addon, "%02X %02X %02X %02X", m_PifRam[(count << 2) + 0], m_PifRam[(count << 2) + 1], - m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3] ); - strcat(HexData,Addon); + m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3]); + strcat(HexData, Addon); if (((count + 1) % 4) != 0) { - sprintf(Addon,"-"); - strcat(HexData,Addon); + sprintf(Addon, "-"); + strcat(HexData, Addon); } - sprintf(Addon,"%c%c%c%c", + sprintf(Addon, "%c%c%c%c", m_PifRam[(count << 2) + 0], m_PifRam[(count << 2) + 1], - m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3] ); - strcat(AsciiData,Addon); + m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3]); + strcat(AsciiData, Addon); if (((count + 1) % 4) == 0) { - LogMessage("\t%s %s",HexData, AsciiData); + LogMessage("\t%s %s", HexData, AsciiData); } } LogMessage(""); @@ -388,9 +387,9 @@ void CPifRam::SI_DMA_WRITE() } else { - for (size_t i = 0; i < 64; i++) + for (size_t i = 0; i < 64; i++) { - PifRamPos[i] = RDRAM[(SI_DRAM_ADDR_REG + i) ^ 3]; + PifRamPos[i] = RDRAM[(SI_DRAM_ADDR_REG + i) ^ 3]; } } @@ -401,31 +400,31 @@ void CPifRam::SI_DMA_WRITE() LogMessage(""); LogMessage("\tData DMAed to the Pif Ram:"); LogMessage("\t--------------------------"); - for (count = 0; count < 16; count ++ ) + for (count = 0; count < 16; count++) { if ((count % 4) == 0) { - sprintf(HexData,"\0"); - sprintf(AsciiData,"\0"); + sprintf(HexData, "\0"); + sprintf(AsciiData, "\0"); } - sprintf(Addon,"%02X %02X %02X %02X", + sprintf(Addon, "%02X %02X %02X %02X", m_PifRam[(count << 2) + 0], m_PifRam[(count << 2) + 1], - m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3] ); - strcat(HexData,Addon); + m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3]); + strcat(HexData, Addon); if (((count + 1) % 4) != 0) { - sprintf(Addon,"-"); - strcat(HexData,Addon); + sprintf(Addon, "-"); + strcat(HexData, Addon); } - sprintf(Addon,"%c%c%c%c", + sprintf(Addon, "%c%c%c%c", m_PifRam[(count << 2) + 0], m_PifRam[(count << 2) + 1], - m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3] ); - strcat(AsciiData,Addon); + m_PifRam[(count << 2) + 2], m_PifRam[(count << 2) + 3]); + strcat(AsciiData, Addon); if (((count + 1) % 4) == 0) { - LogMessage("\t%s %s",HexData, AsciiData); + LogMessage("\t%s %s", HexData, AsciiData); } } LogMessage(""); @@ -445,237 +444,237 @@ void CPifRam::SI_DMA_WRITE() } } -void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command) +void CPifRam::ProcessControllerCommand(int Control, BYTE * Command) { - CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); + CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); - switch (Command[2]) - { - case 0x00: // check - case 0xFF: // reset & check ? - if ((Command[1] & 0x80) != 0) - { - break; - } - if (bShowPifRamErrors()) - { - if (Command[0] != 1) - { - g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); - } - if (Command[1] != 3) - { - g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); - } - } - if (Controllers[Control].Present == TRUE) - { - Command[3] = 0x05; - Command[4] = 0x00; - switch ( Controllers[Control].Plugin) - { - case PLUGIN_TANSFER_PAK: - case PLUGIN_RUMBLE_PAK: - case PLUGIN_MEMPAK: - case PLUGIN_RAW: - Command[5] = 1; break; - default: Command[5] = 0; break; - } - } - else - { - Command[1] |= 0x80; - } - break; - case 0x01: // read controller - if (bShowPifRamErrors()) - { - 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"); - } - } - if (Controllers[Control].Present == FALSE) - { - Command[1] |= 0x80; - } - break; - case 0x02: //read from controller pack - if (g_LogOptions.LogControllerPak) - { - LogControllerPakData("Read: Before Gettting Results"); - } - if (bShowPifRamErrors()) - { - if (Command[0] != 3) - { - g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); - } - if (Command[1] != 33) - { - g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); - } - } - if (Controllers[Control].Present == TRUE) - { - switch (Controllers[Control].Plugin) - { - case PLUGIN_RUMBLE_PAK: Rumblepak::ReadFrom(Command); break; - case PLUGIN_MEMPAK: Mempak::ReadFrom(Control, Command); break; - case PLUGIN_TANSFER_PAK: /* TODO */; break; - case PLUGIN_RAW: if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Control, Command); } break; - default: - memset(&Command[5], 0, 0x20); - } + switch (Command[2]) + { + case 0x00: // check + case 0xFF: // reset & check ? + if ((Command[1] & 0x80) != 0) + { + break; + } + if (bShowPifRamErrors()) + { + if (Command[0] != 1) + { + g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); + } + if (Command[1] != 3) + { + g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); + } + } + if (Controllers[Control].Present == TRUE) + { + Command[3] = 0x05; + Command[4] = 0x00; + switch (Controllers[Control].Plugin) + { + case PLUGIN_TANSFER_PAK: + case PLUGIN_RUMBLE_PAK: + case PLUGIN_MEMPAK: + case PLUGIN_RAW: + Command[5] = 1; break; + default: Command[5] = 0; break; + } + } + else + { + Command[1] |= 0x80; + } + break; + case 0x01: // read controller + if (bShowPifRamErrors()) + { + 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"); + } + } + if (Controllers[Control].Present == FALSE) + { + Command[1] |= 0x80; + } + break; + case 0x02: //read from controller pack + if (g_LogOptions.LogControllerPak) + { + LogControllerPakData("Read: Before Gettting Results"); + } + if (bShowPifRamErrors()) + { + if (Command[0] != 3) + { + g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); + } + if (Command[1] != 33) + { + g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); + } + } + if (Controllers[Control].Present == TRUE) + { + switch (Controllers[Control].Plugin) + { + case PLUGIN_RUMBLE_PAK: Rumblepak::ReadFrom(Command); break; + case PLUGIN_MEMPAK: Mempak::ReadFrom(Control, Command); break; + case PLUGIN_TANSFER_PAK: /* TODO */; break; + case PLUGIN_RAW: if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Control, Command); } break; + default: + memset(&Command[5], 0, 0x20); + } - if (Controllers[Control].Plugin != PLUGIN_RAW) - { - Command[0x25] = Mempak::CalculateCrc(&Command[5]); - } - } - else - { - Command[1] |= 0x80; - } - if (g_LogOptions.LogControllerPak) - { - LogControllerPakData("Read: After Gettting Results"); - } - break; - case 0x03: //write controller pak - if (g_LogOptions.LogControllerPak) - { - LogControllerPakData("Write: Before Processing"); - } - if (bShowPifRamErrors()) - { - if (Command[0] != 35) - { - g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); - } - if (Command[1] != 1) - { - g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); - } - } - if (Controllers[Control].Present == TRUE) - { - switch (Controllers[Control].Plugin) - { - case PLUGIN_MEMPAK: Mempak::WriteTo(Control, Command); break; - case PLUGIN_RUMBLE_PAK: Rumblepak::WriteTo(Control, Command); break; - case PLUGIN_TANSFER_PAK: /* TODO */; break; - case PLUGIN_RAW: if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Control, Command); } break; - } + if (Controllers[Control].Plugin != PLUGIN_RAW) + { + Command[0x25] = Mempak::CalculateCrc(&Command[5]); + } + } + else + { + Command[1] |= 0x80; + } + if (g_LogOptions.LogControllerPak) + { + LogControllerPakData("Read: After Gettting Results"); + } + break; + case 0x03: //write controller pak + if (g_LogOptions.LogControllerPak) + { + LogControllerPakData("Write: Before Processing"); + } + if (bShowPifRamErrors()) + { + if (Command[0] != 35) + { + g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); + } + if (Command[1] != 1) + { + g_Notify->DisplayError(L"What am I meant to do with this Controller Command"); + } + } + if (Controllers[Control].Present == TRUE) + { + switch (Controllers[Control].Plugin) + { + case PLUGIN_MEMPAK: Mempak::WriteTo(Control, Command); break; + case PLUGIN_RUMBLE_PAK: Rumblepak::WriteTo(Control, Command); break; + case PLUGIN_TANSFER_PAK: /* TODO */; break; + case PLUGIN_RAW: if (g_Plugins->Control()->ControllerCommand) { g_Plugins->Control()->ControllerCommand(Control, Command); } break; + } - if (Controllers[Control].Plugin != PLUGIN_RAW) - { - Command[0x25] = Mempak::CalculateCrc(&Command[5]); - } - } - else - { - Command[1] |= 0x80; - } - if (g_LogOptions.LogControllerPak) - { - LogControllerPakData("Write: After Processing"); - } - break; - default: - if (bShowPifRamErrors()) - { - g_Notify->DisplayError(stdstr_f("Unknown ControllerCommand %d",Command[2]).ToUTF16().c_str()); - } - } + if (Controllers[Control].Plugin != PLUGIN_RAW) + { + Command[0x25] = Mempak::CalculateCrc(&Command[5]); + } + } + else + { + Command[1] |= 0x80; + } + if (g_LogOptions.LogControllerPak) + { + LogControllerPakData("Write: After Processing"); + } + break; + default: + if (bShowPifRamErrors()) + { + g_Notify->DisplayError(stdstr_f("Unknown ControllerCommand %d", Command[2]).ToUTF16().c_str()); + } + } } -void CPifRam::ReadControllerCommand (int Control, BYTE * Command) { - CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); +void CPifRam::ReadControllerCommand(int Control, BYTE * Command) { + CONTROL * Controllers = g_Plugins->Control()->PluginControllers(); - switch (Command[2]) - { - case 0x01: // read controller - if (Controllers[Control].Present == TRUE) - { - if (bShowPifRamErrors()) - { - 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"); } - } + switch (Command[2]) + { + case 0x01: // read controller + if (Controllers[Control].Present == TRUE) + { + if (bShowPifRamErrors()) + { + 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"); } + } - const DWORD buttons = g_BaseSystem->GetButtons(Control); - std::memcpy(&Command[3], &buttons, sizeof(DWORD)); - } - break; - case 0x02: //read from controller pack - if (Controllers[Control].Present == TRUE) - { - switch (Controllers[Control].Plugin) - { - case PLUGIN_RAW: if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(Control, Command); } break; - } - } - break; - case 0x03: //write controller pak - if (Controllers[Control].Present == TRUE) - { - switch (Controllers[Control].Plugin) - { - case PLUGIN_RAW: if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(Control, Command); } break; - } - } - break; - } + const DWORD buttons = g_BaseSystem->GetButtons(Control); + std::memcpy(&Command[3], &buttons, sizeof(DWORD)); + } + break; + case 0x02: //read from controller pack + if (Controllers[Control].Present == TRUE) + { + switch (Controllers[Control].Plugin) + { + case PLUGIN_RAW: if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(Control, Command); } break; + } + } + break; + case 0x03: //write controller pak + if (Controllers[Control].Present == TRUE) + { + switch (Controllers[Control].Plugin) + { + case PLUGIN_RAW: if (g_Plugins->Control()->ReadController) { g_Plugins->Control()->ReadController(Control, Command); } break; + } + } + break; + } } -void CPifRam::LogControllerPakData (char * Description) +void CPifRam::LogControllerPakData(char * Description) { - BYTE * PIF_Ram = g_MMU->PifRam(); + BYTE * PIF_Ram = g_MMU->PifRam(); - int count, count2; - char HexData[100], AsciiData[100], Addon[20]; - LogMessage("\t%s:",Description); - LogMessage("\t------------------------------"); - for (count = 0; count < 16; count ++ ) - { - if ((count % 4) == 0) - { - sprintf(HexData,"\0"); - sprintf(AsciiData,"\0"); - } - sprintf(Addon,"%02X %02X %02X %02X", - PIF_Ram[(count << 2) + 0], PIF_Ram[(count << 2) + 1], - PIF_Ram[(count << 2) + 2], PIF_Ram[(count << 2) + 3] ); - strcat(HexData,Addon); - if (((count + 1) % 4) != 0) - { - sprintf(Addon,"-"); - strcat(HexData,Addon); - } - - Addon[0] = 0; - for (count2 = 0; count2 < 4; count2++) - { - if (PIF_Ram[(count << 2) + count2] < 30) - { - strcat(Addon,"."); - } - else - { - sprintf(Addon,"%s%c",Addon,PIF_Ram[(count << 2) + count2]); - } - } - strcat(AsciiData,Addon); - - if (((count + 1) % 4) == 0) - { - LogMessage("\t%s %s",HexData, AsciiData); - } - } - LogMessage(""); -} + int count, count2; + char HexData[100], AsciiData[100], Addon[20]; + LogMessage("\t%s:", Description); + LogMessage("\t------------------------------"); + for (count = 0; count < 16; count++) + { + if ((count % 4) == 0) + { + sprintf(HexData, "\0"); + sprintf(AsciiData, "\0"); + } + sprintf(Addon, "%02X %02X %02X %02X", + PIF_Ram[(count << 2) + 0], PIF_Ram[(count << 2) + 1], + PIF_Ram[(count << 2) + 2], PIF_Ram[(count << 2) + 3]); + strcat(HexData, Addon); + if (((count + 1) % 4) != 0) + { + sprintf(Addon, "-"); + strcat(HexData, Addon); + } + + Addon[0] = 0; + for (count2 = 0; count2 < 4; count2++) + { + if (PIF_Ram[(count << 2) + count2] < 30) + { + strcat(Addon, "."); + } + else + { + sprintf(Addon, "%s%c", Addon, PIF_Ram[(count << 2) + count2]); + } + } + strcat(AsciiData, Addon); + + if (((count + 1) % 4) == 0) + { + LogMessage("\t%s %s", HexData, AsciiData); + } + } + LogMessage(""); +} \ No newline at end of file diff --git a/Source/Project64/N64 System/Mips/Register Class.cpp b/Source/Project64/N64 System/Mips/Register Class.cpp index 7983bb7c3..c66ba1fb5 100644 --- a/Source/Project64/N64 System/Mips/Register Class.cpp +++ b/Source/Project64/N64 System/Mips/Register Class.cpp @@ -9,42 +9,43 @@ * * ****************************************************************************/ #include "stdafx.h" +#include -const char * CRegName::GPR[32] = {"r0","at","v0","v1","a0","a1","a2","a3", - "t0","t1","t2","t3","t4","t5","t6","t7", - "s0","s1","s2","s3","s4","s5","s6","s7", - "t8","t9","k0","k1","gp","sp","s8","ra"}; +const char * CRegName::GPR[32] = { "r0", "at", "v0", "v1", "a0", "a1", "a2", "a3", +"t0", "t1", "t2", "t3", "t4", "t5", "t6", "t7", +"s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", +"t8", "t9", "k0", "k1", "gp", "sp", "s8", "ra" }; -const char *CRegName::GPR_Hi[32] = {"r0.HI","at.HI","v0.HI","v1.HI","a0.HI","a1.HI", - "a2.HI","a3.HI","t0.HI","t1.HI","t2.HI","t3.HI", - "t4.HI","t5.HI","t6.HI","t7.HI","s0.HI","s1.HI", - "s2.HI","s3.HI","s4.HI","s5.HI","s6.HI","s7.HI", - "t8.HI","t9.HI","k0.HI","k1.HI","gp.HI","sp.HI", - "s8.HI","ra.HI"}; +const char *CRegName::GPR_Hi[32] = { "r0.HI", "at.HI", "v0.HI", "v1.HI", "a0.HI", "a1.HI", +"a2.HI", "a3.HI", "t0.HI", "t1.HI", "t2.HI", "t3.HI", +"t4.HI", "t5.HI", "t6.HI", "t7.HI", "s0.HI", "s1.HI", +"s2.HI", "s3.HI", "s4.HI", "s5.HI", "s6.HI", "s7.HI", +"t8.HI", "t9.HI", "k0.HI", "k1.HI", "gp.HI", "sp.HI", +"s8.HI", "ra.HI" }; -const char *CRegName::GPR_Lo[32] = {"r0.LO","at.LO","v0.LO","v1.LO","a0.LO","a1.LO", - "a2.LO","a3.LO","t0.LO","t1.LO","t2.LO","t3.LO", - "t4.LO","t5.LO","t6.LO","t7.LO","s0.LO","s1.LO", - "s2.LO","s3.LO","s4.LO","s5.LO","s6.LO","s7.LO", - "t8.LO","t9.LO","k0.LO","k1.LO","gp.LO","sp.LO", - "s8.LO","ra.LO"}; +const char *CRegName::GPR_Lo[32] = { "r0.LO", "at.LO", "v0.LO", "v1.LO", "a0.LO", "a1.LO", +"a2.LO", "a3.LO", "t0.LO", "t1.LO", "t2.LO", "t3.LO", +"t4.LO", "t5.LO", "t6.LO", "t7.LO", "s0.LO", "s1.LO", +"s2.LO", "s3.LO", "s4.LO", "s5.LO", "s6.LO", "s7.LO", +"t8.LO", "t9.LO", "k0.LO", "k1.LO", "gp.LO", "sp.LO", +"s8.LO", "ra.LO" }; -const char * CRegName::Cop0[32] = {"Index","Random","EntryLo0","EntryLo1","Context","PageMask","Wired","", - "BadVAddr","Count","EntryHi","Compare","Status","Cause","EPC","PRId", - "Config","LLAddr","WatchLo","WatchHi","XContext","","","", - "","","ECC","CacheErr","TagLo","TagHi","ErrEPC",""}; +const char * CRegName::Cop0[32] = { "Index", "Random", "EntryLo0", "EntryLo1", "Context", "PageMask", "Wired", "", +"BadVAddr", "Count", "EntryHi", "Compare", "Status", "Cause", "EPC", "PRId", +"Config", "LLAddr", "WatchLo", "WatchHi", "XContext", "", "", "", +"", "", "ECC", "CacheErr", "TagLo", "TagHi", "ErrEPC", "" }; -const char * CRegName::FPR[32] = {"f0","f1","f2","f3","f4","f5","f6","f7", - "f8","f9","f10","f11","f12","f13","f14","f15", - "f16","f17","f18","f19","f20","f21","f22","f23", - "f24","f25","f26","f27","f28","f29","f30","f31"}; +const char * CRegName::FPR[32] = { "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", +"f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", +"f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", +"f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31" }; -const char * CRegName::FPR_Ctrl[32] = {"Revision","Unknown","Unknown","Unknown","Unknown", - "Unknown","Unknown","Unknown","Unknown","Unknown","Unknown", - "Unknown","Unknown","Unknown","Unknown","Unknown","Unknown", - "Unknown","Unknown","Unknown","Unknown","Unknown","Unknown", - "Unknown","Unknown","Unknown","Unknown","Unknown","Unknown", - "Unknown","Unknown","FCSR"}; +const char * CRegName::FPR_Ctrl[32] = { "Revision", "Unknown", "Unknown", "Unknown", "Unknown", +"Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", +"Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", +"Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", +"Unknown", "Unknown", "Unknown", "Unknown", "Unknown", "Unknown", +"Unknown", "Unknown", "FCSR" }; uint32_t * CSystemRegisters::_PROGRAM_COUNTER = NULL; MIPS_DWORD * CSystemRegisters::_GPR = NULL; @@ -59,169 +60,169 @@ uint32_t * CSystemRegisters::_LLBit = NULL; ROUNDING_MODE * CSystemRegisters::_RoundingModel = NULL; CP0registers::CP0registers(uint32_t * _CP0) : - INDEX_REGISTER(_CP0[0]), - RANDOM_REGISTER(_CP0[1]), - ENTRYLO0_REGISTER(_CP0[2]), - ENTRYLO1_REGISTER(_CP0[3]), - CONTEXT_REGISTER(_CP0[4]), - PAGE_MASK_REGISTER(_CP0[5]), - WIRED_REGISTER(_CP0[6]), - BAD_VADDR_REGISTER(_CP0[8]), - COUNT_REGISTER(_CP0[9]), - ENTRYHI_REGISTER(_CP0[10]), - COMPARE_REGISTER(_CP0[11]), - STATUS_REGISTER(_CP0[12]), - CAUSE_REGISTER(_CP0[13]), - EPC_REGISTER(_CP0[14]), - CONFIG_REGISTER(_CP0[16]), - TAGLO_REGISTER(_CP0[28]), - TAGHI_REGISTER(_CP0[29]), - ERROREPC_REGISTER(_CP0[30]), - FAKE_CAUSE_REGISTER(_CP0[32]) +INDEX_REGISTER(_CP0[0]), +RANDOM_REGISTER(_CP0[1]), +ENTRYLO0_REGISTER(_CP0[2]), +ENTRYLO1_REGISTER(_CP0[3]), +CONTEXT_REGISTER(_CP0[4]), +PAGE_MASK_REGISTER(_CP0[5]), +WIRED_REGISTER(_CP0[6]), +BAD_VADDR_REGISTER(_CP0[8]), +COUNT_REGISTER(_CP0[9]), +ENTRYHI_REGISTER(_CP0[10]), +COMPARE_REGISTER(_CP0[11]), +STATUS_REGISTER(_CP0[12]), +CAUSE_REGISTER(_CP0[13]), +EPC_REGISTER(_CP0[14]), +CONFIG_REGISTER(_CP0[16]), +TAGLO_REGISTER(_CP0[28]), +TAGHI_REGISTER(_CP0[29]), +ERROREPC_REGISTER(_CP0[30]), +FAKE_CAUSE_REGISTER(_CP0[32]) { } Rdram_InterfaceReg::Rdram_InterfaceReg(uint32_t * _RdramInterface) : - RDRAM_CONFIG_REG(_RdramInterface[0]), - RDRAM_DEVICE_TYPE_REG(_RdramInterface[0]), - RDRAM_DEVICE_ID_REG(_RdramInterface[1]), - RDRAM_DELAY_REG(_RdramInterface[2]), - RDRAM_MODE_REG(_RdramInterface[3]), - RDRAM_REF_INTERVAL_REG(_RdramInterface[4]), - RDRAM_REF_ROW_REG(_RdramInterface[5]), - RDRAM_RAS_INTERVAL_REG(_RdramInterface[6]), - RDRAM_MIN_INTERVAL_REG(_RdramInterface[7]), - RDRAM_ADDR_SELECT_REG(_RdramInterface[8]), - RDRAM_DEVICE_MANUF_REG(_RdramInterface[9]) +RDRAM_CONFIG_REG(_RdramInterface[0]), +RDRAM_DEVICE_TYPE_REG(_RdramInterface[0]), +RDRAM_DEVICE_ID_REG(_RdramInterface[1]), +RDRAM_DELAY_REG(_RdramInterface[2]), +RDRAM_MODE_REG(_RdramInterface[3]), +RDRAM_REF_INTERVAL_REG(_RdramInterface[4]), +RDRAM_REF_ROW_REG(_RdramInterface[5]), +RDRAM_RAS_INTERVAL_REG(_RdramInterface[6]), +RDRAM_MIN_INTERVAL_REG(_RdramInterface[7]), +RDRAM_ADDR_SELECT_REG(_RdramInterface[8]), +RDRAM_DEVICE_MANUF_REG(_RdramInterface[9]) { } Mips_InterfaceReg::Mips_InterfaceReg(uint32_t * _MipsInterface) : - MI_INIT_MODE_REG(_MipsInterface[0]), - MI_MODE_REG(_MipsInterface[0]), - MI_VERSION_REG(_MipsInterface[1]), - MI_NOOP_REG(_MipsInterface[1]), - MI_INTR_REG(_MipsInterface[2]), - MI_INTR_MASK_REG(_MipsInterface[3]) +MI_INIT_MODE_REG(_MipsInterface[0]), +MI_MODE_REG(_MipsInterface[0]), +MI_VERSION_REG(_MipsInterface[1]), +MI_NOOP_REG(_MipsInterface[1]), +MI_INTR_REG(_MipsInterface[2]), +MI_INTR_MASK_REG(_MipsInterface[3]) { } Video_InterfaceReg::Video_InterfaceReg(uint32_t * _VideoInterface) : - VI_STATUS_REG(_VideoInterface[0]), - VI_CONTROL_REG(_VideoInterface[0]), - VI_ORIGIN_REG(_VideoInterface[1]), - VI_DRAM_ADDR_REG(_VideoInterface[1]), - VI_WIDTH_REG(_VideoInterface[2]), - VI_H_WIDTH_REG(_VideoInterface[2]), - VI_INTR_REG(_VideoInterface[3]), - VI_V_INTR_REG(_VideoInterface[3]), - VI_CURRENT_REG(_VideoInterface[4]), - VI_V_CURRENT_LINE_REG(_VideoInterface[4]), - VI_BURST_REG(_VideoInterface[5]), - VI_TIMING_REG(_VideoInterface[5]), - VI_V_SYNC_REG(_VideoInterface[6]), - VI_H_SYNC_REG(_VideoInterface[7]), - VI_LEAP_REG(_VideoInterface[8]), - VI_H_SYNC_LEAP_REG(_VideoInterface[8]), - VI_H_START_REG(_VideoInterface[9]), - VI_H_VIDEO_REG(_VideoInterface[9]), - VI_V_START_REG(_VideoInterface[10]), - VI_V_VIDEO_REG(_VideoInterface[10]), - VI_V_BURST_REG(_VideoInterface[11]), - VI_X_SCALE_REG(_VideoInterface[12]), - VI_Y_SCALE_REG(_VideoInterface[13]) +VI_STATUS_REG(_VideoInterface[0]), +VI_CONTROL_REG(_VideoInterface[0]), +VI_ORIGIN_REG(_VideoInterface[1]), +VI_DRAM_ADDR_REG(_VideoInterface[1]), +VI_WIDTH_REG(_VideoInterface[2]), +VI_H_WIDTH_REG(_VideoInterface[2]), +VI_INTR_REG(_VideoInterface[3]), +VI_V_INTR_REG(_VideoInterface[3]), +VI_CURRENT_REG(_VideoInterface[4]), +VI_V_CURRENT_LINE_REG(_VideoInterface[4]), +VI_BURST_REG(_VideoInterface[5]), +VI_TIMING_REG(_VideoInterface[5]), +VI_V_SYNC_REG(_VideoInterface[6]), +VI_H_SYNC_REG(_VideoInterface[7]), +VI_LEAP_REG(_VideoInterface[8]), +VI_H_SYNC_LEAP_REG(_VideoInterface[8]), +VI_H_START_REG(_VideoInterface[9]), +VI_H_VIDEO_REG(_VideoInterface[9]), +VI_V_START_REG(_VideoInterface[10]), +VI_V_VIDEO_REG(_VideoInterface[10]), +VI_V_BURST_REG(_VideoInterface[11]), +VI_X_SCALE_REG(_VideoInterface[12]), +VI_Y_SCALE_REG(_VideoInterface[13]) { } AudioInterfaceReg::AudioInterfaceReg(uint32_t * _AudioInterface) : - AI_DRAM_ADDR_REG(_AudioInterface[0]), - AI_LEN_REG(_AudioInterface[1]), - AI_CONTROL_REG(_AudioInterface[2]), - AI_STATUS_REG(_AudioInterface[3]), - AI_DACRATE_REG(_AudioInterface[4]), - AI_BITRATE_REG(_AudioInterface[5]) +AI_DRAM_ADDR_REG(_AudioInterface[0]), +AI_LEN_REG(_AudioInterface[1]), +AI_CONTROL_REG(_AudioInterface[2]), +AI_STATUS_REG(_AudioInterface[3]), +AI_DACRATE_REG(_AudioInterface[4]), +AI_BITRATE_REG(_AudioInterface[5]) { } PeripheralInterfaceReg::PeripheralInterfaceReg(uint32_t * PeripheralInterface) : - PI_DRAM_ADDR_REG(PeripheralInterface[0]), - PI_CART_ADDR_REG(PeripheralInterface[1]), - PI_RD_LEN_REG(PeripheralInterface[2]), - PI_WR_LEN_REG(PeripheralInterface[3]), - PI_STATUS_REG(PeripheralInterface[4]), - PI_BSD_DOM1_LAT_REG(PeripheralInterface[5]), - PI_DOMAIN1_REG(PeripheralInterface[5]), - PI_BSD_DOM1_PWD_REG(PeripheralInterface[6]), - PI_BSD_DOM1_PGS_REG(PeripheralInterface[7]), - PI_BSD_DOM1_RLS_REG(PeripheralInterface[8]), - PI_BSD_DOM2_LAT_REG(PeripheralInterface[9]), - PI_DOMAIN2_REG(PeripheralInterface[9]), - PI_BSD_DOM2_PWD_REG(PeripheralInterface[10]), - PI_BSD_DOM2_PGS_REG(PeripheralInterface[11]), - PI_BSD_DOM2_RLS_REG(PeripheralInterface[12]) +PI_DRAM_ADDR_REG(PeripheralInterface[0]), +PI_CART_ADDR_REG(PeripheralInterface[1]), +PI_RD_LEN_REG(PeripheralInterface[2]), +PI_WR_LEN_REG(PeripheralInterface[3]), +PI_STATUS_REG(PeripheralInterface[4]), +PI_BSD_DOM1_LAT_REG(PeripheralInterface[5]), +PI_DOMAIN1_REG(PeripheralInterface[5]), +PI_BSD_DOM1_PWD_REG(PeripheralInterface[6]), +PI_BSD_DOM1_PGS_REG(PeripheralInterface[7]), +PI_BSD_DOM1_RLS_REG(PeripheralInterface[8]), +PI_BSD_DOM2_LAT_REG(PeripheralInterface[9]), +PI_DOMAIN2_REG(PeripheralInterface[9]), +PI_BSD_DOM2_PWD_REG(PeripheralInterface[10]), +PI_BSD_DOM2_PGS_REG(PeripheralInterface[11]), +PI_BSD_DOM2_RLS_REG(PeripheralInterface[12]) { } RDRAMInt_InterfaceReg::RDRAMInt_InterfaceReg(uint32_t * RdramInterface) : - RI_MODE_REG(RdramInterface[0]), - RI_CONFIG_REG(RdramInterface[1]), - RI_CURRENT_LOAD_REG(RdramInterface[2]), - RI_SELECT_REG(RdramInterface[3]), - RI_COUNT_REG(RdramInterface[4]), - RI_REFRESH_REG(RdramInterface[4]), - RI_LATENCY_REG(RdramInterface[5]), - RI_RERROR_REG(RdramInterface[6]), - RI_WERROR_REG(RdramInterface[7]) +RI_MODE_REG(RdramInterface[0]), +RI_CONFIG_REG(RdramInterface[1]), +RI_CURRENT_LOAD_REG(RdramInterface[2]), +RI_SELECT_REG(RdramInterface[3]), +RI_COUNT_REG(RdramInterface[4]), +RI_REFRESH_REG(RdramInterface[4]), +RI_LATENCY_REG(RdramInterface[5]), +RI_RERROR_REG(RdramInterface[6]), +RI_WERROR_REG(RdramInterface[7]) { } DisplayControlReg::DisplayControlReg(uint32_t * _DisplayProcessor) : - DPC_START_REG(_DisplayProcessor[0]), - DPC_END_REG(_DisplayProcessor[1]), - DPC_CURRENT_REG(_DisplayProcessor[2]), - DPC_STATUS_REG(_DisplayProcessor[3]), - DPC_CLOCK_REG(_DisplayProcessor[4]), - DPC_BUFBUSY_REG(_DisplayProcessor[5]), - DPC_PIPEBUSY_REG(_DisplayProcessor[6]), - DPC_TMEM_REG(_DisplayProcessor[7]) +DPC_START_REG(_DisplayProcessor[0]), +DPC_END_REG(_DisplayProcessor[1]), +DPC_CURRENT_REG(_DisplayProcessor[2]), +DPC_STATUS_REG(_DisplayProcessor[3]), +DPC_CLOCK_REG(_DisplayProcessor[4]), +DPC_BUFBUSY_REG(_DisplayProcessor[5]), +DPC_PIPEBUSY_REG(_DisplayProcessor[6]), +DPC_TMEM_REG(_DisplayProcessor[7]) { } SigProcessor_InterfaceReg::SigProcessor_InterfaceReg(uint32_t * _SignalProcessorInterface) : - SP_MEM_ADDR_REG(_SignalProcessorInterface[0]), - SP_DRAM_ADDR_REG(_SignalProcessorInterface[1]), - SP_RD_LEN_REG(_SignalProcessorInterface[2]), - SP_WR_LEN_REG(_SignalProcessorInterface[3]), - SP_STATUS_REG(_SignalProcessorInterface[4]), - SP_DMA_FULL_REG(_SignalProcessorInterface[5]), - SP_DMA_BUSY_REG(_SignalProcessorInterface[6]), - SP_SEMAPHORE_REG(_SignalProcessorInterface[7]), - SP_PC_REG(_SignalProcessorInterface[8]), - SP_IBIST_REG(_SignalProcessorInterface[9]) +SP_MEM_ADDR_REG(_SignalProcessorInterface[0]), +SP_DRAM_ADDR_REG(_SignalProcessorInterface[1]), +SP_RD_LEN_REG(_SignalProcessorInterface[2]), +SP_WR_LEN_REG(_SignalProcessorInterface[3]), +SP_STATUS_REG(_SignalProcessorInterface[4]), +SP_DMA_FULL_REG(_SignalProcessorInterface[5]), +SP_DMA_BUSY_REG(_SignalProcessorInterface[6]), +SP_SEMAPHORE_REG(_SignalProcessorInterface[7]), +SP_PC_REG(_SignalProcessorInterface[8]), +SP_IBIST_REG(_SignalProcessorInterface[9]) { } Serial_InterfaceReg::Serial_InterfaceReg(uint32_t * SerialInterface) : - SI_DRAM_ADDR_REG(SerialInterface[0]), - SI_PIF_ADDR_RD64B_REG(SerialInterface[1]), - SI_PIF_ADDR_WR64B_REG(SerialInterface[2]), - SI_STATUS_REG(SerialInterface[3]) +SI_DRAM_ADDR_REG(SerialInterface[0]), +SI_PIF_ADDR_RD64B_REG(SerialInterface[1]), +SI_PIF_ADDR_WR64B_REG(SerialInterface[2]), +SI_STATUS_REG(SerialInterface[3]) { } CRegisters::CRegisters(CN64System * System, CSystemEvents * SystemEvents) : - CP0registers(m_CP0), - Rdram_InterfaceReg(m_RDRAM_Registers), - Mips_InterfaceReg(m_Mips_Interface), - Video_InterfaceReg(m_Video_Interface), - AudioInterfaceReg(m_Audio_Interface), - PeripheralInterfaceReg(m_Peripheral_Interface), - RDRAMInt_InterfaceReg(m_RDRAM_Interface), - SigProcessor_InterfaceReg(m_SigProcessor_Interface), - DisplayControlReg(m_Display_ControlReg), - Serial_InterfaceReg(m_SerialInterface), - m_System(System), - m_SystemEvents(SystemEvents) +CP0registers(m_CP0), +Rdram_InterfaceReg(m_RDRAM_Registers), +Mips_InterfaceReg(m_Mips_Interface), +Video_InterfaceReg(m_Video_Interface), +AudioInterfaceReg(m_Audio_Interface), +PeripheralInterfaceReg(m_Peripheral_Interface), +RDRAMInt_InterfaceReg(m_RDRAM_Interface), +SigProcessor_InterfaceReg(m_SigProcessor_Interface), +DisplayControlReg(m_Display_ControlReg), +Serial_InterfaceReg(m_SerialInterface), +m_System(System), +m_SystemEvents(SystemEvents) { Reset(); } @@ -230,26 +231,26 @@ void CRegisters::Reset() { m_FirstInterupt = true; - memset(m_GPR,0,sizeof(m_GPR)); - memset(m_CP0,0,sizeof(m_CP0)); - memset(m_FPR,0,sizeof(m_FPR)); - memset(m_FPCR,0,sizeof(m_FPCR)); - m_HI.DW = 0; - m_LO.DW = 0; + memset(m_GPR, 0, sizeof(m_GPR)); + memset(m_CP0, 0, sizeof(m_CP0)); + memset(m_FPR, 0, sizeof(m_FPR)); + memset(m_FPCR, 0, sizeof(m_FPCR)); + m_HI.DW = 0; + m_LO.DW = 0; m_RoundingModel = ROUND_NEAR; - m_LLBit = 0; + m_LLBit = 0; //Reset System Registers - memset(m_RDRAM_Interface,0,sizeof(m_RDRAM_Interface)); - memset(m_RDRAM_Registers,0,sizeof(m_RDRAM_Registers)); - memset(m_Mips_Interface,0,sizeof(m_Mips_Interface)); - memset(m_Video_Interface,0,sizeof(m_Video_Interface)); - memset(m_Display_ControlReg,0,sizeof(m_Display_ControlReg)); - memset(m_Audio_Interface,0,sizeof(m_Audio_Interface)); - memset(m_SigProcessor_Interface,0,sizeof(m_SigProcessor_Interface)); - memset(m_Peripheral_Interface,0,sizeof(m_Peripheral_Interface)); - memset(m_SerialInterface,0,sizeof(m_SerialInterface)); + memset(m_RDRAM_Interface, 0, sizeof(m_RDRAM_Interface)); + memset(m_RDRAM_Registers, 0, sizeof(m_RDRAM_Registers)); + memset(m_Mips_Interface, 0, sizeof(m_Mips_Interface)); + memset(m_Video_Interface, 0, sizeof(m_Video_Interface)); + memset(m_Display_ControlReg, 0, sizeof(m_Display_ControlReg)); + memset(m_Audio_Interface, 0, sizeof(m_Audio_Interface)); + memset(m_SigProcessor_Interface, 0, sizeof(m_SigProcessor_Interface)); + memset(m_Peripheral_Interface, 0, sizeof(m_Peripheral_Interface)); + memset(m_SerialInterface, 0, sizeof(m_SerialInterface)); m_AudioIntrReg = 0; m_GfxIntrReg = 0; @@ -291,27 +292,27 @@ void CRegisters::CheckInterrupts() FAKE_CAUSE_REGISTER &= ~CAUSE_IP2; } - if (( STATUS_REGISTER & STATUS_IE ) == 0 ) + if ((STATUS_REGISTER & STATUS_IE) == 0) { return; } - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) + if ((STATUS_REGISTER & STATUS_EXL) != 0) { return; } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) + if ((STATUS_REGISTER & STATUS_ERL) != 0) { return; } - if (( STATUS_REGISTER & FAKE_CAUSE_REGISTER & 0xFF00) != 0) + if ((STATUS_REGISTER & FAKE_CAUSE_REGISTER & 0xFF00) != 0) { if (m_FirstInterupt) { m_FirstInterupt = false; if (g_Recompiler) { - g_Recompiler->ClearRecompCode_Virt(0x80000000,0x200,CRecompiler::Remove_InitialCode); + g_Recompiler->ClearRecompCode_Virt(0x80000000, 0x200, CRecompiler::Remove_InitialCode); } } m_SystemEvents->QueueEvent(SysEvent_ExecuteInterrupt); @@ -323,11 +324,11 @@ void CRegisters::DoAddressError(bool DelaySlot, uint32_t BadVaddr, bool FromRead if (bHaveDebugger()) { g_Notify->DisplayError(L"AddressError"); - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) + if ((STATUS_REGISTER & STATUS_EXL) != 0) { g_Notify->DisplayError(L"EXL set in AddressError Exception"); } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) + if ((STATUS_REGISTER & STATUS_ERL) != 0) { g_Notify->DisplayError(L"ERL set in AddressError Exception"); } @@ -359,7 +360,7 @@ void CRegisters::FixFpuLocations() { if ((STATUS_REGISTER & STATUS_FR) == 0) { - for (int count = 0; count < 32; count ++) + for (int count = 0; count < 32; count++) { m_FPR_S[count] = &m_FPR[count >> 1].F[count & 1]; m_FPR_D[count] = &m_FPR[count >> 1].D; @@ -367,7 +368,7 @@ void CRegisters::FixFpuLocations() } else { - for (int count = 0; count < 32; count ++) { + for (int count = 0; count < 32; count++) { m_FPR_S[count] = &m_FPR[count].F[1]; m_FPR_D[count] = &m_FPR[count].D; } @@ -378,11 +379,11 @@ void CRegisters::DoBreakException(bool DelaySlot) { if (bHaveDebugger()) { - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) + if ((STATUS_REGISTER & STATUS_EXL) != 0) { g_Notify->DisplayError(L"EXL set in Break Exception"); } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) + if ((STATUS_REGISTER & STATUS_ERL) != 0) { g_Notify->DisplayError(L"ERL set in Break Exception"); } @@ -406,11 +407,11 @@ void CRegisters::DoCopUnusableException(bool DelaySlot, int Coprocessor) { if (bHaveDebugger()) { - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) + if ((STATUS_REGISTER & STATUS_EXL) != 0) { g_Notify->DisplayError(L"EXL set in Break Exception"); } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) + if ((STATUS_REGISTER & STATUS_ERL) != 0) { g_Notify->DisplayError(L"ERL set in Break Exception"); } @@ -506,7 +507,7 @@ void CRegisters::DoTLBReadMiss(bool DelaySlot, uint32_t BadVaddr) { if (bHaveDebugger()) { - g_Notify->DisplayError(stdstr_f("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s",BadVaddr,g_TLB->AddressDefined(BadVaddr)?"TRUE":"FALSE").ToUTF16().c_str()); + g_Notify->DisplayError(stdstr_f("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s", BadVaddr, g_TLB->AddressDefined(BadVaddr) ? "TRUE" : "FALSE").ToUTF16().c_str()); } m_PROGRAM_COUNTER = 0x80000180; } @@ -516,11 +517,11 @@ void CRegisters::DoSysCallException(bool DelaySlot) { if (bHaveDebugger()) { - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) + if ((STATUS_REGISTER & STATUS_EXL) != 0) { g_Notify->DisplayError(L"EXL set in SysCall Exception"); } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) + if ((STATUS_REGISTER & STATUS_ERL) != 0) { g_Notify->DisplayError(L"ERL set in SysCall Exception"); } @@ -538,4 +539,4 @@ void CRegisters::DoSysCallException(bool DelaySlot) } STATUS_REGISTER |= STATUS_EXL; m_PROGRAM_COUNTER = 0x80000180; -} +} \ No newline at end of file diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index cd70b8a1a..87dfca5d7 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -9,6 +9,7 @@ * * ****************************************************************************/ #include "stdafx.h" +#include #pragma warning(disable:4355) // Disable 'this' : used in base member initializer list @@ -459,7 +460,6 @@ void CN64System::Pause() Notify().DisplayMessage(5, MSG_CPU_RESUMED); } - void CN64System::GameReset() { m_SystemTimer.SetTimer(CSystemTimer::SoftResetTimer, 0x3000000, false); diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj index 517fca83e..256bc4408 100644 --- a/Source/Project64/Project64.vcxproj +++ b/Source/Project64/Project64.vcxproj @@ -44,7 +44,6 @@ - @@ -81,6 +80,7 @@ + @@ -176,7 +176,6 @@ - @@ -187,6 +186,7 @@ + diff --git a/Source/Project64/Project64.vcxproj.filters b/Source/Project64/Project64.vcxproj.filters index 437ae1cbf..f387c0509 100644 --- a/Source/Project64/Project64.vcxproj.filters +++ b/Source/Project64/Project64.vcxproj.filters @@ -417,8 +417,8 @@ Source Files\User Interface Source - - Source Files + + Source Files\User Interface Source @@ -827,11 +827,11 @@ Header Files\User Interface Headers - - Header Files - Header Files\Settings Headers + + Header Files\User Interface Headers + \ No newline at end of file diff --git a/Source/Project64/User Interface/LoggingUI.cpp b/Source/Project64/User Interface/LoggingUI.cpp new file mode 100644 index 000000000..ff95a6c56 --- /dev/null +++ b/Source/Project64/User Interface/LoggingUI.cpp @@ -0,0 +1,920 @@ +/**************************************************************************** +* * +* Project64 - A Nintendo 64 emulator. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2012 Project64. All rights reserved. * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* * +****************************************************************************/ +#include "stdafx.h" +#include "LoggingUI.h" + +#include + +void LoadLogSetting(HKEY hKey, char * String, bool * Value); +void SaveLogOptions(void); + +LRESULT CALLBACK LogGeneralProc(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK LogPifProc(HWND, UINT, WPARAM, LPARAM); +LRESULT CALLBACK LogRegProc(HWND, UINT, WPARAM, LPARAM); + +static HANDLE g_hLogFile = NULL; +LOG_OPTIONS g_LogOptions, TempOptions; + +void EnterLogOptions(HWND hwndOwner) +{ + PROPSHEETPAGE psp[3]; + PROPSHEETHEADER psh; + + psp[0].dwSize = sizeof(PROPSHEETPAGE); + psp[0].dwFlags = PSP_USETITLE; + psp[0].hInstance = GetModuleHandle(NULL); + psp[0].pszTemplate = MAKEINTRESOURCE(IDD_Logging_Registers); + psp[0].pfnDlgProc = (DLGPROC)LogRegProc; + psp[0].pszTitle = "Registers"; + psp[0].lParam = 0; + psp[0].pfnCallback = NULL; + + psp[1].dwSize = sizeof(PROPSHEETPAGE); + psp[1].dwFlags = PSP_USETITLE; + psp[1].hInstance = GetModuleHandle(NULL); + psp[1].pszTemplate = MAKEINTRESOURCE(IDD_Logging_PifRam); + psp[1].pfnDlgProc = (DLGPROC)LogPifProc; + psp[1].pszTitle = "Pif Ram"; + psp[1].lParam = 0; + psp[1].pfnCallback = NULL; + + psp[2].dwSize = sizeof(PROPSHEETPAGE); + psp[2].dwFlags = PSP_USETITLE; + psp[2].hInstance = GetModuleHandle(NULL); + psp[2].pszTemplate = MAKEINTRESOURCE(IDD_Logging_General); + psp[2].pfnDlgProc = (DLGPROC)LogGeneralProc; + psp[2].pszTitle = "General"; + psp[2].lParam = 0; + psp[2].pfnCallback = NULL; + + psh.dwSize = sizeof(PROPSHEETHEADER); + psh.dwFlags = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW; + psh.hwndParent = hwndOwner; + psh.hInstance = GetModuleHandle(NULL); + psh.pszCaption = (LPSTR) "Log Options"; + psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); + psh.nStartPage = 0; + psh.ppsp = (LPCPROPSHEETPAGE)&psp; + psh.pfnCallback = NULL; + + LoadLogOptions(&TempOptions, TRUE); +#if defined(WINDOWS_UI) + PropertySheet(&psh); +#else + g_Notify -> BreakPoint(__FILEW__, __LINE__); +#endif + SaveLogOptions(); + LoadLogOptions(&g_LogOptions, FALSE); + return; +} + +void LoadLogOptions(LOG_OPTIONS * LogOptions, bool AlwaysFill) +{ + int32_t lResult; + HKEY hKeyResults = 0; + char String[200]; + + sprintf(String, "Software\\N64 Emulation\\%s\\Logging", g_Settings->LoadStringVal(Setting_ApplicationName).c_str()); + lResult = RegOpenKeyEx(HKEY_CURRENT_USER, String, 0, KEY_ALL_ACCESS, + &hKeyResults); + + if (lResult == ERROR_SUCCESS) + { + //LoadLogSetting(hKeyResults,"Generate Log File",&LogOptions->GenerateLog); + if (LogOptions->GenerateLog || AlwaysFill) + { + LoadLogSetting(hKeyResults, "Log RDRAM", &LogOptions->LogRDRamRegisters); + LoadLogSetting(hKeyResults, "Log SP", &LogOptions->LogSPRegisters); + LoadLogSetting(hKeyResults, "Log DP Command", &LogOptions->LogDPCRegisters); + LoadLogSetting(hKeyResults, "Log DP Span", &LogOptions->LogDPSRegisters); + LoadLogSetting(hKeyResults, "Log MIPS Interface (MI)", &LogOptions->LogMIPSInterface); + LoadLogSetting(hKeyResults, "Log Video Interface (VI)", &LogOptions->LogVideoInterface); + LoadLogSetting(hKeyResults, "Log Audio Interface (AI)", &LogOptions->LogAudioInterface); + LoadLogSetting(hKeyResults, "Log Peripheral Interface (PI)", &LogOptions->LogPerInterface); + LoadLogSetting(hKeyResults, "Log RDRAM Interface (RI)", &LogOptions->LogRDRAMInterface); + LoadLogSetting(hKeyResults, "Log Serial Interface (SI)", &LogOptions->LogSerialInterface); + LoadLogSetting(hKeyResults, "Log PifRam DMA Operations", &LogOptions->LogPRDMAOperations); + LoadLogSetting(hKeyResults, "Log PifRam Direct Memory Loads", &LogOptions->LogPRDirectMemLoads); + LoadLogSetting(hKeyResults, "Log PifRam DMA Memory Loads", &LogOptions->LogPRDMAMemLoads); + LoadLogSetting(hKeyResults, "Log PifRam Direct Memory Stores", &LogOptions->LogPRDirectMemStores); + LoadLogSetting(hKeyResults, "Log PifRam DMA Memory Stores", &LogOptions->LogPRDMAMemStores); + LoadLogSetting(hKeyResults, "Log Controller Pak", &LogOptions->LogControllerPak); + LoadLogSetting(hKeyResults, "Log CP0 changes", &LogOptions->LogCP0changes); + LoadLogSetting(hKeyResults, "Log CP0 reads", &LogOptions->LogCP0reads); + LoadLogSetting(hKeyResults, "Log Exceptions", &LogOptions->LogExceptions); + LoadLogSetting(hKeyResults, "No Interrupts", &LogOptions->NoInterrupts); + LoadLogSetting(hKeyResults, "Log TLB", &LogOptions->LogTLB); + LoadLogSetting(hKeyResults, "Log Cache Operations", &LogOptions->LogCache); + LoadLogSetting(hKeyResults, "Log Rom Header", &LogOptions->LogRomHeader); + LoadLogSetting(hKeyResults, "Log Unknown access", &LogOptions->LogUnknown); + return; + } + } + + LogOptions->GenerateLog = FALSE; + LogOptions->LogRDRamRegisters = FALSE; + LogOptions->LogSPRegisters = FALSE; + LogOptions->LogDPCRegisters = FALSE; + LogOptions->LogDPSRegisters = FALSE; + LogOptions->LogMIPSInterface = FALSE; + LogOptions->LogVideoInterface = FALSE; + LogOptions->LogAudioInterface = FALSE; + LogOptions->LogPerInterface = FALSE; + LogOptions->LogRDRAMInterface = FALSE; + LogOptions->LogSerialInterface = FALSE; + + LogOptions->LogPRDMAOperations = FALSE; + LogOptions->LogPRDirectMemLoads = FALSE; + LogOptions->LogPRDMAMemLoads = FALSE; + LogOptions->LogPRDirectMemStores = FALSE; + LogOptions->LogPRDMAMemStores = FALSE; + LogOptions->LogControllerPak = FALSE; + + LogOptions->LogCP0changes = FALSE; + LogOptions->LogCP0reads = FALSE; + LogOptions->LogCache = FALSE; + LogOptions->LogExceptions = FALSE; + LogOptions->NoInterrupts = FALSE; + LogOptions->LogTLB = FALSE; + LogOptions->LogRomHeader = FALSE; + LogOptions->LogUnknown = FALSE; +} + +void LoadLogSetting(HKEY hKey, char * String, bool * Value) +{ + DWORD Type, dwResult, Bytes = 4; + int32_t lResult; + + lResult = RegQueryValueEx(hKey, String, 0, &Type, (LPBYTE)(&dwResult), &Bytes); + if (Type == REG_DWORD && lResult == ERROR_SUCCESS) + { + *Value = dwResult != 0; + } + else + { + *Value = FALSE; + } +} + +LRESULT CALLBACK LogGeneralProc(HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + if (TempOptions.LogCP0changes) { CheckDlgButton(hDlg, IDC_CP0_WRITE, BST_CHECKED); } + if (TempOptions.LogCP0reads) { CheckDlgButton(hDlg, IDC_CP0_READ, BST_CHECKED); } + if (TempOptions.LogCache) { CheckDlgButton(hDlg, IDC_CACHE, BST_CHECKED); } + if (TempOptions.LogExceptions) { CheckDlgButton(hDlg, IDC_EXCEPTIONS, BST_CHECKED); } + if (TempOptions.NoInterrupts) { CheckDlgButton(hDlg, IDC_INTERRUPTS, BST_CHECKED); } + if (TempOptions.LogTLB) { CheckDlgButton(hDlg, IDC_TLB, BST_CHECKED); } + if (TempOptions.LogRomHeader) { CheckDlgButton(hDlg, IDC_ROM_HEADER, BST_CHECKED); } + if (TempOptions.LogUnknown) { CheckDlgButton(hDlg, IDC_UNKOWN, BST_CHECKED); } + break; + case WM_NOTIFY: + if (((NMHDR FAR *) lParam)->code != PSN_APPLY) { break; } + TempOptions.LogCP0changes = IsDlgButtonChecked(hDlg, IDC_CP0_WRITE) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogCP0reads = IsDlgButtonChecked(hDlg, IDC_CP0_READ) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogCache = IsDlgButtonChecked(hDlg, IDC_CACHE) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogExceptions = IsDlgButtonChecked(hDlg, IDC_EXCEPTIONS) == BST_CHECKED ? TRUE : FALSE; + TempOptions.NoInterrupts = IsDlgButtonChecked(hDlg, IDC_INTERRUPTS) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogTLB = IsDlgButtonChecked(hDlg, IDC_TLB) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogRomHeader = IsDlgButtonChecked(hDlg, IDC_ROM_HEADER) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogUnknown = IsDlgButtonChecked(hDlg, IDC_UNKOWN) == BST_CHECKED ? TRUE : FALSE; + break; + default: + return FALSE; + } + return TRUE; +} + +void Log_LW(uint32_t PC, uint32_t VAddr) +{ + if (!g_LogOptions.GenerateLog) + { + return; + } + + if (VAddr < 0xA0000000 || VAddr >= 0xC0000000) + { + uint32_t PAddr; + if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) + { + if (g_LogOptions.LogUnknown) + { + LogMessage("%08X: read from unknown ??? (%08X)", PC, VAddr); + } + return; + } + VAddr = PAddr + 0xA0000000; + } + + uint32_t Value; + if (VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) + { + return; + } + if (VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) + { + if (!g_LogOptions.LogRDRamRegisters) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA3F00000: LogMessage("%08X: read from RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG (%08X)", PC, Value); return; + case 0xA3F00004: LogMessage("%08X: read from RDRAM_DEVICE_ID_REG (%08X)", PC, Value); return; + case 0xA3F00008: LogMessage("%08X: read from RDRAM_DELAY_REG (%08X)", PC, Value); return; + case 0xA3F0000C: LogMessage("%08X: read from RDRAM_MODE_REG (%08X)", PC, Value); return; + case 0xA3F00010: LogMessage("%08X: read from RDRAM_REF_INTERVAL_REG (%08X)", PC, Value); return; + case 0xA3F00014: LogMessage("%08X: read from RDRAM_REF_ROW_REG (%08X)", PC, Value); return; + case 0xA3F00018: LogMessage("%08X: read from RDRAM_RAS_INTERVAL_REG (%08X)", PC, Value); return; + case 0xA3F0001C: LogMessage("%08X: read from RDRAM_MIN_INTERVAL_REG (%08X)", PC, Value); return; + case 0xA3F00020: LogMessage("%08X: read from RDRAM_ADDR_SELECT_REG (%08X)", PC, Value); return; + case 0xA3F00024: LogMessage("%08X: read from RDRAM_DEVICE_MANUF_REG (%08X)", PC, Value); return; + } + } + + if (VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC) + { + return; + } + if (VAddr >= 0xA4040000 && VAddr <= 0xA404001C) + { + if (!g_LogOptions.LogSPRegisters) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4040000: LogMessage("%08X: read from SP_MEM_ADDR_REG (%08X)", PC, Value); break; + case 0xA4040004: LogMessage("%08X: read from SP_DRAM_ADDR_REG (%08X)", PC, Value); break; + case 0xA4040008: LogMessage("%08X: read from SP_RD_LEN_REG (%08X)", PC, Value); break; + case 0xA404000C: LogMessage("%08X: read from SP_WR_LEN_REG (%08X)", PC, Value); break; + case 0xA4040010: LogMessage("%08X: read from SP_STATUS_REG (%08X)", PC, Value); break; + case 0xA4040014: LogMessage("%08X: read from SP_DMA_FULL_REG (%08X)", PC, Value); break; + case 0xA4040018: LogMessage("%08X: read from SP_DMA_BUSY_REG (%08X)", PC, Value); break; + case 0xA404001C: LogMessage("%08X: read from SP_SEMAPHORE_REG (%08X)", PC, Value); break; + } + return; + } + if (VAddr == 0xA4080000) + { + if (!g_LogOptions.LogSPRegisters) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SP_PC (%08X)", PC, Value); + return; + } + if (VAddr >= 0xA4100000 && VAddr <= 0xA410001C) + { + if (!g_LogOptions.LogDPCRegisters) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4100000: LogMessage("%08X: read from DPC_START_REG (%08X)", PC, Value); return; + case 0xA4100004: LogMessage("%08X: read from DPC_END_REG (%08X)", PC, Value); return; + case 0xA4100008: LogMessage("%08X: read from DPC_CURRENT_REG (%08X)", PC, Value); return; + case 0xA410000C: LogMessage("%08X: read from DPC_STATUS_REG (%08X)", PC, Value); return; + case 0xA4100010: LogMessage("%08X: read from DPC_CLOCK_REG (%08X)", PC, Value); return; + case 0xA4100014: LogMessage("%08X: read from DPC_BUFBUSY_REG (%08X)", PC, Value); return; + case 0xA4100018: LogMessage("%08X: read from DPC_PIPEBUSY_REG (%08X)", PC, Value); return; + case 0xA410001C: LogMessage("%08X: read from DPC_TMEM_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C) + { + if (!g_LogOptions.LogMIPSInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4300000: LogMessage("%08X: read from MI_INIT_MODE_REG/MI_MODE_REG (%08X)", PC, Value); return; + case 0xA4300004: LogMessage("%08X: read from MI_VERSION_REG/MI_NOOP_REG (%08X)", PC, Value); return; + case 0xA4300008: LogMessage("%08X: read from MI_INTR_REG (%08X)", PC, Value); return; + case 0xA430000C: LogMessage("%08X: read from MI_INTR_MASK_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034) + { + if (!g_LogOptions.LogVideoInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4400000: LogMessage("%08X: read from VI_STATUS_REG/VI_CONTROL_REG (%08X)", PC, Value); return; + case 0xA4400004: LogMessage("%08X: read from VI_ORIGIN_REG/VI_DRAM_ADDR_REG (%08X)", PC, Value); return; + case 0xA4400008: LogMessage("%08X: read from VI_WIDTH_REG/VI_H_WIDTH_REG (%08X)", PC, Value); return; + case 0xA440000C: LogMessage("%08X: read from VI_INTR_REG/VI_V_INTR_REG (%08X)", PC, Value); return; + case 0xA4400010: LogMessage("%08X: read from VI_CURRENT_REG/VI_V_CURRENT_LINE_REG (%08X)", PC, Value); return; + case 0xA4400014: LogMessage("%08X: read from VI_BURST_REG/VI_TIMING_REG (%08X)", PC, Value); return; + case 0xA4400018: LogMessage("%08X: read from VI_V_SYNC_REG (%08X)", PC, Value); return; + case 0xA440001C: LogMessage("%08X: read from VI_H_SYNC_REG (%08X)", PC, Value); return; + case 0xA4400020: LogMessage("%08X: read from VI_LEAP_REG/VI_H_SYNC_LEAP_REG (%08X)", PC, Value); return; + case 0xA4400024: LogMessage("%08X: read from VI_H_START_REG/VI_H_VIDEO_REG (%08X)", PC, Value); return; + case 0xA4400028: LogMessage("%08X: read from VI_V_START_REG/VI_V_VIDEO_REG (%08X)", PC, Value); return; + case 0xA440002C: LogMessage("%08X: read from VI_V_BURST_REG (%08X)", PC, Value); return; + case 0xA4400030: LogMessage("%08X: read from VI_X_SCALE_REG (%08X)", PC, Value); return; + case 0xA4400034: LogMessage("%08X: read from VI_Y_SCALE_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4500000 && VAddr <= 0xA4500014) + { + if (!g_LogOptions.LogAudioInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4500000: LogMessage("%08X: read from AI_DRAM_ADDR_REG (%08X)", PC, Value); return; + case 0xA4500004: LogMessage("%08X: read from AI_LEN_REG (%08X)", PC, Value); return; + case 0xA4500008: LogMessage("%08X: read from AI_CONTROL_REG (%08X)", PC, Value); return; + case 0xA450000C: LogMessage("%08X: read from AI_STATUS_REG (%08X)", PC, Value); return; + case 0xA4500010: LogMessage("%08X: read from AI_DACRATE_REG (%08X)", PC, Value); return; + case 0xA4500014: LogMessage("%08X: read from AI_BITRATE_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4600000 && VAddr <= 0xA4600030) + { + if (!g_LogOptions.LogPerInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4600000: LogMessage("%08X: read from PI_DRAM_ADDR_REG (%08X)", PC, Value); return; + case 0xA4600004: LogMessage("%08X: read from PI_CART_ADDR_REG (%08X)", PC, Value); return; + case 0xA4600008: LogMessage("%08X: read from PI_RD_LEN_REG (%08X)", PC, Value); return; + case 0xA460000C: LogMessage("%08X: read from PI_WR_LEN_REG (%08X)", PC, Value); return; + case 0xA4600010: LogMessage("%08X: read from PI_STATUS_REG (%08X)", PC, Value); return; + case 0xA4600014: LogMessage("%08X: read from PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG (%08X)", PC, Value); return; + case 0xA4600018: LogMessage("%08X: read from PI_BSD_DOM1_PWD_REG (%08X)", PC, Value); return; + case 0xA460001C: LogMessage("%08X: read from PI_BSD_DOM1_PGS_REG (%08X)", PC, Value); return; + case 0xA4600020: LogMessage("%08X: read from PI_BSD_DOM1_RLS_REG (%08X)", PC, Value); return; + case 0xA4600024: LogMessage("%08X: read from PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG (%08X)", PC, Value); return; + case 0xA4600028: LogMessage("%08X: read from PI_BSD_DOM2_PWD_REG (%08X)", PC, Value); return; + case 0xA460002C: LogMessage("%08X: read from PI_BSD_DOM2_PGS_REG (%08X)", PC, Value); return; + case 0xA4600030: LogMessage("%08X: read from PI_BSD_DOM2_RLS_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4700000 && VAddr <= 0xA470001C) + { + if (!g_LogOptions.LogRDRAMInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4700000: LogMessage("%08X: read from RI_MODE_REG (%08X)", PC, Value); return; + case 0xA4700004: LogMessage("%08X: read from RI_CONFIG_REG (%08X)", PC, Value); return; + case 0xA4700008: LogMessage("%08X: read from RI_CURRENT_LOAD_REG (%08X)", PC, Value); return; + case 0xA470000C: LogMessage("%08X: read from RI_SELECT_REG (%08X)", PC, Value); return; + case 0xA4700010: LogMessage("%08X: read from RI_REFRESH_REG/RI_COUNT_REG (%08X)", PC, Value); return; + case 0xA4700014: LogMessage("%08X: read from RI_LATENCY_REG (%08X)", PC, Value); return; + case 0xA4700018: LogMessage("%08X: read from RI_RERROR_REG (%08X)", PC, Value); return; + case 0xA470001C: LogMessage("%08X: read from RI_WERROR_REG (%08X)", PC, Value); return; + } + } + if (VAddr == 0xA4800000) + { + if (!g_LogOptions.LogSerialInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_DRAM_ADDR_REG (%08X)", PC, Value); + return; + } + if (VAddr == 0xA4800004) + { + if (!g_LogOptions.LogSerialInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_PIF_ADDR_RD64B_REG (%08X)", PC, Value); + return; + } + if (VAddr == 0xA4800010) + { + if (!g_LogOptions.LogSerialInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_PIF_ADDR_WR64B_REG (%08X)", PC, Value); + return; + } + if (VAddr == 0xA4800018) + { + if (!g_LogOptions.LogSerialInterface) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_STATUS_REG (%08X)", PC, Value); + return; + } + if (VAddr >= 0xBFC00000 && VAddr <= 0xBFC007C0) + { + return; + } + if (VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC) + { + if (!g_LogOptions.LogPRDirectMemLoads) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read word from Pif Ram at 0x%X (%08X)", PC, VAddr - 0xBFC007C0, Value); + return; + } + if (VAddr >= 0xB0000040 && ((VAddr - 0xB0000000) < g_Rom->GetRomSize())) + { + return; + } + if (VAddr >= 0xB0000000 && VAddr < 0xB0000040) + { + if (!g_LogOptions.LogRomHeader) + { + return; + } + + g_MMU->LW_VAddr(VAddr, Value); + switch (VAddr) + { + case 0xB0000004: LogMessage("%08X: read from Rom Clock Rate (%08X)", PC, Value); break; + case 0xB0000008: LogMessage("%08X: read from Rom Boot address offset (%08X)", PC, Value); break; + case 0xB000000C: LogMessage("%08X: read from Rom Release offset (%08X)", PC, Value); break; + case 0xB0000010: LogMessage("%08X: read from Rom CRC1 (%08X)", PC, Value); break; + case 0xB0000014: LogMessage("%08X: read from Rom CRC2 (%08X)", PC, Value); break; + default: LogMessage("%08X: read from Rom header 0x%X (%08X)", PC, VAddr & 0xFF, Value); break; + } + return; + } + if (!g_LogOptions.LogUnknown) + { + return; + } + LogMessage("%08X: read from unknown ??? (%08X)", PC, VAddr); +} + +void Log_SW(uint32_t PC, uint32_t VAddr, uint32_t Value) +{ + if (!g_LogOptions.GenerateLog) + { + return; + } + + if (VAddr < 0xA0000000 || VAddr >= 0xC0000000) + { + uint32_t PAddr; + if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) + { + if (g_LogOptions.LogUnknown) + { + LogMessage("%08X: Writing 0x%08X to %08X", PC, Value, VAddr); + } + return; + } + VAddr = PAddr + 0xA0000000; + } + + if (VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) + { + return; + } + if (VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) + { + if (!g_LogOptions.LogRDRamRegisters) + { + return; + } + switch (VAddr) + { + case 0xA3F00000: LogMessage("%08X: Writing 0x%08X to RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG", PC, Value); return; + case 0xA3F00004: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_ID_REG", PC, Value); return; + case 0xA3F00008: LogMessage("%08X: Writing 0x%08X to RDRAM_DELAY_REG", PC, Value); return; + case 0xA3F0000C: LogMessage("%08X: Writing 0x%08X to RDRAM_MODE_REG", PC, Value); return; + case 0xA3F00010: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_INTERVAL_REG", PC, Value); return; + case 0xA3F00014: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_ROW_REG", PC, Value); return; + case 0xA3F00018: LogMessage("%08X: Writing 0x%08X to RDRAM_RAS_INTERVAL_REG", PC, Value); return; + case 0xA3F0001C: LogMessage("%08X: Writing 0x%08X to RDRAM_MIN_INTERVAL_REG", PC, Value); return; + case 0xA3F00020: LogMessage("%08X: Writing 0x%08X to RDRAM_ADDR_SELECT_REG", PC, Value); return; + case 0xA3F00024: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_MANUF_REG", PC, Value); return; + } + } + if (VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC) + { + return; + } + + if (VAddr >= 0xA4040000 && VAddr <= 0xA404001C) + { + if (!g_LogOptions.LogSPRegisters) + { + return; + } + switch (VAddr) + { + case 0xA4040000: LogMessage("%08X: Writing 0x%08X to SP_MEM_ADDR_REG", PC, Value); return; + case 0xA4040004: LogMessage("%08X: Writing 0x%08X to SP_DRAM_ADDR_REG", PC, Value); return; + case 0xA4040008: LogMessage("%08X: Writing 0x%08X to SP_RD_LEN_REG", PC, Value); return; + case 0xA404000C: LogMessage("%08X: Writing 0x%08X to SP_WR_LEN_REG", PC, Value); return; + case 0xA4040010: LogMessage("%08X: Writing 0x%08X to SP_STATUS_REG", PC, Value); return; + case 0xA4040014: LogMessage("%08X: Writing 0x%08X to SP_DMA_FULL_REG", PC, Value); return; + case 0xA4040018: LogMessage("%08X: Writing 0x%08X to SP_DMA_BUSY_REG", PC, Value); return; + case 0xA404001C: LogMessage("%08X: Writing 0x%08X to SP_SEMAPHORE_REG", PC, Value); return; + } + } + if (VAddr == 0xA4080000) + { + if (!g_LogOptions.LogSPRegisters) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SP_PC", PC, Value); return; + } + + if (VAddr >= 0xA4100000 && VAddr <= 0xA410001C) + { + if (!g_LogOptions.LogDPCRegisters) + { + return; + } + switch (VAddr) + { + case 0xA4100000: LogMessage("%08X: Writing 0x%08X to DPC_START_REG", PC, Value); return; + case 0xA4100004: LogMessage("%08X: Writing 0x%08X to DPC_END_REG", PC, Value); return; + case 0xA4100008: LogMessage("%08X: Writing 0x%08X to DPC_CURRENT_REG", PC, Value); return; + case 0xA410000C: LogMessage("%08X: Writing 0x%08X to DPC_STATUS_REG", PC, Value); return; + case 0xA4100010: LogMessage("%08X: Writing 0x%08X to DPC_CLOCK_REG", PC, Value); return; + case 0xA4100014: LogMessage("%08X: Writing 0x%08X to DPC_BUFBUSY_REG", PC, Value); return; + case 0xA4100018: LogMessage("%08X: Writing 0x%08X to DPC_PIPEBUSY_REG", PC, Value); return; + case 0xA410001C: LogMessage("%08X: Writing 0x%08X to DPC_TMEM_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4200000 && VAddr <= 0xA420000C) + { + if (!g_LogOptions.LogDPSRegisters) + { + return; + } + switch (VAddr) + { + case 0xA4200000: LogMessage("%08X: Writing 0x%08X to DPS_TBIST_REG", PC, Value); return; + case 0xA4200004: LogMessage("%08X: Writing 0x%08X to DPS_TEST_MODE_REG", PC, Value); return; + case 0xA4200008: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_ADDR_REG", PC, Value); return; + case 0xA420000C: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_DATA_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C) + { + if (!g_LogOptions.LogMIPSInterface) + { + return; + } + switch (VAddr) + { + case 0xA4300000: LogMessage("%08X: Writing 0x%08X to MI_INIT_MODE_REG/MI_MODE_REG", PC, Value); return; + case 0xA4300004: LogMessage("%08X: Writing 0x%08X to MI_VERSION_REG/MI_NOOP_REG", PC, Value); return; + case 0xA4300008: LogMessage("%08X: Writing 0x%08X to MI_INTR_REG", PC, Value); return; + case 0xA430000C: LogMessage("%08X: Writing 0x%08X to MI_INTR_MASK_REG", PC, Value); return; + } + } + if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034) + { + if (!g_LogOptions.LogVideoInterface) + { + return; + } + switch (VAddr) + { + case 0xA4400000: LogMessage("%08X: Writing 0x%08X to VI_STATUS_REG/VI_CONTROL_REG", PC, Value); return; + case 0xA4400004: LogMessage("%08X: Writing 0x%08X to VI_ORIGIN_REG/VI_DRAM_ADDR_REG", PC, Value); return; + case 0xA4400008: LogMessage("%08X: Writing 0x%08X to VI_WIDTH_REG/VI_H_WIDTH_REG", PC, Value); return; + case 0xA440000C: LogMessage("%08X: Writing 0x%08X to VI_INTR_REG/VI_V_INTR_REG", PC, Value); return; + case 0xA4400010: LogMessage("%08X: Writing 0x%08X to VI_CURRENT_REG/VI_V_CURRENT_LINE_REG", PC, Value); return; + case 0xA4400014: LogMessage("%08X: Writing 0x%08X to VI_BURST_REG/VI_TIMING_REG", PC, Value); return; + case 0xA4400018: LogMessage("%08X: Writing 0x%08X to VI_V_SYNC_REG", PC, Value); return; + case 0xA440001C: LogMessage("%08X: Writing 0x%08X to VI_H_SYNC_REG", PC, Value); return; + case 0xA4400020: LogMessage("%08X: Writing 0x%08X to VI_LEAP_REG/VI_H_SYNC_LEAP_REG", PC, Value); return; + case 0xA4400024: LogMessage("%08X: Writing 0x%08X to VI_H_START_REG/VI_H_VIDEO_REG", PC, Value); return; + case 0xA4400028: LogMessage("%08X: Writing 0x%08X to VI_V_START_REG/VI_V_VIDEO_REG", PC, Value); return; + case 0xA440002C: LogMessage("%08X: Writing 0x%08X to VI_V_BURST_REG", PC, Value); return; + case 0xA4400030: LogMessage("%08X: Writing 0x%08X to VI_X_SCALE_REG", PC, Value); return; + case 0xA4400034: LogMessage("%08X: Writing 0x%08X to VI_Y_SCALE_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4500000 && VAddr <= 0xA4500014) + { + if (!g_LogOptions.LogAudioInterface) + { + return; + } + switch (VAddr) + { + case 0xA4500000: LogMessage("%08X: Writing 0x%08X to AI_DRAM_ADDR_REG", PC, Value); return; + case 0xA4500004: LogMessage("%08X: Writing 0x%08X to AI_LEN_REG", PC, Value); return; + case 0xA4500008: LogMessage("%08X: Writing 0x%08X to AI_CONTROL_REG", PC, Value); return; + case 0xA450000C: LogMessage("%08X: Writing 0x%08X to AI_STATUS_REG", PC, Value); return; + case 0xA4500010: LogMessage("%08X: Writing 0x%08X to AI_DACRATE_REG", PC, Value); return; + case 0xA4500014: LogMessage("%08X: Writing 0x%08X to AI_BITRATE_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4600000 && VAddr <= 0xA4600030) + { + if (!g_LogOptions.LogPerInterface) + { + return; + } + switch (VAddr) + { + case 0xA4600000: LogMessage("%08X: Writing 0x%08X to PI_DRAM_ADDR_REG", PC, Value); return; + case 0xA4600004: LogMessage("%08X: Writing 0x%08X to PI_CART_ADDR_REG", PC, Value); return; + case 0xA4600008: LogMessage("%08X: Writing 0x%08X to PI_RD_LEN_REG", PC, Value); return; + case 0xA460000C: LogMessage("%08X: Writing 0x%08X to PI_WR_LEN_REG", PC, Value); return; + case 0xA4600010: LogMessage("%08X: Writing 0x%08X to PI_STATUS_REG", PC, Value); return; + case 0xA4600014: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG", PC, Value); return; + case 0xA4600018: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PWD_REG", PC, Value); return; + case 0xA460001C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PGS_REG", PC, Value); return; + case 0xA4600020: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_RLS_REG", PC, Value); return; + case 0xA4600024: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG", PC, Value); return; + case 0xA4600028: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PWD_REG", PC, Value); return; + case 0xA460002C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PGS_REG", PC, Value); return; + case 0xA4600030: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_RLS_REG", PC, Value); return; + } + } + if (VAddr >= 0xA4700000 && VAddr <= 0xA470001C) + { + if (!g_LogOptions.LogRDRAMInterface) + { + return; + } + switch (VAddr) + { + case 0xA4700000: LogMessage("%08X: Writing 0x%08X to RI_MODE_REG", PC, Value); return; + case 0xA4700004: LogMessage("%08X: Writing 0x%08X to RI_CONFIG_REG", PC, Value); return; + case 0xA4700008: LogMessage("%08X: Writing 0x%08X to RI_CURRENT_LOAD_REG", PC, Value); return; + case 0xA470000C: LogMessage("%08X: Writing 0x%08X to RI_SELECT_REG", PC, Value); return; + case 0xA4700010: LogMessage("%08X: Writing 0x%08X to RI_REFRESH_REG/RI_COUNT_REG", PC, Value); return; + case 0xA4700014: LogMessage("%08X: Writing 0x%08X to RI_LATENCY_REG", PC, Value); return; + case 0xA4700018: LogMessage("%08X: Writing 0x%08X to RI_RERROR_REG", PC, Value); return; + case 0xA470001C: LogMessage("%08X: Writing 0x%08X to RI_WERROR_REG", PC, Value); return; + } + } + if (VAddr == 0xA4800000) + { + if (!g_LogOptions.LogSerialInterface) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_DRAM_ADDR_REG", PC, Value); return; + } + if (VAddr == 0xA4800004) + { + if (g_LogOptions.LogPRDMAOperations) + { + LogMessage("%08X: A DMA transfer from the PIF ram has occured", PC); + } + if (!g_LogOptions.LogSerialInterface) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_RD64B_REG", PC, Value); return; + } + if (VAddr == 0xA4800010) + { + if (g_LogOptions.LogPRDMAOperations) + { + LogMessage("%08X: A DMA transfer to the PIF ram has occured", PC); + } + if (!g_LogOptions.LogSerialInterface) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_WR64B_REG", PC, Value); return; + } + if (VAddr == 0xA4800018) + { + if (!g_LogOptions.LogSerialInterface) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_STATUS_REG", PC, Value); return; + } + + if (VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC) + { + if (!g_LogOptions.LogPRDirectMemStores) + { + return; + } + LogMessage("%08X: Writing 0x%08X to Pif Ram at 0x%X", PC, Value, VAddr - 0xBFC007C0); + return; + } + if (!g_LogOptions.LogUnknown) + { + return; + } + LogMessage("%08X: Writing 0x%08X to %08X ????", PC, Value, VAddr); +} + +LRESULT CALLBACK LogPifProc(HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + if (TempOptions.LogPRDMAOperations) { CheckDlgButton(hDlg, IDC_SI_DMA, BST_CHECKED); } + if (TempOptions.LogPRDirectMemLoads) { CheckDlgButton(hDlg, IDC_DIRECT_WRITE, BST_CHECKED); } + if (TempOptions.LogPRDMAMemLoads) { CheckDlgButton(hDlg, IDC_DMA_WRITE, BST_CHECKED); } + if (TempOptions.LogPRDirectMemStores) { CheckDlgButton(hDlg, IDC_DIRECT_READ, BST_CHECKED); } + if (TempOptions.LogPRDMAMemStores) { CheckDlgButton(hDlg, IDC_DMA_READ, BST_CHECKED); } + if (TempOptions.LogControllerPak) { CheckDlgButton(hDlg, IDC_CONT_PAK, BST_CHECKED); } + break; + case WM_NOTIFY: + if (((NMHDR FAR *) lParam)->code != PSN_APPLY) + { + break; + } + TempOptions.LogPRDMAOperations = IsDlgButtonChecked(hDlg, IDC_SI_DMA) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogPRDirectMemLoads = IsDlgButtonChecked(hDlg, IDC_DIRECT_WRITE) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogPRDMAMemLoads = IsDlgButtonChecked(hDlg, IDC_DMA_WRITE) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogPRDirectMemStores = IsDlgButtonChecked(hDlg, IDC_DIRECT_READ) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogPRDMAMemStores = IsDlgButtonChecked(hDlg, IDC_DMA_READ) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogControllerPak = IsDlgButtonChecked(hDlg, IDC_CONT_PAK) == BST_CHECKED ? TRUE : FALSE; + break; + default: + return FALSE; + } + return TRUE; +} + +LRESULT CALLBACK LogRegProc(HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + if (TempOptions.LogRDRamRegisters) { CheckDlgButton(hDlg, IDC_RDRAM, BST_CHECKED); } + if (TempOptions.LogSPRegisters) { CheckDlgButton(hDlg, IDC_SP_REG, BST_CHECKED); } + if (TempOptions.LogDPCRegisters) { CheckDlgButton(hDlg, IDC_DPC_REG, BST_CHECKED); } + if (TempOptions.LogDPSRegisters) { CheckDlgButton(hDlg, IDC_DPS_REG, BST_CHECKED); } + if (TempOptions.LogMIPSInterface) { CheckDlgButton(hDlg, IDC_MI_REG, BST_CHECKED); } + if (TempOptions.LogVideoInterface) { CheckDlgButton(hDlg, IDC_VI_REG, BST_CHECKED); } + if (TempOptions.LogAudioInterface) { CheckDlgButton(hDlg, IDC_AI_REG, BST_CHECKED); } + if (TempOptions.LogPerInterface) { CheckDlgButton(hDlg, IDC_PI_REG, BST_CHECKED); } + if (TempOptions.LogRDRAMInterface) { CheckDlgButton(hDlg, IDC_RI_REG, BST_CHECKED); } + if (TempOptions.LogSerialInterface) { CheckDlgButton(hDlg, IDC_SI_REG, BST_CHECKED); } + break; + case WM_NOTIFY: + if (((NMHDR FAR *) lParam)->code != PSN_APPLY) + { + break; + } + TempOptions.LogRDRamRegisters = IsDlgButtonChecked(hDlg, IDC_RDRAM) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogSPRegisters = IsDlgButtonChecked(hDlg, IDC_SP_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogDPCRegisters = IsDlgButtonChecked(hDlg, IDC_DPC_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogDPSRegisters = IsDlgButtonChecked(hDlg, IDC_DPS_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogMIPSInterface = IsDlgButtonChecked(hDlg, IDC_MI_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogVideoInterface = IsDlgButtonChecked(hDlg, IDC_VI_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogAudioInterface = IsDlgButtonChecked(hDlg, IDC_AI_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogPerInterface = IsDlgButtonChecked(hDlg, IDC_PI_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogRDRAMInterface = IsDlgButtonChecked(hDlg, IDC_RI_REG) == BST_CHECKED ? TRUE : FALSE; + TempOptions.LogSerialInterface = IsDlgButtonChecked(hDlg, IDC_SI_REG) == BST_CHECKED ? TRUE : FALSE; + break; + default: + return FALSE; + } + return TRUE; +} + +void SaveLogSetting(HKEY hKey, char * String, BOOL Value) +{ + DWORD StoreValue = Value; + RegSetValueEx(hKey, String, 0, REG_DWORD, (CONST BYTE *)&StoreValue, sizeof(DWORD)); +} + +void SaveLogOptions(void) +{ + long lResult; + HKEY hKeyResults = 0; + DWORD Disposition = 0; + char String[200]; + + sprintf(String, "Software\\N64 Emulation\\%s\\Logging", g_Settings->LoadStringVal(Setting_ApplicationName).c_str()); + lResult = RegCreateKeyEx(HKEY_CURRENT_USER, String, 0, "", REG_OPTION_NON_VOLATILE, + KEY_ALL_ACCESS, NULL, &hKeyResults, &Disposition); + + SaveLogSetting(hKeyResults, "Log RDRAM", TempOptions.LogRDRamRegisters); + SaveLogSetting(hKeyResults, "Log SP", TempOptions.LogSPRegisters); + SaveLogSetting(hKeyResults, "Log DP Command", TempOptions.LogDPCRegisters); + SaveLogSetting(hKeyResults, "Log DP Span", TempOptions.LogDPSRegisters); + SaveLogSetting(hKeyResults, "Log MIPS Interface (MI)", TempOptions.LogMIPSInterface); + SaveLogSetting(hKeyResults, "Log Video Interface (VI)", TempOptions.LogVideoInterface); + SaveLogSetting(hKeyResults, "Log Audio Interface (AI)", TempOptions.LogAudioInterface); + SaveLogSetting(hKeyResults, "Log Peripheral Interface (PI)", TempOptions.LogPerInterface); + SaveLogSetting(hKeyResults, "Log RDRAM Interface (RI)", TempOptions.LogRDRAMInterface); + SaveLogSetting(hKeyResults, "Log Serial Interface (SI)", TempOptions.LogSerialInterface); + SaveLogSetting(hKeyResults, "Log PifRam DMA Operations", TempOptions.LogPRDMAOperations); + SaveLogSetting(hKeyResults, "Log PifRam Direct Memory Loads", TempOptions.LogPRDirectMemLoads); + SaveLogSetting(hKeyResults, "Log PifRam DMA Memory Loads", TempOptions.LogPRDMAMemLoads); + SaveLogSetting(hKeyResults, "Log PifRam Direct Memory Stores", TempOptions.LogPRDirectMemStores); + SaveLogSetting(hKeyResults, "Log PifRam DMA Memory Stores", TempOptions.LogPRDMAMemStores); + SaveLogSetting(hKeyResults, "Log Controller Pak", TempOptions.LogControllerPak); + SaveLogSetting(hKeyResults, "Log CP0 changes", TempOptions.LogCP0changes); + SaveLogSetting(hKeyResults, "Log CP0 reads", TempOptions.LogCP0reads); + SaveLogSetting(hKeyResults, "Log Exceptions", TempOptions.LogExceptions); + SaveLogSetting(hKeyResults, "No Interrupts", TempOptions.NoInterrupts); + SaveLogSetting(hKeyResults, "Log TLB", TempOptions.LogTLB); + SaveLogSetting(hKeyResults, "Log Cache Operations", TempOptions.LogCache); + SaveLogSetting(hKeyResults, "Log Rom Header", TempOptions.LogRomHeader); + SaveLogSetting(hKeyResults, "Log Unknown access", TempOptions.LogUnknown); + + RegCloseKey(hKeyResults); +} + +void LogMessage(const char * Message, ...) +{ + DWORD dwWritten; + char Msg[400]; + va_list ap; + + if (!g_Settings->LoadBool(Debugger_Enabled)) + { + return; + } + if (g_hLogFile == NULL) + { + return; + } + + va_start(ap, Message); + vsprintf(Msg, Message, ap); + va_end(ap); + + strcat(Msg, "\r\n"); + + WriteFile(g_hLogFile, Msg, strlen(Msg), &dwWritten, NULL); +} + +void StartLog(void) +{ + if (!g_LogOptions.GenerateLog) + { + StopLog(); + return; + } + if (g_hLogFile) + { + return; + } + + CPath LogFile(CPath::MODULE_DIRECTORY); + LogFile.AppendDirectory("Logs"); + LogFile.SetNameExtension("cpudebug.log"); + + g_hLogFile = CreateFile(LogFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); + SetFilePointer(g_hLogFile, 0, NULL, FILE_BEGIN); +} + +void StopLog(void) +{ + if (g_hLogFile) + { + CloseHandle(g_hLogFile); + } + g_hLogFile = NULL; +} \ No newline at end of file diff --git a/Source/Project64/Logging.h b/Source/Project64/User Interface/LoggingUI.h similarity index 100% rename from Source/Project64/Logging.h rename to Source/Project64/User Interface/LoggingUI.h diff --git a/Source/Project64/stdafx.h b/Source/Project64/stdafx.h index 3b2d80888..55e6a56c3 100644 --- a/Source/Project64/stdafx.h +++ b/Source/Project64/stdafx.h @@ -22,7 +22,6 @@ #include #include "Multilanguage.h" #include "User Interface.h" -#include "Logging.h" #include "N64 System.h" #include "Plugin.h" #include "Support.h" From 89fab66ab3b8d0397d4772ead5c952dd8b5cc751 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 13 Nov 2015 17:35:20 +1100 Subject: [PATCH 052/102] [Poject64] Cleanup LanguageSelector.cpp --- .../Multilanguage/LanguageSelector.cpp | 174 +++++++++--------- 1 file changed, 87 insertions(+), 87 deletions(-) diff --git a/Source/Project64/Multilanguage/LanguageSelector.cpp b/Source/Project64/Multilanguage/LanguageSelector.cpp index b1cdf940a..dcc6e9978 100644 --- a/Source/Project64/Multilanguage/LanguageSelector.cpp +++ b/Source/Project64/Multilanguage/LanguageSelector.cpp @@ -15,12 +15,12 @@ CLanguageSelector::CLanguageSelector() { } -void CLanguageSelector::Select ( void ) +void CLanguageSelector::Select(void) { - DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_Lang_Select),NULL,(DLGPROC)LangSelectProc, (LPARAM)this); + DialogBoxParam(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_Lang_Select), NULL, (DLGPROC)LangSelectProc, (LPARAM)this); } -LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +LRESULT CALLBACK CLanguageSelector::LangSelectProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { static HBITMAP hbmpBackgroundTop = NULL; static HFONT hTextFont = NULL; @@ -29,100 +29,100 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM switch (uMsg) { case WM_INITDIALOG: + { + lngClass = (CLanguageSelector *)lParam; + + LanguageList LangList = g_Lang->GetLangList(); + if (LangList.size() == 0) { - lngClass = (CLanguageSelector *)lParam; - - LanguageList LangList = g_Lang->GetLangList(); - if (LangList.size() == 0) - { - EndDialog(hDlg,0); - } - for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++) - { - int index = SendMessageW(GetDlgItem(hDlg,IDC_LANG_SEL),CB_ADDSTRING,0,(WPARAM)Language->LanguageName.c_str()); - if (_wcsicmp(Language->LanguageName.c_str(),L"English") == 0) - { - SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_SETCURSEL,index,0); - } - } - - int Index = SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_GETCURSEL,0,0); - if (Index < 0) - { - SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_SETCURSEL,0,0); - } - - // Use the size of the image - hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL),MAKEINTRESOURCE(IDB_ABOUT_LOGO)); - BITMAP bmTL; - GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); - - hTextFont = ::CreateFont - ( - 18, - 0, - 0, - 0, - FW_NORMAL, - 0, - 0, - 0, - DEFAULT_CHARSET, - OUT_DEFAULT_PRECIS, - CLIP_DEFAULT_PRECIS, - PROOF_QUALITY, - DEFAULT_PITCH|FF_DONTCARE, - "Arial" - ); - SendDlgItemMessage(hDlg,IDC_SELECT_LANG,WM_SETFONT,(WPARAM)hTextFont,TRUE); + EndDialog(hDlg, 0); } - break; + for (LanguageList::iterator Language = LangList.begin(); Language != LangList.end(); Language++) + { + int index = SendMessageW(GetDlgItem(hDlg, IDC_LANG_SEL), CB_ADDSTRING, 0, (WPARAM)Language->LanguageName.c_str()); + if (_wcsicmp(Language->LanguageName.c_str(), L"English") == 0) + { + SendMessage(GetDlgItem(hDlg, IDC_LANG_SEL), CB_SETCURSEL, index, 0); + } + } + + int Index = SendMessage(GetDlgItem(hDlg, IDC_LANG_SEL), CB_GETCURSEL, 0, 0); + if (Index < 0) + { + SendMessage(GetDlgItem(hDlg, IDC_LANG_SEL), CB_SETCURSEL, 0, 0); + } + + // Use the size of the image + hbmpBackgroundTop = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_ABOUT_LOGO)); + BITMAP bmTL; + GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL); + + hTextFont = ::CreateFont + ( + 18, + 0, + 0, + 0, + FW_NORMAL, + 0, + 0, + 0, + DEFAULT_CHARSET, + OUT_DEFAULT_PRECIS, + CLIP_DEFAULT_PRECIS, + PROOF_QUALITY, + DEFAULT_PITCH | FF_DONTCARE, + "Arial" + ); + SendDlgItemMessage(hDlg, IDC_SELECT_LANG, WM_SETFONT, (WPARAM)hTextFont, TRUE); + } + break; case WM_CTLCOLORSTATIC: - { - HDC hdcStatic = (HDC)wParam; - SetTextColor(hdcStatic, RGB(0, 0, 0)); - SetBkMode(hdcStatic, TRANSPARENT); - return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); - } - break; + { + HDC hdcStatic = (HDC)wParam; + SetTextColor(hdcStatic, RGB(0, 0, 0)); + SetBkMode(hdcStatic, TRANSPARENT); + return (LONG)(LRESULT)((HBRUSH)GetStockObject(NULL_BRUSH)); + } + break; case WM_ERASEBKGND: - { - HPEN outline; - HBRUSH fill; - RECT rect; + { + HPEN outline; + HBRUSH fill; + RECT rect; - outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); - fill = CreateSolidBrush(0x00FFFFFF); - SelectObject((HDC)wParam, outline); - SelectObject((HDC)wParam, fill); + outline = CreatePen(PS_SOLID, 1, 0x00FFFFFF); + fill = CreateSolidBrush(0x00FFFFFF); + SelectObject((HDC)wParam, outline); + SelectObject((HDC)wParam, fill); - GetClientRect(hDlg, &rect); + GetClientRect(hDlg, &rect); - Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); - } - break; + Rectangle((HDC)wParam, rect.left, rect.top, rect.right, rect.bottom); + } + break; case WM_PAINT: + { + PAINTSTRUCT ps; + + if (BeginPaint(hDlg, &ps)) { - PAINTSTRUCT ps; + RECT rcClient; + GetClientRect(hDlg, &rcClient); - if (BeginPaint(hDlg,&ps)) - { - RECT rcClient; - GetClientRect(hDlg, &rcClient); + BITMAP bmTL_top; + GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL_top); - BITMAP bmTL_top, bmTL_bottom, bmTL_Middle; - GetObject(hbmpBackgroundTop, sizeof(BITMAP), &bmTL_top); + HDC memdc = CreateCompatibleDC(ps.hdc); + HGDIOBJ save = SelectObject(memdc, hbmpBackgroundTop); + BitBlt(ps.hdc, 0, 0, bmTL_top.bmWidth, bmTL_top.bmHeight, memdc, 0, 0, SRCCOPY); + SelectObject(memdc, save); + DeleteDC(memdc); - HDC memdc = CreateCompatibleDC(ps.hdc); - HGDIOBJ save = SelectObject(memdc, hbmpBackgroundTop); - BitBlt(ps.hdc, 0, 0, bmTL_top.bmWidth, bmTL_top.bmHeight, memdc, 0, 0, SRCCOPY); - SelectObject(memdc, save); - DeleteDC(memdc); - - EndPaint(hDlg,&ps); - } + EndPaint(hDlg, &ps); } - break; + } + break; case WM_COMMAND: switch (LOWORD(wParam)) { @@ -138,17 +138,17 @@ LRESULT CALLBACK CLanguageSelector::LangSelectProc (HWND hDlg, UINT uMsg, WPARAM } { - int Index = SendMessage(GetDlgItem(hDlg,IDC_LANG_SEL),CB_GETCURSEL,0,0); + int Index = SendMessage(GetDlgItem(hDlg, IDC_LANG_SEL), CB_GETCURSEL, 0, 0); if (Index >= 0) { wchar_t String[255]; - SendMessageW(GetDlgItem(hDlg,IDC_LANG_SEL),CB_GETLBTEXT,Index,(LPARAM)String); + SendMessageW(GetDlgItem(hDlg, IDC_LANG_SEL), CB_GETLBTEXT, Index, (LPARAM)String); g_Lang->SetLanguage(String); } } - EndDialog(hDlg,0); + EndDialog(hDlg, 0); break; } default: From 9e744ef180964829ad0892dd6a2fca78dc8e7ad0 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 14 Nov 2015 00:23:43 +1100 Subject: [PATCH 053/102] [Project64] Separate out logging from UI --- Source/Project64/Logging.h | 28 + .../Interpreter/Interpreter Ops 32.cpp | 8 +- .../Interpreter/Interpreter Ops.cpp | 10 +- .../N64 System/Interpreter/Interpreter Ops.h | 1 + Source/Project64/N64 System/Mips/Pif Ram.cpp | 12 +- Source/Project64/N64 System/Mips/Pif Ram.h | 2 + .../N64 System/Mips/Register Class.cpp | 2 +- .../N64 System/Mips/Register Class.h | 3 + Source/Project64/N64 System/N64 Class.cpp | 3 - Source/Project64/N64 System/N64 Class.h | 2 + Source/Project64/Project64.vcproj | 16 + Source/Project64/Project64.vcxproj | 4 + Source/Project64/Project64.vcxproj.filters | 12 + .../Project64/Settings/Logging Settings.cpp | 135 +++ Source/Project64/Settings/Logging Settings.h | 87 ++ Source/Project64/Settings/Settings Class.cpp | 28 +- Source/Project64/Settings/Settings.h | 27 +- Source/Project64/User Interface/LoggingUI.cpp | 876 ++---------------- Source/Project64/User Interface/LoggingUI.h | 43 - .../User Interface/Main Menu Class.cpp | 6 +- Source/Project64/logging.cpp | 628 +++++++++++++ 21 files changed, 1053 insertions(+), 880 deletions(-) create mode 100644 Source/Project64/Logging.h create mode 100644 Source/Project64/Settings/Logging Settings.cpp create mode 100644 Source/Project64/Settings/Logging Settings.h create mode 100644 Source/Project64/logging.cpp diff --git a/Source/Project64/Logging.h b/Source/Project64/Logging.h new file mode 100644 index 000000000..3a98a5a06 --- /dev/null +++ b/Source/Project64/Logging.h @@ -0,0 +1,28 @@ +/**************************************************************************** +* * +* Project64 - A Nintendo 64 emulator. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2012 Project64. All rights reserved. * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* * +****************************************************************************/ +#pragma once +#include +#include + +class CLogging : + public CLogSettings +{ +public: + static void StartLog(void); + static void StopLog(void); + + static void Log_LW(uint32_t PC, uint32_t VAddr); + static void Log_SW(uint32_t PC, uint32_t VAddr, uint32_t Value); + static void LogMessage(const char * Message, ...); + +private: + static CFile * m_hLogFile; +}; \ No newline at end of file diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp index 217a28188..1b8e37aa3 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp @@ -9,7 +9,7 @@ * * ****************************************************************************/ #include "stdafx.h" -#include +#include bool DelaySlotEffectsCompare(uint32_t PC, uint32_t Reg1, uint32_t Reg2); @@ -950,7 +950,7 @@ void R4300iOp32::LW() ADDRESS_ERROR_EXCEPTION(Address, true); } - if (g_LogOptions.GenerateLog) + if (GenerateLog()) { Log_LW((*_PROGRAM_COUNTER), Address); } @@ -1323,7 +1323,7 @@ void R4300iOp32::REGIMM_BGEZAL() /************************** COP0 functions **************************/ void R4300iOp32::COP0_MF() { - if (g_LogOptions.LogCP0reads) + if (LogCP0reads()) { LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); } @@ -1337,7 +1337,7 @@ void R4300iOp32::COP0_MF() void R4300iOp32::COP0_MT() { - if (g_LogOptions.LogCP0changes) + if (LogCP0changes()) { LogMessage("%08X: Writing 0x%X to %s register (Originally: 0x%08X)", (*_PROGRAM_COUNTER), _GPR[m_Opcode.rt].UW[0], CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); if (m_Opcode.rd == 11) //Compare diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp index 49c81c22a..c3c2e7240 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp @@ -1114,7 +1114,7 @@ void R4300iOp::LW() ADDRESS_ERROR_EXCEPTION(Address, true); } - if (g_LogOptions.GenerateLog) + if (GenerateLog()) { Log_LW((*_PROGRAM_COUNTER), Address); } @@ -1293,7 +1293,7 @@ void R4300iOp::SW() { ADDRESS_ERROR_EXCEPTION(Address, false); } - if (g_LogOptions.GenerateLog) + if (GenerateLog()) { Log_SW((*_PROGRAM_COUNTER), Address, _GPR[m_Opcode.rt].UW[0]); } @@ -1443,7 +1443,7 @@ void R4300iOp::SWR() void R4300iOp::CACHE() { - if (!g_LogOptions.LogCache) + if (!LogCache()) { return; } @@ -2089,7 +2089,7 @@ void R4300iOp::REGIMM_BGEZAL() /************************** COP0 functions **************************/ void R4300iOp::COP0_MF() { - if (g_LogOptions.LogCP0reads) + if (LogCP0reads()) { LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); } @@ -2103,7 +2103,7 @@ void R4300iOp::COP0_MF() void R4300iOp::COP0_MT() { - if (g_LogOptions.LogCP0changes) + if (LogCP0changes()) { LogMessage("%08X: Writing 0x%X to %s register (Originally: 0x%08X)", (*_PROGRAM_COUNTER), _GPR[m_Opcode.rt].UW[0], CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); if (m_Opcode.rd == 11) //Compare diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.h b/Source/Project64/N64 System/Interpreter/Interpreter Ops.h index 6c9b6484c..6f607150b 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.h +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.h @@ -11,6 +11,7 @@ #pragma once class R4300iOp : + public CLogging, protected CDebugSettings, protected CSystemRegisters { diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index 05707b241..99ca02bab 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -307,7 +307,7 @@ void CPifRam::SI_DMA_READ() } } - if (g_LogOptions.LogPRDMAMemStores) + if (LogPRDMAMemStores()) { int32_t count; char HexData[100], AsciiData[100], Addon[20]; @@ -393,7 +393,7 @@ void CPifRam::SI_DMA_WRITE() } } - if (g_LogOptions.LogPRDMAMemLoads) + if (LogPRDMAMemLoads()) { int32_t count; char HexData[100], AsciiData[100], Addon[20]; @@ -504,7 +504,7 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command) } break; case 0x02: //read from controller pack - if (g_LogOptions.LogControllerPak) + if (LogControllerPak()) { LogControllerPakData("Read: Before Gettting Results"); } @@ -540,13 +540,13 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command) { Command[1] |= 0x80; } - if (g_LogOptions.LogControllerPak) + if (LogControllerPak()) { LogControllerPakData("Read: After Gettting Results"); } break; case 0x03: //write controller pak - if (g_LogOptions.LogControllerPak) + if (LogControllerPak()) { LogControllerPakData("Write: Before Processing"); } @@ -580,7 +580,7 @@ void CPifRam::ProcessControllerCommand(int Control, BYTE * Command) { Command[1] |= 0x80; } - if (g_LogOptions.LogControllerPak) + if (LogControllerPak()) { LogControllerPakData("Write: After Processing"); } diff --git a/Source/Project64/N64 System/Mips/Pif Ram.h b/Source/Project64/N64 System/Mips/Pif Ram.h index 9cc1fdc42..a7bad744b 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.h +++ b/Source/Project64/N64 System/Mips/Pif Ram.h @@ -10,6 +10,7 @@ ****************************************************************************/ #pragma once +#include class CPifRamSettings { protected: @@ -31,6 +32,7 @@ private: }; class CPifRam : + public CLogging, private CPifRamSettings, private CEeprom { diff --git a/Source/Project64/N64 System/Mips/Register Class.cpp b/Source/Project64/N64 System/Mips/Register Class.cpp index c66ba1fb5..57c3ecc26 100644 --- a/Source/Project64/N64 System/Mips/Register Class.cpp +++ b/Source/Project64/N64 System/Mips/Register Class.cpp @@ -452,7 +452,7 @@ bool CRegisters::DoIntrException(bool DelaySlot) return false; } - if (g_LogOptions.GenerateLog && g_LogOptions.LogExceptions && !g_LogOptions.NoInterrupts) + if (GenerateLog() && LogExceptions() && !LogNoInterrupts()) { LogMessage("%08X: Interrupt Generated", m_PROGRAM_COUNTER); } diff --git a/Source/Project64/N64 System/Mips/Register Class.h b/Source/Project64/N64 System/Mips/Register Class.h index f782c6ceb..c5252f320 100644 --- a/Source/Project64/N64 System/Mips/Register Class.h +++ b/Source/Project64/N64 System/Mips/Register Class.h @@ -11,6 +11,8 @@ #pragma once #include +#include + //CPO registers by name class CP0registers { @@ -516,6 +518,7 @@ class CN64System; class CSystemEvents; class CRegisters : + public CLogging, private CDebugSettings, private CGameSettings, protected CSystemRegisters, diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index 87dfca5d7..5dce95baa 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -9,7 +9,6 @@ * * ****************************************************************************/ #include "stdafx.h" -#include #pragma warning(disable:4355) // Disable 'this' : used in base member initializer list @@ -276,8 +275,6 @@ void CN64System::StartEmulation2(bool NewThread) WriteTrace(TraceDebug, __FUNCTION__ ": Starting"); if (bHaveDebugger()) { - g_LogOptions.GenerateLog = g_Settings->LoadBool(Debugger_GenerateDebugLog); - LoadLogOptions(&g_LogOptions, FALSE); StartLog(); } diff --git a/Source/Project64/N64 System/N64 Class.h b/Source/Project64/N64 System/N64 Class.h index beb835c77..b770e9e05 100644 --- a/Source/Project64/N64 System/N64 Class.h +++ b/Source/Project64/N64 System/N64 Class.h @@ -11,6 +11,7 @@ #pragma once #include +#include typedef std::list EVENT_LIST; @@ -23,6 +24,7 @@ class CRecompiler; //#define TEST_SP_TRACKING //track the SP to make sure all ops pick it up fine class CN64System : + public CLogging, public CMipsMemory_CallBack, public CTLB_CB, private CSystemEvents, diff --git a/Source/Project64/Project64.vcproj b/Source/Project64/Project64.vcproj index 7be04938f..dfd273f31 100644 --- a/Source/Project64/Project64.vcproj +++ b/Source/Project64/Project64.vcproj @@ -188,6 +188,10 @@ RelativePath="Settings\Gui Settings.cpp" > + + @@ -300,6 +304,10 @@ RelativePath="User Interface\Gui Class.cpp" > + + @@ -840,6 +848,10 @@ RelativePath="Settings\Gui Settings.h" > + + @@ -960,6 +972,10 @@ RelativePath="User Interface\Log Class.h" > + + diff --git a/Source/Project64/Project64.vcxproj b/Source/Project64/Project64.vcxproj index 256bc4408..66fd0c3ae 100644 --- a/Source/Project64/Project64.vcxproj +++ b/Source/Project64/Project64.vcxproj @@ -44,10 +44,12 @@ + + Create @@ -176,12 +178,14 @@ + + diff --git a/Source/Project64/Project64.vcxproj.filters b/Source/Project64/Project64.vcxproj.filters index f387c0509..dd0483794 100644 --- a/Source/Project64/Project64.vcxproj.filters +++ b/Source/Project64/Project64.vcxproj.filters @@ -420,6 +420,12 @@ Source Files\User Interface Source + + Source Files\N64 System Source + + + Source Files\N64 System Source + @@ -833,5 +839,11 @@ Header Files\User Interface Headers + + Header Files\N64 System Headers + + + Header Files\Settings Headers + \ No newline at end of file diff --git a/Source/Project64/Settings/Logging Settings.cpp b/Source/Project64/Settings/Logging Settings.cpp new file mode 100644 index 000000000..259a3ad96 --- /dev/null +++ b/Source/Project64/Settings/Logging Settings.cpp @@ -0,0 +1,135 @@ +/**************************************************************************** +* * +* Project64 - A Nintendo 64 emulator. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2012 Project64. All rights reserved. * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* * +****************************************************************************/ +#include "stdafx.h" +#include "Logging Settings.h" + +int CLogSettings::m_RefCount = 0; +bool CLogSettings::m_GenerateLog = 0; +bool CLogSettings::m_LogRDRamRegisters = 0; +bool CLogSettings::m_LogSPRegisters = 0; +bool CLogSettings::m_LogDPCRegisters = 0; +bool CLogSettings::m_LogDPSRegisters = 0; +bool CLogSettings::m_LogMIPSInterface = 0; +bool CLogSettings::m_LogVideoInterface = 0; +bool CLogSettings::m_LogAudioInterface = 0; +bool CLogSettings::m_LogPerInterface = 0; +bool CLogSettings::m_LogRDRAMInterface = 0; +bool CLogSettings::m_LogSerialInterface = 0; +bool CLogSettings::m_LogPRDMAOperations = 0; +bool CLogSettings::m_LogPRDirectMemLoads = 0; +bool CLogSettings::m_LogPRDMAMemLoads = 0; +bool CLogSettings::m_LogPRDirectMemStores = 0; +bool CLogSettings::m_LogPRDMAMemStores = 0; +bool CLogSettings::m_LogControllerPak = 0; +bool CLogSettings::m_LogCP0changes = 0; +bool CLogSettings::m_LogCP0reads = 0; +bool CLogSettings::m_LogTLB = 0; +bool CLogSettings::m_LogExceptions = 0; +bool CLogSettings::m_NoInterrupts = 0; +bool CLogSettings::m_LogCache = 0; +bool CLogSettings::m_LogRomHeader = 0; +bool CLogSettings::m_LogUnknown = 0; + +CLogSettings::CLogSettings() +{ + m_RefCount += 1; + if (m_RefCount == 1) + { + g_Settings->RegisterChangeCB(Logging_GenerateLog, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogRDRamRegisters, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogSPRegisters, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogDPCRegisters, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogDPSRegisters, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogMIPSInterface, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogVideoInterface, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogAudioInterface, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogPerInterface, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogRDRAMInterface, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogSerialInterface, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogPRDMAOperations, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogPRDirectMemLoads, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogPRDMAMemLoads, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogPRDirectMemStores, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogPRDMAMemStores, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogControllerPak, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogCP0changes, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogCP0reads, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogTLB, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogExceptions, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_NoInterrupts, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogCache, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogRomHeader, NULL, RefreshSettings); + g_Settings->RegisterChangeCB(Logging_LogUnknown, NULL, RefreshSettings); + RefreshSettings(NULL); + } +} + +CLogSettings::~CLogSettings() +{ + m_RefCount -= 1; + if (m_RefCount == 0) + { + g_Settings->UnregisterChangeCB(Logging_GenerateLog, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogRDRamRegisters, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogSPRegisters, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogDPCRegisters, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogDPSRegisters, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogMIPSInterface, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogVideoInterface, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogAudioInterface, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogPerInterface, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogRDRAMInterface, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogSerialInterface, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogPRDMAOperations, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogPRDirectMemLoads, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogPRDMAMemLoads, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogPRDirectMemStores, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogPRDMAMemStores, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogControllerPak, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogCP0changes, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogCP0reads, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogTLB, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogExceptions, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_NoInterrupts, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogCache, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogRomHeader, NULL, RefreshSettings); + g_Settings->UnregisterChangeCB(Logging_LogUnknown, NULL, RefreshSettings); + } +} + +void CLogSettings::RefreshSettings(void *) +{ + m_GenerateLog = g_Settings->LoadBool(Logging_GenerateLog); + m_LogRDRamRegisters = g_Settings->LoadBool(Logging_LogRDRamRegisters); + m_LogSPRegisters = g_Settings->LoadBool(Logging_LogSPRegisters); + m_LogDPCRegisters = g_Settings->LoadBool(Logging_LogDPCRegisters); + m_LogDPSRegisters = g_Settings->LoadBool(Logging_LogDPSRegisters); + m_LogMIPSInterface = g_Settings->LoadBool(Logging_LogMIPSInterface); + m_LogVideoInterface = g_Settings->LoadBool(Logging_LogVideoInterface); + m_LogAudioInterface = g_Settings->LoadBool(Logging_LogAudioInterface); + m_LogPerInterface = g_Settings->LoadBool(Logging_LogPerInterface); + m_LogRDRAMInterface = g_Settings->LoadBool(Logging_LogRDRAMInterface); + m_LogSerialInterface = g_Settings->LoadBool(Logging_LogSerialInterface); + m_LogPRDMAOperations = g_Settings->LoadBool(Logging_LogPRDMAOperations); + m_LogPRDirectMemLoads = g_Settings->LoadBool(Logging_LogPRDirectMemLoads); + m_LogPRDMAMemLoads = g_Settings->LoadBool(Logging_LogPRDMAMemLoads); + m_LogPRDirectMemStores = g_Settings->LoadBool(Logging_LogPRDirectMemStores); + m_LogPRDMAMemStores = g_Settings->LoadBool(Logging_LogPRDMAMemStores); + m_LogControllerPak = g_Settings->LoadBool(Logging_LogControllerPak); + m_LogCP0changes = g_Settings->LoadBool(Logging_LogCP0changes); + m_LogCP0reads = g_Settings->LoadBool(Logging_LogCP0reads); + m_LogTLB = g_Settings->LoadBool(Logging_LogTLB); + m_LogExceptions = g_Settings->LoadBool(Logging_LogExceptions); + m_NoInterrupts = g_Settings->LoadBool(Logging_NoInterrupts); + m_LogCache = g_Settings->LoadBool(Logging_LogCache); + m_LogRomHeader = g_Settings->LoadBool(Logging_LogRomHeader); + m_LogUnknown = g_Settings->LoadBool(Logging_LogUnknown); +} \ No newline at end of file diff --git a/Source/Project64/Settings/Logging Settings.h b/Source/Project64/Settings/Logging Settings.h new file mode 100644 index 000000000..279fc5d84 --- /dev/null +++ b/Source/Project64/Settings/Logging Settings.h @@ -0,0 +1,87 @@ +/**************************************************************************** +* * +* Project 64 - A Nintendo 64 emulator. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2012 Project64. All rights reserved. * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* * +****************************************************************************/ +#pragma once + +class CLogSettings +{ +public: + CLogSettings(); + virtual ~CLogSettings(); + + inline static bool GenerateLog ( void ) { return m_GenerateLog; } + + /* Registers Log */ + inline static bool LogRDRamRegisters ( void ) { return m_LogRDRamRegisters; } + inline static bool LogSPRegisters ( void ) { return m_LogSPRegisters; } + inline static bool LogDPCRegisters ( void ) { return m_LogDPCRegisters; } + inline static bool LogDPSRegisters ( void ) { return m_LogDPSRegisters; } + inline static bool LogMIPSInterface ( void ) { return m_LogMIPSInterface; } + inline static bool LogVideoInterface ( void ) { return m_LogVideoInterface; } + inline static bool LogAudioInterface ( void ) { return m_LogAudioInterface; } + inline static bool LogPerInterface ( void ) { return m_LogPerInterface; } + inline static bool LogRDRAMInterface ( void ) { return m_LogRDRAMInterface; } + inline static bool LogSerialInterface ( void ) { return m_LogSerialInterface; } + + /* Pif Ram Log */ + inline static bool LogPRDMAOperations ( void ) { return m_LogPRDMAOperations; } + inline static bool LogPRDirectMemLoads ( void ) { return m_LogPRDirectMemLoads; } + inline static bool LogPRDMAMemLoads ( void ) { return m_LogPRDMAMemLoads; } + inline static bool LogPRDirectMemStores ( void ) { return m_LogPRDirectMemStores; } + inline static bool LogPRDMAMemStores ( void ) { return m_LogPRDMAMemStores; } + inline static bool LogControllerPak ( void ) { return m_LogControllerPak; } + + /* Special Log */ + inline static bool LogCP0changes ( void ) { return m_LogCP0changes; } + inline static bool LogCP0reads ( void ) { return m_LogCP0reads; } + inline static bool LogTLB ( void ) { return m_LogTLB; } + inline static bool LogExceptions ( void ) { return m_LogExceptions; } + inline static bool LogNoInterrupts ( void ) { return m_NoInterrupts; } + inline static bool LogCache ( void ) { return m_LogCache; } + inline static bool LogRomHeader ( void ) { return m_LogRomHeader; } + inline static bool LogUnknown ( void ) { return m_LogUnknown; } + +private: + static void RefreshSettings ( void * ); + + static bool m_GenerateLog; + + /* Registers Log */ + static bool m_LogRDRamRegisters; + static bool m_LogSPRegisters; + static bool m_LogDPCRegisters; + static bool m_LogDPSRegisters; + static bool m_LogMIPSInterface; + static bool m_LogVideoInterface; + static bool m_LogAudioInterface; + static bool m_LogPerInterface; + static bool m_LogRDRAMInterface; + static bool m_LogSerialInterface; + + /* Pif Ram Log */ + static bool m_LogPRDMAOperations; + static bool m_LogPRDirectMemLoads; + static bool m_LogPRDMAMemLoads; + static bool m_LogPRDirectMemStores; + static bool m_LogPRDMAMemStores; + static bool m_LogControllerPak; + + /* Special Log */ + static bool m_LogCP0changes; + static bool m_LogCP0reads; + static bool m_LogTLB; + static bool m_LogExceptions; + static bool m_NoInterrupts; + static bool m_LogCache; + static bool m_LogRomHeader; + static bool m_LogUnknown; + + static int32_t m_RefCount; +}; diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index b6a4a6400..0601df605 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -305,7 +305,6 @@ void CSettings::AddHowToHandleSetting() AddHandler(Debugger_ShowDListAListCount, new CSettingTypeApplication("Debugger", "Show Dlist Alist Count", false)); AddHandler(Debugger_ShowRecompMemSize, new CSettingTypeApplication("Debugger", "Show Recompiler Memory size", false)); AddHandler(Debugger_ShowDivByZero, new CSettingTypeApplication("Debugger", "Show Div by zero", false)); - AddHandler(Debugger_GenerateDebugLog, new CSettingTypeApplication("Debugger", "Generate Debug Code", false)); AddHandler(Debugger_ProfileCode, new CSettingTypeApplication("Debugger", "Profile Code", (uint32_t)false)); AddHandler(Debugger_AppLogLevel, new CSettingTypeApplication("Logging", "Log Level", (uint32_t)TraceError)); AddHandler(Debugger_AppLogFlush, new CSettingTypeApplication("Logging", "Log Auto Flush", (uint32_t)false)); @@ -325,6 +324,33 @@ void CSettings::AddHowToHandleSetting() AddHandler(Plugin_UseHleGfx, new CSettingTypeApplication("RSP", "HLE GFX", true)); AddHandler(Plugin_UseHleAudio, new CSettingTypeApplication("RSP", "HLE Audio", false)); + //Logging + AddHandler(Logging_GenerateLog, new CSettingTypeApplication("Logging", "Generate Log Files", false)); + AddHandler(Logging_LogRDRamRegisters, new CSettingTypeApplication("Logging", "Log RDRam Registers", false)); + AddHandler(Logging_LogSPRegisters, new CSettingTypeApplication("Logging", "Log SP Registers", false)); + AddHandler(Logging_LogDPCRegisters, new CSettingTypeApplication("Logging", "Log DPC Registers", false)); + AddHandler(Logging_LogDPSRegisters, new CSettingTypeApplication("Logging", "Log DPS Registers", false)); + AddHandler(Logging_LogMIPSInterface, new CSettingTypeApplication("Logging", "Log MIPS Interface", false)); + AddHandler(Logging_LogVideoInterface, new CSettingTypeApplication("Logging", "Log Video Interface", false)); + AddHandler(Logging_LogAudioInterface, new CSettingTypeApplication("Logging", "Log Audio Interface", false)); + AddHandler(Logging_LogPerInterface, new CSettingTypeApplication("Logging", "Log Per Interface", false)); + AddHandler(Logging_LogRDRAMInterface, new CSettingTypeApplication("Logging", "Log RDRAM Interface", false)); + AddHandler(Logging_LogSerialInterface, new CSettingTypeApplication("Logging", "Log Serial Interface", false)); + AddHandler(Logging_LogPRDMAOperations, new CSettingTypeApplication("Logging", "Log PR DMA Operations", false)); + AddHandler(Logging_LogPRDirectMemLoads, new CSettingTypeApplication("Logging", "Log PR Direct Mem Loads", false)); + AddHandler(Logging_LogPRDMAMemLoads, new CSettingTypeApplication("Logging", "Log PR DMA Mem Loads", false)); + AddHandler(Logging_LogPRDirectMemStores, new CSettingTypeApplication("Logging", "Log PR Direct Mem Stores", false)); + AddHandler(Logging_LogPRDMAMemStores, new CSettingTypeApplication("Logging", "Log PRDMA Mem Stores", false)); + AddHandler(Logging_LogControllerPak, new CSettingTypeApplication("Logging", "Log Controller Pak", false)); + AddHandler(Logging_LogCP0changes, new CSettingTypeApplication("Logging", "Log CP0 changes", false)); + AddHandler(Logging_LogCP0reads, new CSettingTypeApplication("Logging", "Log CP0 reads", false)); + AddHandler(Logging_LogTLB, new CSettingTypeApplication("Logging", "Log TLB", false)); + AddHandler(Logging_LogExceptions, new CSettingTypeApplication("Logging", "Log Exceptions", false)); + AddHandler(Logging_NoInterrupts, new CSettingTypeApplication("Logging", "No Interrupts", false)); + AddHandler(Logging_LogCache, new CSettingTypeApplication("Logging", "Log Cache", false)); + AddHandler(Logging_LogRomHeader, new CSettingTypeApplication("Logging", "Generate Log Files", false)); + AddHandler(Logging_LogUnknown, new CSettingTypeApplication("Logging", "Log Rom Header", false)); + // cheats AddHandler(Cheat_Entry, new CSettingTypeCheats("")); AddHandler(Cheat_Active, new CSettingTypeGameIndex("Cheat", "", (uint32_t)false)); diff --git a/Source/Project64/Settings/Settings.h b/Source/Project64/Settings/Settings.h index 24b241421..64f1196a6 100644 --- a/Source/Project64/Settings/Settings.h +++ b/Source/Project64/Settings/Settings.h @@ -229,7 +229,6 @@ enum SettingID Debugger_DisableGameFixes, Debugger_AppLogLevel, Debugger_AppLogFlush, - Debugger_GenerateDebugLog, Debugger_ShowDListAListCount, Debugger_ShowRecompMemSize, @@ -245,6 +244,32 @@ enum SettingID Plugin_UseHleGfx, Plugin_UseHleAudio, + Logging_GenerateLog, + Logging_LogRDRamRegisters, + Logging_LogSPRegisters, + Logging_LogDPCRegisters, + Logging_LogDPSRegisters, + Logging_LogMIPSInterface, + Logging_LogVideoInterface, + Logging_LogAudioInterface, + Logging_LogPerInterface, + Logging_LogRDRAMInterface, + Logging_LogSerialInterface, + Logging_LogPRDMAOperations, + Logging_LogPRDirectMemLoads, + Logging_LogPRDMAMemLoads, + Logging_LogPRDirectMemStores, + Logging_LogPRDMAMemStores, + Logging_LogControllerPak, + Logging_LogCP0changes, + Logging_LogCP0reads, + Logging_LogTLB, + Logging_LogExceptions, + Logging_NoInterrupts, + Logging_LogCache, + Logging_LogRomHeader, + Logging_LogUnknown, + //Cheats Cheat_Entry, Cheat_Active, diff --git a/Source/Project64/User Interface/LoggingUI.cpp b/Source/Project64/User Interface/LoggingUI.cpp index ff95a6c56..c60b62f33 100644 --- a/Source/Project64/User Interface/LoggingUI.cpp +++ b/Source/Project64/User Interface/LoggingUI.cpp @@ -9,24 +9,19 @@ * * ****************************************************************************/ #include "stdafx.h" -#include "LoggingUI.h" - +#include +#include #include -void LoadLogSetting(HKEY hKey, char * String, bool * Value); -void SaveLogOptions(void); - LRESULT CALLBACK LogGeneralProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK LogPifProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK LogRegProc(HWND, UINT, WPARAM, LPARAM); -static HANDLE g_hLogFile = NULL; -LOG_OPTIONS g_LogOptions, TempOptions; - void EnterLogOptions(HWND hwndOwner) { PROPSHEETPAGE psp[3]; PROPSHEETHEADER psh; + CLogSettings logSettings; psp[0].dwSize = sizeof(PROPSHEETPAGE); psp[0].dwFlags = PSP_USETITLE; @@ -34,7 +29,7 @@ void EnterLogOptions(HWND hwndOwner) psp[0].pszTemplate = MAKEINTRESOURCE(IDD_Logging_Registers); psp[0].pfnDlgProc = (DLGPROC)LogRegProc; psp[0].pszTitle = "Registers"; - psp[0].lParam = 0; + psp[0].lParam = (LPARAM)&logSettings; psp[0].pfnCallback = NULL; psp[1].dwSize = sizeof(PROPSHEETPAGE); @@ -43,7 +38,7 @@ void EnterLogOptions(HWND hwndOwner) psp[1].pszTemplate = MAKEINTRESOURCE(IDD_Logging_PifRam); psp[1].pfnDlgProc = (DLGPROC)LogPifProc; psp[1].pszTitle = "Pif Ram"; - psp[1].lParam = 0; + psp[1].lParam = (LPARAM)&logSettings; psp[1].pfnCallback = NULL; psp[2].dwSize = sizeof(PROPSHEETPAGE); @@ -52,7 +47,7 @@ void EnterLogOptions(HWND hwndOwner) psp[2].pszTemplate = MAKEINTRESOURCE(IDD_Logging_General); psp[2].pfnDlgProc = (DLGPROC)LogGeneralProc; psp[2].pszTitle = "General"; - psp[2].lParam = 0; + psp[2].lParam = (LPARAM)&logSettings; psp[2].pfnCallback = NULL; psh.dwSize = sizeof(PROPSHEETHEADER); @@ -65,129 +60,36 @@ void EnterLogOptions(HWND hwndOwner) psh.ppsp = (LPCPROPSHEETPAGE)&psp; psh.pfnCallback = NULL; - LoadLogOptions(&TempOptions, TRUE); -#if defined(WINDOWS_UI) PropertySheet(&psh); -#else - g_Notify -> BreakPoint(__FILEW__, __LINE__); -#endif - SaveLogOptions(); - LoadLogOptions(&g_LogOptions, FALSE); return; } -void LoadLogOptions(LOG_OPTIONS * LogOptions, bool AlwaysFill) -{ - int32_t lResult; - HKEY hKeyResults = 0; - char String[200]; - - sprintf(String, "Software\\N64 Emulation\\%s\\Logging", g_Settings->LoadStringVal(Setting_ApplicationName).c_str()); - lResult = RegOpenKeyEx(HKEY_CURRENT_USER, String, 0, KEY_ALL_ACCESS, - &hKeyResults); - - if (lResult == ERROR_SUCCESS) - { - //LoadLogSetting(hKeyResults,"Generate Log File",&LogOptions->GenerateLog); - if (LogOptions->GenerateLog || AlwaysFill) - { - LoadLogSetting(hKeyResults, "Log RDRAM", &LogOptions->LogRDRamRegisters); - LoadLogSetting(hKeyResults, "Log SP", &LogOptions->LogSPRegisters); - LoadLogSetting(hKeyResults, "Log DP Command", &LogOptions->LogDPCRegisters); - LoadLogSetting(hKeyResults, "Log DP Span", &LogOptions->LogDPSRegisters); - LoadLogSetting(hKeyResults, "Log MIPS Interface (MI)", &LogOptions->LogMIPSInterface); - LoadLogSetting(hKeyResults, "Log Video Interface (VI)", &LogOptions->LogVideoInterface); - LoadLogSetting(hKeyResults, "Log Audio Interface (AI)", &LogOptions->LogAudioInterface); - LoadLogSetting(hKeyResults, "Log Peripheral Interface (PI)", &LogOptions->LogPerInterface); - LoadLogSetting(hKeyResults, "Log RDRAM Interface (RI)", &LogOptions->LogRDRAMInterface); - LoadLogSetting(hKeyResults, "Log Serial Interface (SI)", &LogOptions->LogSerialInterface); - LoadLogSetting(hKeyResults, "Log PifRam DMA Operations", &LogOptions->LogPRDMAOperations); - LoadLogSetting(hKeyResults, "Log PifRam Direct Memory Loads", &LogOptions->LogPRDirectMemLoads); - LoadLogSetting(hKeyResults, "Log PifRam DMA Memory Loads", &LogOptions->LogPRDMAMemLoads); - LoadLogSetting(hKeyResults, "Log PifRam Direct Memory Stores", &LogOptions->LogPRDirectMemStores); - LoadLogSetting(hKeyResults, "Log PifRam DMA Memory Stores", &LogOptions->LogPRDMAMemStores); - LoadLogSetting(hKeyResults, "Log Controller Pak", &LogOptions->LogControllerPak); - LoadLogSetting(hKeyResults, "Log CP0 changes", &LogOptions->LogCP0changes); - LoadLogSetting(hKeyResults, "Log CP0 reads", &LogOptions->LogCP0reads); - LoadLogSetting(hKeyResults, "Log Exceptions", &LogOptions->LogExceptions); - LoadLogSetting(hKeyResults, "No Interrupts", &LogOptions->NoInterrupts); - LoadLogSetting(hKeyResults, "Log TLB", &LogOptions->LogTLB); - LoadLogSetting(hKeyResults, "Log Cache Operations", &LogOptions->LogCache); - LoadLogSetting(hKeyResults, "Log Rom Header", &LogOptions->LogRomHeader); - LoadLogSetting(hKeyResults, "Log Unknown access", &LogOptions->LogUnknown); - return; - } - } - - LogOptions->GenerateLog = FALSE; - LogOptions->LogRDRamRegisters = FALSE; - LogOptions->LogSPRegisters = FALSE; - LogOptions->LogDPCRegisters = FALSE; - LogOptions->LogDPSRegisters = FALSE; - LogOptions->LogMIPSInterface = FALSE; - LogOptions->LogVideoInterface = FALSE; - LogOptions->LogAudioInterface = FALSE; - LogOptions->LogPerInterface = FALSE; - LogOptions->LogRDRAMInterface = FALSE; - LogOptions->LogSerialInterface = FALSE; - - LogOptions->LogPRDMAOperations = FALSE; - LogOptions->LogPRDirectMemLoads = FALSE; - LogOptions->LogPRDMAMemLoads = FALSE; - LogOptions->LogPRDirectMemStores = FALSE; - LogOptions->LogPRDMAMemStores = FALSE; - LogOptions->LogControllerPak = FALSE; - - LogOptions->LogCP0changes = FALSE; - LogOptions->LogCP0reads = FALSE; - LogOptions->LogCache = FALSE; - LogOptions->LogExceptions = FALSE; - LogOptions->NoInterrupts = FALSE; - LogOptions->LogTLB = FALSE; - LogOptions->LogRomHeader = FALSE; - LogOptions->LogUnknown = FALSE; -} - -void LoadLogSetting(HKEY hKey, char * String, bool * Value) -{ - DWORD Type, dwResult, Bytes = 4; - int32_t lResult; - - lResult = RegQueryValueEx(hKey, String, 0, &Type, (LPBYTE)(&dwResult), &Bytes); - if (Type == REG_DWORD && lResult == ERROR_SUCCESS) - { - *Value = dwResult != 0; - } - else - { - *Value = FALSE; - } -} - LRESULT CALLBACK LogGeneralProc(HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: - if (TempOptions.LogCP0changes) { CheckDlgButton(hDlg, IDC_CP0_WRITE, BST_CHECKED); } - if (TempOptions.LogCP0reads) { CheckDlgButton(hDlg, IDC_CP0_READ, BST_CHECKED); } - if (TempOptions.LogCache) { CheckDlgButton(hDlg, IDC_CACHE, BST_CHECKED); } - if (TempOptions.LogExceptions) { CheckDlgButton(hDlg, IDC_EXCEPTIONS, BST_CHECKED); } - if (TempOptions.NoInterrupts) { CheckDlgButton(hDlg, IDC_INTERRUPTS, BST_CHECKED); } - if (TempOptions.LogTLB) { CheckDlgButton(hDlg, IDC_TLB, BST_CHECKED); } - if (TempOptions.LogRomHeader) { CheckDlgButton(hDlg, IDC_ROM_HEADER, BST_CHECKED); } - if (TempOptions.LogUnknown) { CheckDlgButton(hDlg, IDC_UNKOWN, BST_CHECKED); } - break; + { + if (CLogSettings::LogCP0changes()) { CheckDlgButton(hDlg, IDC_CP0_WRITE, BST_CHECKED); } + if (CLogSettings::LogCP0reads()) { CheckDlgButton(hDlg, IDC_CP0_READ, BST_CHECKED); } + if (CLogSettings::LogCache()) { CheckDlgButton(hDlg, IDC_CACHE, BST_CHECKED); } + if (CLogSettings::LogExceptions()) { CheckDlgButton(hDlg, IDC_EXCEPTIONS, BST_CHECKED); } + if (CLogSettings::LogNoInterrupts()) { CheckDlgButton(hDlg, IDC_INTERRUPTS, BST_CHECKED); } + if (CLogSettings::LogTLB()) { CheckDlgButton(hDlg, IDC_TLB, BST_CHECKED); } + if (CLogSettings::LogRomHeader()) { CheckDlgButton(hDlg, IDC_ROM_HEADER, BST_CHECKED); } + if (CLogSettings::LogUnknown()) { CheckDlgButton(hDlg, IDC_UNKOWN, BST_CHECKED); } + } + break; case WM_NOTIFY: if (((NMHDR FAR *) lParam)->code != PSN_APPLY) { break; } - TempOptions.LogCP0changes = IsDlgButtonChecked(hDlg, IDC_CP0_WRITE) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogCP0reads = IsDlgButtonChecked(hDlg, IDC_CP0_READ) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogCache = IsDlgButtonChecked(hDlg, IDC_CACHE) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogExceptions = IsDlgButtonChecked(hDlg, IDC_EXCEPTIONS) == BST_CHECKED ? TRUE : FALSE; - TempOptions.NoInterrupts = IsDlgButtonChecked(hDlg, IDC_INTERRUPTS) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogTLB = IsDlgButtonChecked(hDlg, IDC_TLB) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogRomHeader = IsDlgButtonChecked(hDlg, IDC_ROM_HEADER) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogUnknown = IsDlgButtonChecked(hDlg, IDC_UNKOWN) == BST_CHECKED ? TRUE : FALSE; + g_Settings->SaveBool(Logging_LogCP0changes, IsDlgButtonChecked(hDlg, IDC_CP0_WRITE) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogCP0reads, IsDlgButtonChecked(hDlg, IDC_CP0_READ) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogCache, IsDlgButtonChecked(hDlg, IDC_CACHE) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogExceptions, IsDlgButtonChecked(hDlg, IDC_EXCEPTIONS) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_NoInterrupts, IsDlgButtonChecked(hDlg, IDC_INTERRUPTS) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogTLB, IsDlgButtonChecked(hDlg, IDC_TLB) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogRomHeader, IsDlgButtonChecked(hDlg, IDC_ROM_HEADER) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogUnknown, IsDlgButtonChecked(hDlg, IDC_UNKOWN) == BST_CHECKED ? true : false); break; default: return FALSE; @@ -195,587 +97,31 @@ LRESULT CALLBACK LogGeneralProc(HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM return TRUE; } -void Log_LW(uint32_t PC, uint32_t VAddr) -{ - if (!g_LogOptions.GenerateLog) - { - return; - } - - if (VAddr < 0xA0000000 || VAddr >= 0xC0000000) - { - uint32_t PAddr; - if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) - { - if (g_LogOptions.LogUnknown) - { - LogMessage("%08X: read from unknown ??? (%08X)", PC, VAddr); - } - return; - } - VAddr = PAddr + 0xA0000000; - } - - uint32_t Value; - if (VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) - { - return; - } - if (VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) - { - if (!g_LogOptions.LogRDRamRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA3F00000: LogMessage("%08X: read from RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG (%08X)", PC, Value); return; - case 0xA3F00004: LogMessage("%08X: read from RDRAM_DEVICE_ID_REG (%08X)", PC, Value); return; - case 0xA3F00008: LogMessage("%08X: read from RDRAM_DELAY_REG (%08X)", PC, Value); return; - case 0xA3F0000C: LogMessage("%08X: read from RDRAM_MODE_REG (%08X)", PC, Value); return; - case 0xA3F00010: LogMessage("%08X: read from RDRAM_REF_INTERVAL_REG (%08X)", PC, Value); return; - case 0xA3F00014: LogMessage("%08X: read from RDRAM_REF_ROW_REG (%08X)", PC, Value); return; - case 0xA3F00018: LogMessage("%08X: read from RDRAM_RAS_INTERVAL_REG (%08X)", PC, Value); return; - case 0xA3F0001C: LogMessage("%08X: read from RDRAM_MIN_INTERVAL_REG (%08X)", PC, Value); return; - case 0xA3F00020: LogMessage("%08X: read from RDRAM_ADDR_SELECT_REG (%08X)", PC, Value); return; - case 0xA3F00024: LogMessage("%08X: read from RDRAM_DEVICE_MANUF_REG (%08X)", PC, Value); return; - } - } - - if (VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC) - { - return; - } - if (VAddr >= 0xA4040000 && VAddr <= 0xA404001C) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA4040000: LogMessage("%08X: read from SP_MEM_ADDR_REG (%08X)", PC, Value); break; - case 0xA4040004: LogMessage("%08X: read from SP_DRAM_ADDR_REG (%08X)", PC, Value); break; - case 0xA4040008: LogMessage("%08X: read from SP_RD_LEN_REG (%08X)", PC, Value); break; - case 0xA404000C: LogMessage("%08X: read from SP_WR_LEN_REG (%08X)", PC, Value); break; - case 0xA4040010: LogMessage("%08X: read from SP_STATUS_REG (%08X)", PC, Value); break; - case 0xA4040014: LogMessage("%08X: read from SP_DMA_FULL_REG (%08X)", PC, Value); break; - case 0xA4040018: LogMessage("%08X: read from SP_DMA_BUSY_REG (%08X)", PC, Value); break; - case 0xA404001C: LogMessage("%08X: read from SP_SEMAPHORE_REG (%08X)", PC, Value); break; - } - return; - } - if (VAddr == 0xA4080000) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - LogMessage("%08X: read from SP_PC (%08X)", PC, Value); - return; - } - if (VAddr >= 0xA4100000 && VAddr <= 0xA410001C) - { - if (!g_LogOptions.LogDPCRegisters) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA4100000: LogMessage("%08X: read from DPC_START_REG (%08X)", PC, Value); return; - case 0xA4100004: LogMessage("%08X: read from DPC_END_REG (%08X)", PC, Value); return; - case 0xA4100008: LogMessage("%08X: read from DPC_CURRENT_REG (%08X)", PC, Value); return; - case 0xA410000C: LogMessage("%08X: read from DPC_STATUS_REG (%08X)", PC, Value); return; - case 0xA4100010: LogMessage("%08X: read from DPC_CLOCK_REG (%08X)", PC, Value); return; - case 0xA4100014: LogMessage("%08X: read from DPC_BUFBUSY_REG (%08X)", PC, Value); return; - case 0xA4100018: LogMessage("%08X: read from DPC_PIPEBUSY_REG (%08X)", PC, Value); return; - case 0xA410001C: LogMessage("%08X: read from DPC_TMEM_REG (%08X)", PC, Value); return; - } - } - if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C) - { - if (!g_LogOptions.LogMIPSInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA4300000: LogMessage("%08X: read from MI_INIT_MODE_REG/MI_MODE_REG (%08X)", PC, Value); return; - case 0xA4300004: LogMessage("%08X: read from MI_VERSION_REG/MI_NOOP_REG (%08X)", PC, Value); return; - case 0xA4300008: LogMessage("%08X: read from MI_INTR_REG (%08X)", PC, Value); return; - case 0xA430000C: LogMessage("%08X: read from MI_INTR_MASK_REG (%08X)", PC, Value); return; - } - } - if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034) - { - if (!g_LogOptions.LogVideoInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA4400000: LogMessage("%08X: read from VI_STATUS_REG/VI_CONTROL_REG (%08X)", PC, Value); return; - case 0xA4400004: LogMessage("%08X: read from VI_ORIGIN_REG/VI_DRAM_ADDR_REG (%08X)", PC, Value); return; - case 0xA4400008: LogMessage("%08X: read from VI_WIDTH_REG/VI_H_WIDTH_REG (%08X)", PC, Value); return; - case 0xA440000C: LogMessage("%08X: read from VI_INTR_REG/VI_V_INTR_REG (%08X)", PC, Value); return; - case 0xA4400010: LogMessage("%08X: read from VI_CURRENT_REG/VI_V_CURRENT_LINE_REG (%08X)", PC, Value); return; - case 0xA4400014: LogMessage("%08X: read from VI_BURST_REG/VI_TIMING_REG (%08X)", PC, Value); return; - case 0xA4400018: LogMessage("%08X: read from VI_V_SYNC_REG (%08X)", PC, Value); return; - case 0xA440001C: LogMessage("%08X: read from VI_H_SYNC_REG (%08X)", PC, Value); return; - case 0xA4400020: LogMessage("%08X: read from VI_LEAP_REG/VI_H_SYNC_LEAP_REG (%08X)", PC, Value); return; - case 0xA4400024: LogMessage("%08X: read from VI_H_START_REG/VI_H_VIDEO_REG (%08X)", PC, Value); return; - case 0xA4400028: LogMessage("%08X: read from VI_V_START_REG/VI_V_VIDEO_REG (%08X)", PC, Value); return; - case 0xA440002C: LogMessage("%08X: read from VI_V_BURST_REG (%08X)", PC, Value); return; - case 0xA4400030: LogMessage("%08X: read from VI_X_SCALE_REG (%08X)", PC, Value); return; - case 0xA4400034: LogMessage("%08X: read from VI_Y_SCALE_REG (%08X)", PC, Value); return; - } - } - if (VAddr >= 0xA4500000 && VAddr <= 0xA4500014) - { - if (!g_LogOptions.LogAudioInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA4500000: LogMessage("%08X: read from AI_DRAM_ADDR_REG (%08X)", PC, Value); return; - case 0xA4500004: LogMessage("%08X: read from AI_LEN_REG (%08X)", PC, Value); return; - case 0xA4500008: LogMessage("%08X: read from AI_CONTROL_REG (%08X)", PC, Value); return; - case 0xA450000C: LogMessage("%08X: read from AI_STATUS_REG (%08X)", PC, Value); return; - case 0xA4500010: LogMessage("%08X: read from AI_DACRATE_REG (%08X)", PC, Value); return; - case 0xA4500014: LogMessage("%08X: read from AI_BITRATE_REG (%08X)", PC, Value); return; - } - } - if (VAddr >= 0xA4600000 && VAddr <= 0xA4600030) - { - if (!g_LogOptions.LogPerInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA4600000: LogMessage("%08X: read from PI_DRAM_ADDR_REG (%08X)", PC, Value); return; - case 0xA4600004: LogMessage("%08X: read from PI_CART_ADDR_REG (%08X)", PC, Value); return; - case 0xA4600008: LogMessage("%08X: read from PI_RD_LEN_REG (%08X)", PC, Value); return; - case 0xA460000C: LogMessage("%08X: read from PI_WR_LEN_REG (%08X)", PC, Value); return; - case 0xA4600010: LogMessage("%08X: read from PI_STATUS_REG (%08X)", PC, Value); return; - case 0xA4600014: LogMessage("%08X: read from PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG (%08X)", PC, Value); return; - case 0xA4600018: LogMessage("%08X: read from PI_BSD_DOM1_PWD_REG (%08X)", PC, Value); return; - case 0xA460001C: LogMessage("%08X: read from PI_BSD_DOM1_PGS_REG (%08X)", PC, Value); return; - case 0xA4600020: LogMessage("%08X: read from PI_BSD_DOM1_RLS_REG (%08X)", PC, Value); return; - case 0xA4600024: LogMessage("%08X: read from PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG (%08X)", PC, Value); return; - case 0xA4600028: LogMessage("%08X: read from PI_BSD_DOM2_PWD_REG (%08X)", PC, Value); return; - case 0xA460002C: LogMessage("%08X: read from PI_BSD_DOM2_PGS_REG (%08X)", PC, Value); return; - case 0xA4600030: LogMessage("%08X: read from PI_BSD_DOM2_RLS_REG (%08X)", PC, Value); return; - } - } - if (VAddr >= 0xA4700000 && VAddr <= 0xA470001C) - { - if (!g_LogOptions.LogRDRAMInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - - switch (VAddr) - { - case 0xA4700000: LogMessage("%08X: read from RI_MODE_REG (%08X)", PC, Value); return; - case 0xA4700004: LogMessage("%08X: read from RI_CONFIG_REG (%08X)", PC, Value); return; - case 0xA4700008: LogMessage("%08X: read from RI_CURRENT_LOAD_REG (%08X)", PC, Value); return; - case 0xA470000C: LogMessage("%08X: read from RI_SELECT_REG (%08X)", PC, Value); return; - case 0xA4700010: LogMessage("%08X: read from RI_REFRESH_REG/RI_COUNT_REG (%08X)", PC, Value); return; - case 0xA4700014: LogMessage("%08X: read from RI_LATENCY_REG (%08X)", PC, Value); return; - case 0xA4700018: LogMessage("%08X: read from RI_RERROR_REG (%08X)", PC, Value); return; - case 0xA470001C: LogMessage("%08X: read from RI_WERROR_REG (%08X)", PC, Value); return; - } - } - if (VAddr == 0xA4800000) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - LogMessage("%08X: read from SI_DRAM_ADDR_REG (%08X)", PC, Value); - return; - } - if (VAddr == 0xA4800004) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - LogMessage("%08X: read from SI_PIF_ADDR_RD64B_REG (%08X)", PC, Value); - return; - } - if (VAddr == 0xA4800010) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - LogMessage("%08X: read from SI_PIF_ADDR_WR64B_REG (%08X)", PC, Value); - return; - } - if (VAddr == 0xA4800018) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - LogMessage("%08X: read from SI_STATUS_REG (%08X)", PC, Value); - return; - } - if (VAddr >= 0xBFC00000 && VAddr <= 0xBFC007C0) - { - return; - } - if (VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC) - { - if (!g_LogOptions.LogPRDirectMemLoads) - { - return; - } - g_MMU->LW_VAddr(VAddr, Value); - LogMessage("%08X: read word from Pif Ram at 0x%X (%08X)", PC, VAddr - 0xBFC007C0, Value); - return; - } - if (VAddr >= 0xB0000040 && ((VAddr - 0xB0000000) < g_Rom->GetRomSize())) - { - return; - } - if (VAddr >= 0xB0000000 && VAddr < 0xB0000040) - { - if (!g_LogOptions.LogRomHeader) - { - return; - } - - g_MMU->LW_VAddr(VAddr, Value); - switch (VAddr) - { - case 0xB0000004: LogMessage("%08X: read from Rom Clock Rate (%08X)", PC, Value); break; - case 0xB0000008: LogMessage("%08X: read from Rom Boot address offset (%08X)", PC, Value); break; - case 0xB000000C: LogMessage("%08X: read from Rom Release offset (%08X)", PC, Value); break; - case 0xB0000010: LogMessage("%08X: read from Rom CRC1 (%08X)", PC, Value); break; - case 0xB0000014: LogMessage("%08X: read from Rom CRC2 (%08X)", PC, Value); break; - default: LogMessage("%08X: read from Rom header 0x%X (%08X)", PC, VAddr & 0xFF, Value); break; - } - return; - } - if (!g_LogOptions.LogUnknown) - { - return; - } - LogMessage("%08X: read from unknown ??? (%08X)", PC, VAddr); -} - -void Log_SW(uint32_t PC, uint32_t VAddr, uint32_t Value) -{ - if (!g_LogOptions.GenerateLog) - { - return; - } - - if (VAddr < 0xA0000000 || VAddr >= 0xC0000000) - { - uint32_t PAddr; - if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) - { - if (g_LogOptions.LogUnknown) - { - LogMessage("%08X: Writing 0x%08X to %08X", PC, Value, VAddr); - } - return; - } - VAddr = PAddr + 0xA0000000; - } - - if (VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) - { - return; - } - if (VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) - { - if (!g_LogOptions.LogRDRamRegisters) - { - return; - } - switch (VAddr) - { - case 0xA3F00000: LogMessage("%08X: Writing 0x%08X to RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG", PC, Value); return; - case 0xA3F00004: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_ID_REG", PC, Value); return; - case 0xA3F00008: LogMessage("%08X: Writing 0x%08X to RDRAM_DELAY_REG", PC, Value); return; - case 0xA3F0000C: LogMessage("%08X: Writing 0x%08X to RDRAM_MODE_REG", PC, Value); return; - case 0xA3F00010: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_INTERVAL_REG", PC, Value); return; - case 0xA3F00014: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_ROW_REG", PC, Value); return; - case 0xA3F00018: LogMessage("%08X: Writing 0x%08X to RDRAM_RAS_INTERVAL_REG", PC, Value); return; - case 0xA3F0001C: LogMessage("%08X: Writing 0x%08X to RDRAM_MIN_INTERVAL_REG", PC, Value); return; - case 0xA3F00020: LogMessage("%08X: Writing 0x%08X to RDRAM_ADDR_SELECT_REG", PC, Value); return; - case 0xA3F00024: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_MANUF_REG", PC, Value); return; - } - } - if (VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC) - { - return; - } - - if (VAddr >= 0xA4040000 && VAddr <= 0xA404001C) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - switch (VAddr) - { - case 0xA4040000: LogMessage("%08X: Writing 0x%08X to SP_MEM_ADDR_REG", PC, Value); return; - case 0xA4040004: LogMessage("%08X: Writing 0x%08X to SP_DRAM_ADDR_REG", PC, Value); return; - case 0xA4040008: LogMessage("%08X: Writing 0x%08X to SP_RD_LEN_REG", PC, Value); return; - case 0xA404000C: LogMessage("%08X: Writing 0x%08X to SP_WR_LEN_REG", PC, Value); return; - case 0xA4040010: LogMessage("%08X: Writing 0x%08X to SP_STATUS_REG", PC, Value); return; - case 0xA4040014: LogMessage("%08X: Writing 0x%08X to SP_DMA_FULL_REG", PC, Value); return; - case 0xA4040018: LogMessage("%08X: Writing 0x%08X to SP_DMA_BUSY_REG", PC, Value); return; - case 0xA404001C: LogMessage("%08X: Writing 0x%08X to SP_SEMAPHORE_REG", PC, Value); return; - } - } - if (VAddr == 0xA4080000) - { - if (!g_LogOptions.LogSPRegisters) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SP_PC", PC, Value); return; - } - - if (VAddr >= 0xA4100000 && VAddr <= 0xA410001C) - { - if (!g_LogOptions.LogDPCRegisters) - { - return; - } - switch (VAddr) - { - case 0xA4100000: LogMessage("%08X: Writing 0x%08X to DPC_START_REG", PC, Value); return; - case 0xA4100004: LogMessage("%08X: Writing 0x%08X to DPC_END_REG", PC, Value); return; - case 0xA4100008: LogMessage("%08X: Writing 0x%08X to DPC_CURRENT_REG", PC, Value); return; - case 0xA410000C: LogMessage("%08X: Writing 0x%08X to DPC_STATUS_REG", PC, Value); return; - case 0xA4100010: LogMessage("%08X: Writing 0x%08X to DPC_CLOCK_REG", PC, Value); return; - case 0xA4100014: LogMessage("%08X: Writing 0x%08X to DPC_BUFBUSY_REG", PC, Value); return; - case 0xA4100018: LogMessage("%08X: Writing 0x%08X to DPC_PIPEBUSY_REG", PC, Value); return; - case 0xA410001C: LogMessage("%08X: Writing 0x%08X to DPC_TMEM_REG", PC, Value); return; - } - } - - if (VAddr >= 0xA4200000 && VAddr <= 0xA420000C) - { - if (!g_LogOptions.LogDPSRegisters) - { - return; - } - switch (VAddr) - { - case 0xA4200000: LogMessage("%08X: Writing 0x%08X to DPS_TBIST_REG", PC, Value); return; - case 0xA4200004: LogMessage("%08X: Writing 0x%08X to DPS_TEST_MODE_REG", PC, Value); return; - case 0xA4200008: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_ADDR_REG", PC, Value); return; - case 0xA420000C: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_DATA_REG", PC, Value); return; - } - } - - if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C) - { - if (!g_LogOptions.LogMIPSInterface) - { - return; - } - switch (VAddr) - { - case 0xA4300000: LogMessage("%08X: Writing 0x%08X to MI_INIT_MODE_REG/MI_MODE_REG", PC, Value); return; - case 0xA4300004: LogMessage("%08X: Writing 0x%08X to MI_VERSION_REG/MI_NOOP_REG", PC, Value); return; - case 0xA4300008: LogMessage("%08X: Writing 0x%08X to MI_INTR_REG", PC, Value); return; - case 0xA430000C: LogMessage("%08X: Writing 0x%08X to MI_INTR_MASK_REG", PC, Value); return; - } - } - if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034) - { - if (!g_LogOptions.LogVideoInterface) - { - return; - } - switch (VAddr) - { - case 0xA4400000: LogMessage("%08X: Writing 0x%08X to VI_STATUS_REG/VI_CONTROL_REG", PC, Value); return; - case 0xA4400004: LogMessage("%08X: Writing 0x%08X to VI_ORIGIN_REG/VI_DRAM_ADDR_REG", PC, Value); return; - case 0xA4400008: LogMessage("%08X: Writing 0x%08X to VI_WIDTH_REG/VI_H_WIDTH_REG", PC, Value); return; - case 0xA440000C: LogMessage("%08X: Writing 0x%08X to VI_INTR_REG/VI_V_INTR_REG", PC, Value); return; - case 0xA4400010: LogMessage("%08X: Writing 0x%08X to VI_CURRENT_REG/VI_V_CURRENT_LINE_REG", PC, Value); return; - case 0xA4400014: LogMessage("%08X: Writing 0x%08X to VI_BURST_REG/VI_TIMING_REG", PC, Value); return; - case 0xA4400018: LogMessage("%08X: Writing 0x%08X to VI_V_SYNC_REG", PC, Value); return; - case 0xA440001C: LogMessage("%08X: Writing 0x%08X to VI_H_SYNC_REG", PC, Value); return; - case 0xA4400020: LogMessage("%08X: Writing 0x%08X to VI_LEAP_REG/VI_H_SYNC_LEAP_REG", PC, Value); return; - case 0xA4400024: LogMessage("%08X: Writing 0x%08X to VI_H_START_REG/VI_H_VIDEO_REG", PC, Value); return; - case 0xA4400028: LogMessage("%08X: Writing 0x%08X to VI_V_START_REG/VI_V_VIDEO_REG", PC, Value); return; - case 0xA440002C: LogMessage("%08X: Writing 0x%08X to VI_V_BURST_REG", PC, Value); return; - case 0xA4400030: LogMessage("%08X: Writing 0x%08X to VI_X_SCALE_REG", PC, Value); return; - case 0xA4400034: LogMessage("%08X: Writing 0x%08X to VI_Y_SCALE_REG", PC, Value); return; - } - } - - if (VAddr >= 0xA4500000 && VAddr <= 0xA4500014) - { - if (!g_LogOptions.LogAudioInterface) - { - return; - } - switch (VAddr) - { - case 0xA4500000: LogMessage("%08X: Writing 0x%08X to AI_DRAM_ADDR_REG", PC, Value); return; - case 0xA4500004: LogMessage("%08X: Writing 0x%08X to AI_LEN_REG", PC, Value); return; - case 0xA4500008: LogMessage("%08X: Writing 0x%08X to AI_CONTROL_REG", PC, Value); return; - case 0xA450000C: LogMessage("%08X: Writing 0x%08X to AI_STATUS_REG", PC, Value); return; - case 0xA4500010: LogMessage("%08X: Writing 0x%08X to AI_DACRATE_REG", PC, Value); return; - case 0xA4500014: LogMessage("%08X: Writing 0x%08X to AI_BITRATE_REG", PC, Value); return; - } - } - - if (VAddr >= 0xA4600000 && VAddr <= 0xA4600030) - { - if (!g_LogOptions.LogPerInterface) - { - return; - } - switch (VAddr) - { - case 0xA4600000: LogMessage("%08X: Writing 0x%08X to PI_DRAM_ADDR_REG", PC, Value); return; - case 0xA4600004: LogMessage("%08X: Writing 0x%08X to PI_CART_ADDR_REG", PC, Value); return; - case 0xA4600008: LogMessage("%08X: Writing 0x%08X to PI_RD_LEN_REG", PC, Value); return; - case 0xA460000C: LogMessage("%08X: Writing 0x%08X to PI_WR_LEN_REG", PC, Value); return; - case 0xA4600010: LogMessage("%08X: Writing 0x%08X to PI_STATUS_REG", PC, Value); return; - case 0xA4600014: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG", PC, Value); return; - case 0xA4600018: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PWD_REG", PC, Value); return; - case 0xA460001C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PGS_REG", PC, Value); return; - case 0xA4600020: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_RLS_REG", PC, Value); return; - case 0xA4600024: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG", PC, Value); return; - case 0xA4600028: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PWD_REG", PC, Value); return; - case 0xA460002C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PGS_REG", PC, Value); return; - case 0xA4600030: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_RLS_REG", PC, Value); return; - } - } - if (VAddr >= 0xA4700000 && VAddr <= 0xA470001C) - { - if (!g_LogOptions.LogRDRAMInterface) - { - return; - } - switch (VAddr) - { - case 0xA4700000: LogMessage("%08X: Writing 0x%08X to RI_MODE_REG", PC, Value); return; - case 0xA4700004: LogMessage("%08X: Writing 0x%08X to RI_CONFIG_REG", PC, Value); return; - case 0xA4700008: LogMessage("%08X: Writing 0x%08X to RI_CURRENT_LOAD_REG", PC, Value); return; - case 0xA470000C: LogMessage("%08X: Writing 0x%08X to RI_SELECT_REG", PC, Value); return; - case 0xA4700010: LogMessage("%08X: Writing 0x%08X to RI_REFRESH_REG/RI_COUNT_REG", PC, Value); return; - case 0xA4700014: LogMessage("%08X: Writing 0x%08X to RI_LATENCY_REG", PC, Value); return; - case 0xA4700018: LogMessage("%08X: Writing 0x%08X to RI_RERROR_REG", PC, Value); return; - case 0xA470001C: LogMessage("%08X: Writing 0x%08X to RI_WERROR_REG", PC, Value); return; - } - } - if (VAddr == 0xA4800000) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_DRAM_ADDR_REG", PC, Value); return; - } - if (VAddr == 0xA4800004) - { - if (g_LogOptions.LogPRDMAOperations) - { - LogMessage("%08X: A DMA transfer from the PIF ram has occured", PC); - } - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_RD64B_REG", PC, Value); return; - } - if (VAddr == 0xA4800010) - { - if (g_LogOptions.LogPRDMAOperations) - { - LogMessage("%08X: A DMA transfer to the PIF ram has occured", PC); - } - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_WR64B_REG", PC, Value); return; - } - if (VAddr == 0xA4800018) - { - if (!g_LogOptions.LogSerialInterface) - { - return; - } - LogMessage("%08X: Writing 0x%08X to SI_STATUS_REG", PC, Value); return; - } - - if (VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC) - { - if (!g_LogOptions.LogPRDirectMemStores) - { - return; - } - LogMessage("%08X: Writing 0x%08X to Pif Ram at 0x%X", PC, Value, VAddr - 0xBFC007C0); - return; - } - if (!g_LogOptions.LogUnknown) - { - return; - } - LogMessage("%08X: Writing 0x%08X to %08X ????", PC, Value, VAddr); -} - LRESULT CALLBACK LogPifProc(HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lParam) { switch (uMsg) { case WM_INITDIALOG: - if (TempOptions.LogPRDMAOperations) { CheckDlgButton(hDlg, IDC_SI_DMA, BST_CHECKED); } - if (TempOptions.LogPRDirectMemLoads) { CheckDlgButton(hDlg, IDC_DIRECT_WRITE, BST_CHECKED); } - if (TempOptions.LogPRDMAMemLoads) { CheckDlgButton(hDlg, IDC_DMA_WRITE, BST_CHECKED); } - if (TempOptions.LogPRDirectMemStores) { CheckDlgButton(hDlg, IDC_DIRECT_READ, BST_CHECKED); } - if (TempOptions.LogPRDMAMemStores) { CheckDlgButton(hDlg, IDC_DMA_READ, BST_CHECKED); } - if (TempOptions.LogControllerPak) { CheckDlgButton(hDlg, IDC_CONT_PAK, BST_CHECKED); } - break; + { + if (CLogSettings::LogPRDMAOperations()) { CheckDlgButton(hDlg, IDC_SI_DMA, BST_CHECKED); } + if (CLogSettings::LogPRDirectMemLoads()) { CheckDlgButton(hDlg, IDC_DIRECT_WRITE, BST_CHECKED); } + if (CLogSettings::LogPRDMAMemLoads()) { CheckDlgButton(hDlg, IDC_DMA_WRITE, BST_CHECKED); } + if (CLogSettings::LogPRDirectMemStores()) { CheckDlgButton(hDlg, IDC_DIRECT_READ, BST_CHECKED); } + if (CLogSettings::LogPRDMAMemStores()) { CheckDlgButton(hDlg, IDC_DMA_READ, BST_CHECKED); } + if (CLogSettings::LogControllerPak()) { CheckDlgButton(hDlg, IDC_CONT_PAK, BST_CHECKED); } + } + break; case WM_NOTIFY: if (((NMHDR FAR *) lParam)->code != PSN_APPLY) { break; } - TempOptions.LogPRDMAOperations = IsDlgButtonChecked(hDlg, IDC_SI_DMA) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogPRDirectMemLoads = IsDlgButtonChecked(hDlg, IDC_DIRECT_WRITE) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogPRDMAMemLoads = IsDlgButtonChecked(hDlg, IDC_DMA_WRITE) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogPRDirectMemStores = IsDlgButtonChecked(hDlg, IDC_DIRECT_READ) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogPRDMAMemStores = IsDlgButtonChecked(hDlg, IDC_DMA_READ) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogControllerPak = IsDlgButtonChecked(hDlg, IDC_CONT_PAK) == BST_CHECKED ? TRUE : FALSE; + g_Settings->SaveBool(Logging_LogPRDMAOperations, IsDlgButtonChecked(hDlg, IDC_SI_DMA) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogPRDirectMemLoads, IsDlgButtonChecked(hDlg, IDC_DIRECT_WRITE) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogPRDMAMemLoads, IsDlgButtonChecked(hDlg, IDC_DMA_WRITE) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogPRDirectMemStores, IsDlgButtonChecked(hDlg, IDC_DIRECT_READ) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogPRDMAMemStores, IsDlgButtonChecked(hDlg, IDC_DMA_READ) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogControllerPak, IsDlgButtonChecked(hDlg, IDC_CONT_PAK) == BST_CHECKED ? true : false); break; default: return FALSE; @@ -788,133 +134,37 @@ LRESULT CALLBACK LogRegProc(HWND hDlg, UINT uMsg, WPARAM /*wParam*/, LPARAM lPar switch (uMsg) { case WM_INITDIALOG: - if (TempOptions.LogRDRamRegisters) { CheckDlgButton(hDlg, IDC_RDRAM, BST_CHECKED); } - if (TempOptions.LogSPRegisters) { CheckDlgButton(hDlg, IDC_SP_REG, BST_CHECKED); } - if (TempOptions.LogDPCRegisters) { CheckDlgButton(hDlg, IDC_DPC_REG, BST_CHECKED); } - if (TempOptions.LogDPSRegisters) { CheckDlgButton(hDlg, IDC_DPS_REG, BST_CHECKED); } - if (TempOptions.LogMIPSInterface) { CheckDlgButton(hDlg, IDC_MI_REG, BST_CHECKED); } - if (TempOptions.LogVideoInterface) { CheckDlgButton(hDlg, IDC_VI_REG, BST_CHECKED); } - if (TempOptions.LogAudioInterface) { CheckDlgButton(hDlg, IDC_AI_REG, BST_CHECKED); } - if (TempOptions.LogPerInterface) { CheckDlgButton(hDlg, IDC_PI_REG, BST_CHECKED); } - if (TempOptions.LogRDRAMInterface) { CheckDlgButton(hDlg, IDC_RI_REG, BST_CHECKED); } - if (TempOptions.LogSerialInterface) { CheckDlgButton(hDlg, IDC_SI_REG, BST_CHECKED); } - break; + { + if (CLogSettings::LogRDRamRegisters()) { CheckDlgButton(hDlg, IDC_RDRAM, BST_CHECKED); } + if (CLogSettings::LogSPRegisters()) { CheckDlgButton(hDlg, IDC_SP_REG, BST_CHECKED); } + if (CLogSettings::LogDPCRegisters()) { CheckDlgButton(hDlg, IDC_DPC_REG, BST_CHECKED); } + if (CLogSettings::LogDPSRegisters()) { CheckDlgButton(hDlg, IDC_DPS_REG, BST_CHECKED); } + if (CLogSettings::LogMIPSInterface()) { CheckDlgButton(hDlg, IDC_MI_REG, BST_CHECKED); } + if (CLogSettings::LogVideoInterface()) { CheckDlgButton(hDlg, IDC_VI_REG, BST_CHECKED); } + if (CLogSettings::LogAudioInterface()) { CheckDlgButton(hDlg, IDC_AI_REG, BST_CHECKED); } + if (CLogSettings::LogPerInterface()) { CheckDlgButton(hDlg, IDC_PI_REG, BST_CHECKED); } + if (CLogSettings::LogRDRAMInterface()) { CheckDlgButton(hDlg, IDC_RI_REG, BST_CHECKED); } + if (CLogSettings::LogSerialInterface()) { CheckDlgButton(hDlg, IDC_SI_REG, BST_CHECKED); } + } + break; case WM_NOTIFY: if (((NMHDR FAR *) lParam)->code != PSN_APPLY) { break; } - TempOptions.LogRDRamRegisters = IsDlgButtonChecked(hDlg, IDC_RDRAM) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogSPRegisters = IsDlgButtonChecked(hDlg, IDC_SP_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogDPCRegisters = IsDlgButtonChecked(hDlg, IDC_DPC_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogDPSRegisters = IsDlgButtonChecked(hDlg, IDC_DPS_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogMIPSInterface = IsDlgButtonChecked(hDlg, IDC_MI_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogVideoInterface = IsDlgButtonChecked(hDlg, IDC_VI_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogAudioInterface = IsDlgButtonChecked(hDlg, IDC_AI_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogPerInterface = IsDlgButtonChecked(hDlg, IDC_PI_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogRDRAMInterface = IsDlgButtonChecked(hDlg, IDC_RI_REG) == BST_CHECKED ? TRUE : FALSE; - TempOptions.LogSerialInterface = IsDlgButtonChecked(hDlg, IDC_SI_REG) == BST_CHECKED ? TRUE : FALSE; + g_Settings->SaveBool(Logging_LogRDRamRegisters, IsDlgButtonChecked(hDlg, IDC_RDRAM) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogSPRegisters, IsDlgButtonChecked(hDlg, IDC_SP_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogDPCRegisters, IsDlgButtonChecked(hDlg, IDC_DPC_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogDPSRegisters, IsDlgButtonChecked(hDlg, IDC_DPS_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogMIPSInterface, IsDlgButtonChecked(hDlg, IDC_MI_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogVideoInterface, IsDlgButtonChecked(hDlg, IDC_VI_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogAudioInterface, IsDlgButtonChecked(hDlg, IDC_AI_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogPerInterface, IsDlgButtonChecked(hDlg, IDC_PI_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogRDRAMInterface, IsDlgButtonChecked(hDlg, IDC_RI_REG) == BST_CHECKED ? true : false); + g_Settings->SaveBool(Logging_LogSerialInterface, IsDlgButtonChecked(hDlg, IDC_SI_REG) == BST_CHECKED ? true : false); break; default: return FALSE; } return TRUE; -} - -void SaveLogSetting(HKEY hKey, char * String, BOOL Value) -{ - DWORD StoreValue = Value; - RegSetValueEx(hKey, String, 0, REG_DWORD, (CONST BYTE *)&StoreValue, sizeof(DWORD)); -} - -void SaveLogOptions(void) -{ - long lResult; - HKEY hKeyResults = 0; - DWORD Disposition = 0; - char String[200]; - - sprintf(String, "Software\\N64 Emulation\\%s\\Logging", g_Settings->LoadStringVal(Setting_ApplicationName).c_str()); - lResult = RegCreateKeyEx(HKEY_CURRENT_USER, String, 0, "", REG_OPTION_NON_VOLATILE, - KEY_ALL_ACCESS, NULL, &hKeyResults, &Disposition); - - SaveLogSetting(hKeyResults, "Log RDRAM", TempOptions.LogRDRamRegisters); - SaveLogSetting(hKeyResults, "Log SP", TempOptions.LogSPRegisters); - SaveLogSetting(hKeyResults, "Log DP Command", TempOptions.LogDPCRegisters); - SaveLogSetting(hKeyResults, "Log DP Span", TempOptions.LogDPSRegisters); - SaveLogSetting(hKeyResults, "Log MIPS Interface (MI)", TempOptions.LogMIPSInterface); - SaveLogSetting(hKeyResults, "Log Video Interface (VI)", TempOptions.LogVideoInterface); - SaveLogSetting(hKeyResults, "Log Audio Interface (AI)", TempOptions.LogAudioInterface); - SaveLogSetting(hKeyResults, "Log Peripheral Interface (PI)", TempOptions.LogPerInterface); - SaveLogSetting(hKeyResults, "Log RDRAM Interface (RI)", TempOptions.LogRDRAMInterface); - SaveLogSetting(hKeyResults, "Log Serial Interface (SI)", TempOptions.LogSerialInterface); - SaveLogSetting(hKeyResults, "Log PifRam DMA Operations", TempOptions.LogPRDMAOperations); - SaveLogSetting(hKeyResults, "Log PifRam Direct Memory Loads", TempOptions.LogPRDirectMemLoads); - SaveLogSetting(hKeyResults, "Log PifRam DMA Memory Loads", TempOptions.LogPRDMAMemLoads); - SaveLogSetting(hKeyResults, "Log PifRam Direct Memory Stores", TempOptions.LogPRDirectMemStores); - SaveLogSetting(hKeyResults, "Log PifRam DMA Memory Stores", TempOptions.LogPRDMAMemStores); - SaveLogSetting(hKeyResults, "Log Controller Pak", TempOptions.LogControllerPak); - SaveLogSetting(hKeyResults, "Log CP0 changes", TempOptions.LogCP0changes); - SaveLogSetting(hKeyResults, "Log CP0 reads", TempOptions.LogCP0reads); - SaveLogSetting(hKeyResults, "Log Exceptions", TempOptions.LogExceptions); - SaveLogSetting(hKeyResults, "No Interrupts", TempOptions.NoInterrupts); - SaveLogSetting(hKeyResults, "Log TLB", TempOptions.LogTLB); - SaveLogSetting(hKeyResults, "Log Cache Operations", TempOptions.LogCache); - SaveLogSetting(hKeyResults, "Log Rom Header", TempOptions.LogRomHeader); - SaveLogSetting(hKeyResults, "Log Unknown access", TempOptions.LogUnknown); - - RegCloseKey(hKeyResults); -} - -void LogMessage(const char * Message, ...) -{ - DWORD dwWritten; - char Msg[400]; - va_list ap; - - if (!g_Settings->LoadBool(Debugger_Enabled)) - { - return; - } - if (g_hLogFile == NULL) - { - return; - } - - va_start(ap, Message); - vsprintf(Msg, Message, ap); - va_end(ap); - - strcat(Msg, "\r\n"); - - WriteFile(g_hLogFile, Msg, strlen(Msg), &dwWritten, NULL); -} - -void StartLog(void) -{ - if (!g_LogOptions.GenerateLog) - { - StopLog(); - return; - } - if (g_hLogFile) - { - return; - } - - CPath LogFile(CPath::MODULE_DIRECTORY); - LogFile.AppendDirectory("Logs"); - LogFile.SetNameExtension("cpudebug.log"); - - g_hLogFile = CreateFile(LogFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL); - SetFilePointer(g_hLogFile, 0, NULL, FILE_BEGIN); -} - -void StopLog(void) -{ - if (g_hLogFile) - { - CloseHandle(g_hLogFile); - } - g_hLogFile = NULL; } \ No newline at end of file diff --git a/Source/Project64/User Interface/LoggingUI.h b/Source/Project64/User Interface/LoggingUI.h index 9d2f34138..de73fcab0 100644 --- a/Source/Project64/User Interface/LoggingUI.h +++ b/Source/Project64/User Interface/LoggingUI.h @@ -10,47 +10,4 @@ ****************************************************************************/ #pragma once -typedef struct -{ - bool GenerateLog; - - /* Registers Log */ - bool LogRDRamRegisters; - bool LogSPRegisters; - bool LogDPCRegisters; - bool LogDPSRegisters; - bool LogMIPSInterface; - bool LogVideoInterface; - bool LogAudioInterface; - bool LogPerInterface; - bool LogRDRAMInterface; - bool LogSerialInterface; - - /* Pif Ram Log */ - bool LogPRDMAOperations; - bool LogPRDirectMemLoads; - bool LogPRDMAMemLoads; - bool LogPRDirectMemStores; - bool LogPRDMAMemStores; - bool LogControllerPak; - - /* Special Log */ - bool LogCP0changes; - bool LogCP0reads; - bool LogTLB; - bool LogExceptions; - bool NoInterrupts; - bool LogCache; - bool LogRomHeader; - bool LogUnknown; -} LOG_OPTIONS; - -extern LOG_OPTIONS g_LogOptions; - void EnterLogOptions ( HWND hwndOwner ); -void StartLog ( void ); -void StopLog ( void ); -void LoadLogOptions ( LOG_OPTIONS * LogOptions, bool AlwaysFill ); -void Log_LW ( uint32_t PC, uint32_t VAddr ); -void Log_SW ( uint32_t PC, uint32_t VAddr, uint32_t Value ); -void LogMessage ( const char * Message, ... ); diff --git a/Source/Project64/User Interface/Main Menu Class.cpp b/Source/Project64/User Interface/Main Menu Class.cpp index cae92fe2c..7b760a9f5 100644 --- a/Source/Project64/User Interface/Main Menu Class.cpp +++ b/Source/Project64/User Interface/Main Menu Class.cpp @@ -17,6 +17,7 @@ m_Gui(hMainWindow) m_ChangeSettingList.push_back(UserInterface_InFullScreen); m_ChangeSettingList.push_back(UserInterface_AlwaysOnTop); m_ChangeSettingList.push_back(UserInterface_ShowCPUPer); + m_ChangeSettingList.push_back(Logging_GenerateLog); m_ChangeSettingList.push_back(Debugger_ProfileCode); m_ChangeSettingList.push_back(Debugger_ShowTLBMisses); m_ChangeSettingList.push_back(Debugger_ShowUnhandledMemory); @@ -28,7 +29,6 @@ m_Gui(hMainWindow) m_ChangeSettingList.push_back(Debugger_DisableGameFixes); m_ChangeSettingList.push_back(Debugger_AppLogLevel); m_ChangeSettingList.push_back(Debugger_AppLogFlush); - m_ChangeSettingList.push_back(Debugger_GenerateDebugLog); m_ChangeSettingList.push_back(Game_CurrentSaveState); m_ChangeSettingList.push_back(Setting_CurrentLanguage); @@ -506,7 +506,7 @@ bool CMainMenu::ProcessMessage(HWND hWnd, DWORD /*FromAccelerator*/, DWORD MenuI break; case ID_DEBUGGER_LOGOPTIONS: m_Gui->EnterLogOptions(); break; case ID_DEBUGGER_GENERATELOG: - g_Settings->SaveBool(Debugger_GenerateDebugLog, !g_Settings->LoadBool(Debugger_GenerateDebugLog)); + g_Settings->SaveBool(Logging_GenerateLog, !g_Settings->LoadBool(Logging_GenerateLog)); break; case ID_DEBUGGER_DUMPMEMORY: m_Gui->Debug_ShowMemoryDump(); break; case ID_DEBUGGER_SEARCHMEMORY: m_Gui->Debug_ShowMemorySearch(); break; @@ -1087,7 +1087,7 @@ void CMainMenu::FillOutMenu(HMENU hMenu) DebugLoggingMenu.push_back(Item); Item.Reset(ID_DEBUGGER_GENERATELOG, EMPTY_STRING, EMPTY_STDSTR, NULL, L"Generate Log"); - if (g_Settings->LoadBool(Debugger_GenerateDebugLog)) { Item.SetItemTicked(true); } + if (g_Settings->LoadBool(Logging_GenerateLog)) { Item.SetItemTicked(true); } DebugLoggingMenu.push_back(Item); /* Debugger Main Menu diff --git a/Source/Project64/logging.cpp b/Source/Project64/logging.cpp new file mode 100644 index 000000000..f11b6c41e --- /dev/null +++ b/Source/Project64/logging.cpp @@ -0,0 +1,628 @@ +/**************************************************************************** +* * +* Project64 - A Nintendo 64 emulator. * +* http://www.pj64-emu.com/ * +* Copyright (C) 2012 Project64. All rights reserved. * +* * +* License: * +* GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html * +* * +****************************************************************************/ +#include "stdafx.h" +#include "logging.h" +#include +#include +#include +#include +#include + +CFile * CLogging::m_hLogFile = NULL; + +void CLogging::Log_LW(uint32_t PC, uint32_t VAddr) +{ + if (!GenerateLog()) + { + return; + } + + if (VAddr < 0xA0000000 || VAddr >= 0xC0000000) + { + uint32_t PAddr; + if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) + { + if (LogUnknown()) + { + LogMessage("%08X: read from unknown ??? (%08X)", PC, VAddr); + } + return; + } + VAddr = PAddr + 0xA0000000; + } + + uint32_t Value; + if (VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) + { + return; + } + if (VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) + { + if (!LogRDRamRegisters()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA3F00000: LogMessage("%08X: read from RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG (%08X)", PC, Value); return; + case 0xA3F00004: LogMessage("%08X: read from RDRAM_DEVICE_ID_REG (%08X)", PC, Value); return; + case 0xA3F00008: LogMessage("%08X: read from RDRAM_DELAY_REG (%08X)", PC, Value); return; + case 0xA3F0000C: LogMessage("%08X: read from RDRAM_MODE_REG (%08X)", PC, Value); return; + case 0xA3F00010: LogMessage("%08X: read from RDRAM_REF_INTERVAL_REG (%08X)", PC, Value); return; + case 0xA3F00014: LogMessage("%08X: read from RDRAM_REF_ROW_REG (%08X)", PC, Value); return; + case 0xA3F00018: LogMessage("%08X: read from RDRAM_RAS_INTERVAL_REG (%08X)", PC, Value); return; + case 0xA3F0001C: LogMessage("%08X: read from RDRAM_MIN_INTERVAL_REG (%08X)", PC, Value); return; + case 0xA3F00020: LogMessage("%08X: read from RDRAM_ADDR_SELECT_REG (%08X)", PC, Value); return; + case 0xA3F00024: LogMessage("%08X: read from RDRAM_DEVICE_MANUF_REG (%08X)", PC, Value); return; + } + } + + if (VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC) + { + return; + } + if (VAddr >= 0xA4040000 && VAddr <= 0xA404001C) + { + if (!LogSPRegisters()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4040000: LogMessage("%08X: read from SP_MEM_ADDR_REG (%08X)", PC, Value); break; + case 0xA4040004: LogMessage("%08X: read from SP_DRAM_ADDR_REG (%08X)", PC, Value); break; + case 0xA4040008: LogMessage("%08X: read from SP_RD_LEN_REG (%08X)", PC, Value); break; + case 0xA404000C: LogMessage("%08X: read from SP_WR_LEN_REG (%08X)", PC, Value); break; + case 0xA4040010: LogMessage("%08X: read from SP_STATUS_REG (%08X)", PC, Value); break; + case 0xA4040014: LogMessage("%08X: read from SP_DMA_FULL_REG (%08X)", PC, Value); break; + case 0xA4040018: LogMessage("%08X: read from SP_DMA_BUSY_REG (%08X)", PC, Value); break; + case 0xA404001C: LogMessage("%08X: read from SP_SEMAPHORE_REG (%08X)", PC, Value); break; + } + return; + } + if (VAddr == 0xA4080000) + { + if (!LogSPRegisters()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SP_PC (%08X)", PC, Value); + return; + } + if (VAddr >= 0xA4100000 && VAddr <= 0xA410001C) + { + if (!LogDPCRegisters()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4100000: LogMessage("%08X: read from DPC_START_REG (%08X)", PC, Value); return; + case 0xA4100004: LogMessage("%08X: read from DPC_END_REG (%08X)", PC, Value); return; + case 0xA4100008: LogMessage("%08X: read from DPC_CURRENT_REG (%08X)", PC, Value); return; + case 0xA410000C: LogMessage("%08X: read from DPC_STATUS_REG (%08X)", PC, Value); return; + case 0xA4100010: LogMessage("%08X: read from DPC_CLOCK_REG (%08X)", PC, Value); return; + case 0xA4100014: LogMessage("%08X: read from DPC_BUFBUSY_REG (%08X)", PC, Value); return; + case 0xA4100018: LogMessage("%08X: read from DPC_PIPEBUSY_REG (%08X)", PC, Value); return; + case 0xA410001C: LogMessage("%08X: read from DPC_TMEM_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C) + { + if (!LogMIPSInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4300000: LogMessage("%08X: read from MI_INIT_MODE_REG/MI_MODE_REG (%08X)", PC, Value); return; + case 0xA4300004: LogMessage("%08X: read from MI_VERSION_REG/MI_NOOP_REG (%08X)", PC, Value); return; + case 0xA4300008: LogMessage("%08X: read from MI_INTR_REG (%08X)", PC, Value); return; + case 0xA430000C: LogMessage("%08X: read from MI_INTR_MASK_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034) + { + if (!LogVideoInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4400000: LogMessage("%08X: read from VI_STATUS_REG/VI_CONTROL_REG (%08X)", PC, Value); return; + case 0xA4400004: LogMessage("%08X: read from VI_ORIGIN_REG/VI_DRAM_ADDR_REG (%08X)", PC, Value); return; + case 0xA4400008: LogMessage("%08X: read from VI_WIDTH_REG/VI_H_WIDTH_REG (%08X)", PC, Value); return; + case 0xA440000C: LogMessage("%08X: read from VI_INTR_REG/VI_V_INTR_REG (%08X)", PC, Value); return; + case 0xA4400010: LogMessage("%08X: read from VI_CURRENT_REG/VI_V_CURRENT_LINE_REG (%08X)", PC, Value); return; + case 0xA4400014: LogMessage("%08X: read from VI_BURST_REG/VI_TIMING_REG (%08X)", PC, Value); return; + case 0xA4400018: LogMessage("%08X: read from VI_V_SYNC_REG (%08X)", PC, Value); return; + case 0xA440001C: LogMessage("%08X: read from VI_H_SYNC_REG (%08X)", PC, Value); return; + case 0xA4400020: LogMessage("%08X: read from VI_LEAP_REG/VI_H_SYNC_LEAP_REG (%08X)", PC, Value); return; + case 0xA4400024: LogMessage("%08X: read from VI_H_START_REG/VI_H_VIDEO_REG (%08X)", PC, Value); return; + case 0xA4400028: LogMessage("%08X: read from VI_V_START_REG/VI_V_VIDEO_REG (%08X)", PC, Value); return; + case 0xA440002C: LogMessage("%08X: read from VI_V_BURST_REG (%08X)", PC, Value); return; + case 0xA4400030: LogMessage("%08X: read from VI_X_SCALE_REG (%08X)", PC, Value); return; + case 0xA4400034: LogMessage("%08X: read from VI_Y_SCALE_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4500000 && VAddr <= 0xA4500014) + { + if (!LogAudioInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4500000: LogMessage("%08X: read from AI_DRAM_ADDR_REG (%08X)", PC, Value); return; + case 0xA4500004: LogMessage("%08X: read from AI_LEN_REG (%08X)", PC, Value); return; + case 0xA4500008: LogMessage("%08X: read from AI_CONTROL_REG (%08X)", PC, Value); return; + case 0xA450000C: LogMessage("%08X: read from AI_STATUS_REG (%08X)", PC, Value); return; + case 0xA4500010: LogMessage("%08X: read from AI_DACRATE_REG (%08X)", PC, Value); return; + case 0xA4500014: LogMessage("%08X: read from AI_BITRATE_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4600000 && VAddr <= 0xA4600030) + { + if (!LogPerInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4600000: LogMessage("%08X: read from PI_DRAM_ADDR_REG (%08X)", PC, Value); return; + case 0xA4600004: LogMessage("%08X: read from PI_CART_ADDR_REG (%08X)", PC, Value); return; + case 0xA4600008: LogMessage("%08X: read from PI_RD_LEN_REG (%08X)", PC, Value); return; + case 0xA460000C: LogMessage("%08X: read from PI_WR_LEN_REG (%08X)", PC, Value); return; + case 0xA4600010: LogMessage("%08X: read from PI_STATUS_REG (%08X)", PC, Value); return; + case 0xA4600014: LogMessage("%08X: read from PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG (%08X)", PC, Value); return; + case 0xA4600018: LogMessage("%08X: read from PI_BSD_DOM1_PWD_REG (%08X)", PC, Value); return; + case 0xA460001C: LogMessage("%08X: read from PI_BSD_DOM1_PGS_REG (%08X)", PC, Value); return; + case 0xA4600020: LogMessage("%08X: read from PI_BSD_DOM1_RLS_REG (%08X)", PC, Value); return; + case 0xA4600024: LogMessage("%08X: read from PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG (%08X)", PC, Value); return; + case 0xA4600028: LogMessage("%08X: read from PI_BSD_DOM2_PWD_REG (%08X)", PC, Value); return; + case 0xA460002C: LogMessage("%08X: read from PI_BSD_DOM2_PGS_REG (%08X)", PC, Value); return; + case 0xA4600030: LogMessage("%08X: read from PI_BSD_DOM2_RLS_REG (%08X)", PC, Value); return; + } + } + if (VAddr >= 0xA4700000 && VAddr <= 0xA470001C) + { + if (!LogRDRAMInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + + switch (VAddr) + { + case 0xA4700000: LogMessage("%08X: read from RI_MODE_REG (%08X)", PC, Value); return; + case 0xA4700004: LogMessage("%08X: read from RI_CONFIG_REG (%08X)", PC, Value); return; + case 0xA4700008: LogMessage("%08X: read from RI_CURRENT_LOAD_REG (%08X)", PC, Value); return; + case 0xA470000C: LogMessage("%08X: read from RI_SELECT_REG (%08X)", PC, Value); return; + case 0xA4700010: LogMessage("%08X: read from RI_REFRESH_REG/RI_COUNT_REG (%08X)", PC, Value); return; + case 0xA4700014: LogMessage("%08X: read from RI_LATENCY_REG (%08X)", PC, Value); return; + case 0xA4700018: LogMessage("%08X: read from RI_RERROR_REG (%08X)", PC, Value); return; + case 0xA470001C: LogMessage("%08X: read from RI_WERROR_REG (%08X)", PC, Value); return; + } + } + if (VAddr == 0xA4800000) + { + if (!LogSerialInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_DRAM_ADDR_REG (%08X)", PC, Value); + return; + } + if (VAddr == 0xA4800004) + { + if (!LogSerialInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_PIF_ADDR_RD64B_REG (%08X)", PC, Value); + return; + } + if (VAddr == 0xA4800010) + { + if (!LogSerialInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_PIF_ADDR_WR64B_REG (%08X)", PC, Value); + return; + } + if (VAddr == 0xA4800018) + { + if (!LogSerialInterface()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read from SI_STATUS_REG (%08X)", PC, Value); + return; + } + if (VAddr >= 0xBFC00000 && VAddr <= 0xBFC007C0) + { + return; + } + if (VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC) + { + if (!LogPRDirectMemLoads()) + { + return; + } + g_MMU->LW_VAddr(VAddr, Value); + LogMessage("%08X: read word from Pif Ram at 0x%X (%08X)", PC, VAddr - 0xBFC007C0, Value); + return; + } + if (VAddr >= 0xB0000040 && ((VAddr - 0xB0000000) < g_Rom->GetRomSize())) + { + return; + } + if (VAddr >= 0xB0000000 && VAddr < 0xB0000040) + { + if (!LogRomHeader()) + { + return; + } + + g_MMU->LW_VAddr(VAddr, Value); + switch (VAddr) + { + case 0xB0000004: LogMessage("%08X: read from Rom Clock Rate (%08X)", PC, Value); break; + case 0xB0000008: LogMessage("%08X: read from Rom Boot address offset (%08X)", PC, Value); break; + case 0xB000000C: LogMessage("%08X: read from Rom Release offset (%08X)", PC, Value); break; + case 0xB0000010: LogMessage("%08X: read from Rom CRC1 (%08X)", PC, Value); break; + case 0xB0000014: LogMessage("%08X: read from Rom CRC2 (%08X)", PC, Value); break; + default: LogMessage("%08X: read from Rom header 0x%X (%08X)", PC, VAddr & 0xFF, Value); break; + } + return; + } + if (!LogUnknown()) + { + return; + } + LogMessage("%08X: read from unknown ??? (%08X)", PC, VAddr); +} + +void CLogging::Log_SW(uint32_t PC, uint32_t VAddr, uint32_t Value) +{ + if (!GenerateLog()) + { + return; + } + + if (VAddr < 0xA0000000 || VAddr >= 0xC0000000) + { + uint32_t PAddr; + if (!g_TransVaddr->TranslateVaddr(VAddr, PAddr)) + { + if (LogUnknown()) + { + LogMessage("%08X: Writing 0x%08X to %08X", PC, Value, VAddr); + } + return; + } + VAddr = PAddr + 0xA0000000; + } + + if (VAddr >= 0xA0000000 && VAddr < (0xA0000000 + g_MMU->RdramSize())) + { + return; + } + if (VAddr >= 0xA3F00000 && VAddr <= 0xA3F00024) + { + if (!LogRDRamRegisters()) + { + return; + } + switch (VAddr) + { + case 0xA3F00000: LogMessage("%08X: Writing 0x%08X to RDRAM_CONFIG_REG/RDRAM_DEVICE_TYPE_REG", PC, Value); return; + case 0xA3F00004: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_ID_REG", PC, Value); return; + case 0xA3F00008: LogMessage("%08X: Writing 0x%08X to RDRAM_DELAY_REG", PC, Value); return; + case 0xA3F0000C: LogMessage("%08X: Writing 0x%08X to RDRAM_MODE_REG", PC, Value); return; + case 0xA3F00010: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_INTERVAL_REG", PC, Value); return; + case 0xA3F00014: LogMessage("%08X: Writing 0x%08X to RDRAM_REF_ROW_REG", PC, Value); return; + case 0xA3F00018: LogMessage("%08X: Writing 0x%08X to RDRAM_RAS_INTERVAL_REG", PC, Value); return; + case 0xA3F0001C: LogMessage("%08X: Writing 0x%08X to RDRAM_MIN_INTERVAL_REG", PC, Value); return; + case 0xA3F00020: LogMessage("%08X: Writing 0x%08X to RDRAM_ADDR_SELECT_REG", PC, Value); return; + case 0xA3F00024: LogMessage("%08X: Writing 0x%08X to RDRAM_DEVICE_MANUF_REG", PC, Value); return; + } + } + if (VAddr >= 0xA4000000 && VAddr <= 0xA4001FFC) + { + return; + } + + if (VAddr >= 0xA4040000 && VAddr <= 0xA404001C) + { + if (!LogSPRegisters()) + { + return; + } + switch (VAddr) + { + case 0xA4040000: LogMessage("%08X: Writing 0x%08X to SP_MEM_ADDR_REG", PC, Value); return; + case 0xA4040004: LogMessage("%08X: Writing 0x%08X to SP_DRAM_ADDR_REG", PC, Value); return; + case 0xA4040008: LogMessage("%08X: Writing 0x%08X to SP_RD_LEN_REG", PC, Value); return; + case 0xA404000C: LogMessage("%08X: Writing 0x%08X to SP_WR_LEN_REG", PC, Value); return; + case 0xA4040010: LogMessage("%08X: Writing 0x%08X to SP_STATUS_REG", PC, Value); return; + case 0xA4040014: LogMessage("%08X: Writing 0x%08X to SP_DMA_FULL_REG", PC, Value); return; + case 0xA4040018: LogMessage("%08X: Writing 0x%08X to SP_DMA_BUSY_REG", PC, Value); return; + case 0xA404001C: LogMessage("%08X: Writing 0x%08X to SP_SEMAPHORE_REG", PC, Value); return; + } + } + if (VAddr == 0xA4080000) + { + if (!LogSPRegisters()) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SP_PC", PC, Value); return; + } + + if (VAddr >= 0xA4100000 && VAddr <= 0xA410001C) + { + if (!LogDPCRegisters()) + { + return; + } + switch (VAddr) + { + case 0xA4100000: LogMessage("%08X: Writing 0x%08X to DPC_START_REG", PC, Value); return; + case 0xA4100004: LogMessage("%08X: Writing 0x%08X to DPC_END_REG", PC, Value); return; + case 0xA4100008: LogMessage("%08X: Writing 0x%08X to DPC_CURRENT_REG", PC, Value); return; + case 0xA410000C: LogMessage("%08X: Writing 0x%08X to DPC_STATUS_REG", PC, Value); return; + case 0xA4100010: LogMessage("%08X: Writing 0x%08X to DPC_CLOCK_REG", PC, Value); return; + case 0xA4100014: LogMessage("%08X: Writing 0x%08X to DPC_BUFBUSY_REG", PC, Value); return; + case 0xA4100018: LogMessage("%08X: Writing 0x%08X to DPC_PIPEBUSY_REG", PC, Value); return; + case 0xA410001C: LogMessage("%08X: Writing 0x%08X to DPC_TMEM_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4200000 && VAddr <= 0xA420000C) + { + if (!LogDPSRegisters()) + { + return; + } + switch (VAddr) + { + case 0xA4200000: LogMessage("%08X: Writing 0x%08X to DPS_TBIST_REG", PC, Value); return; + case 0xA4200004: LogMessage("%08X: Writing 0x%08X to DPS_TEST_MODE_REG", PC, Value); return; + case 0xA4200008: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_ADDR_REG", PC, Value); return; + case 0xA420000C: LogMessage("%08X: Writing 0x%08X to DPS_BUFTEST_DATA_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4300000 && VAddr <= 0xA430000C) + { + if (!LogMIPSInterface()) + { + return; + } + switch (VAddr) + { + case 0xA4300000: LogMessage("%08X: Writing 0x%08X to MI_INIT_MODE_REG/MI_MODE_REG", PC, Value); return; + case 0xA4300004: LogMessage("%08X: Writing 0x%08X to MI_VERSION_REG/MI_NOOP_REG", PC, Value); return; + case 0xA4300008: LogMessage("%08X: Writing 0x%08X to MI_INTR_REG", PC, Value); return; + case 0xA430000C: LogMessage("%08X: Writing 0x%08X to MI_INTR_MASK_REG", PC, Value); return; + } + } + if (VAddr >= 0xA4400000 && VAddr <= 0xA4400034) + { + if (!LogVideoInterface()) + { + return; + } + switch (VAddr) + { + case 0xA4400000: LogMessage("%08X: Writing 0x%08X to VI_STATUS_REG/VI_CONTROL_REG", PC, Value); return; + case 0xA4400004: LogMessage("%08X: Writing 0x%08X to VI_ORIGIN_REG/VI_DRAM_ADDR_REG", PC, Value); return; + case 0xA4400008: LogMessage("%08X: Writing 0x%08X to VI_WIDTH_REG/VI_H_WIDTH_REG", PC, Value); return; + case 0xA440000C: LogMessage("%08X: Writing 0x%08X to VI_INTR_REG/VI_V_INTR_REG", PC, Value); return; + case 0xA4400010: LogMessage("%08X: Writing 0x%08X to VI_CURRENT_REG/VI_V_CURRENT_LINE_REG", PC, Value); return; + case 0xA4400014: LogMessage("%08X: Writing 0x%08X to VI_BURST_REG/VI_TIMING_REG", PC, Value); return; + case 0xA4400018: LogMessage("%08X: Writing 0x%08X to VI_V_SYNC_REG", PC, Value); return; + case 0xA440001C: LogMessage("%08X: Writing 0x%08X to VI_H_SYNC_REG", PC, Value); return; + case 0xA4400020: LogMessage("%08X: Writing 0x%08X to VI_LEAP_REG/VI_H_SYNC_LEAP_REG", PC, Value); return; + case 0xA4400024: LogMessage("%08X: Writing 0x%08X to VI_H_START_REG/VI_H_VIDEO_REG", PC, Value); return; + case 0xA4400028: LogMessage("%08X: Writing 0x%08X to VI_V_START_REG/VI_V_VIDEO_REG", PC, Value); return; + case 0xA440002C: LogMessage("%08X: Writing 0x%08X to VI_V_BURST_REG", PC, Value); return; + case 0xA4400030: LogMessage("%08X: Writing 0x%08X to VI_X_SCALE_REG", PC, Value); return; + case 0xA4400034: LogMessage("%08X: Writing 0x%08X to VI_Y_SCALE_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4500000 && VAddr <= 0xA4500014) + { + if (!LogAudioInterface()) + { + return; + } + switch (VAddr) + { + case 0xA4500000: LogMessage("%08X: Writing 0x%08X to AI_DRAM_ADDR_REG", PC, Value); return; + case 0xA4500004: LogMessage("%08X: Writing 0x%08X to AI_LEN_REG", PC, Value); return; + case 0xA4500008: LogMessage("%08X: Writing 0x%08X to AI_CONTROL_REG", PC, Value); return; + case 0xA450000C: LogMessage("%08X: Writing 0x%08X to AI_STATUS_REG", PC, Value); return; + case 0xA4500010: LogMessage("%08X: Writing 0x%08X to AI_DACRATE_REG", PC, Value); return; + case 0xA4500014: LogMessage("%08X: Writing 0x%08X to AI_BITRATE_REG", PC, Value); return; + } + } + + if (VAddr >= 0xA4600000 && VAddr <= 0xA4600030) + { + if (!LogPerInterface()) + { + return; + } + switch (VAddr) + { + case 0xA4600000: LogMessage("%08X: Writing 0x%08X to PI_DRAM_ADDR_REG", PC, Value); return; + case 0xA4600004: LogMessage("%08X: Writing 0x%08X to PI_CART_ADDR_REG", PC, Value); return; + case 0xA4600008: LogMessage("%08X: Writing 0x%08X to PI_RD_LEN_REG", PC, Value); return; + case 0xA460000C: LogMessage("%08X: Writing 0x%08X to PI_WR_LEN_REG", PC, Value); return; + case 0xA4600010: LogMessage("%08X: Writing 0x%08X to PI_STATUS_REG", PC, Value); return; + case 0xA4600014: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_LAT_REG/PI_DOMAIN1_REG", PC, Value); return; + case 0xA4600018: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PWD_REG", PC, Value); return; + case 0xA460001C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_PGS_REG", PC, Value); return; + case 0xA4600020: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM1_RLS_REG", PC, Value); return; + case 0xA4600024: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_LAT_REG/PI_DOMAIN2_REG", PC, Value); return; + case 0xA4600028: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PWD_REG", PC, Value); return; + case 0xA460002C: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_PGS_REG", PC, Value); return; + case 0xA4600030: LogMessage("%08X: Writing 0x%08X to PI_BSD_DOM2_RLS_REG", PC, Value); return; + } + } + if (VAddr >= 0xA4700000 && VAddr <= 0xA470001C) + { + if (!LogRDRAMInterface()) + { + return; + } + switch (VAddr) + { + case 0xA4700000: LogMessage("%08X: Writing 0x%08X to RI_MODE_REG", PC, Value); return; + case 0xA4700004: LogMessage("%08X: Writing 0x%08X to RI_CONFIG_REG", PC, Value); return; + case 0xA4700008: LogMessage("%08X: Writing 0x%08X to RI_CURRENT_LOAD_REG", PC, Value); return; + case 0xA470000C: LogMessage("%08X: Writing 0x%08X to RI_SELECT_REG", PC, Value); return; + case 0xA4700010: LogMessage("%08X: Writing 0x%08X to RI_REFRESH_REG/RI_COUNT_REG", PC, Value); return; + case 0xA4700014: LogMessage("%08X: Writing 0x%08X to RI_LATENCY_REG", PC, Value); return; + case 0xA4700018: LogMessage("%08X: Writing 0x%08X to RI_RERROR_REG", PC, Value); return; + case 0xA470001C: LogMessage("%08X: Writing 0x%08X to RI_WERROR_REG", PC, Value); return; + } + } + if (VAddr == 0xA4800000) + { + if (!LogSerialInterface()) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_DRAM_ADDR_REG", PC, Value); return; + } + if (VAddr == 0xA4800004) + { + if (LogPRDMAOperations()) + { + LogMessage("%08X: A DMA transfer from the PIF ram has occured", PC); + } + if (!LogSerialInterface()) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_RD64B_REG", PC, Value); return; + } + if (VAddr == 0xA4800010) + { + if (LogPRDMAOperations()) + { + LogMessage("%08X: A DMA transfer to the PIF ram has occured", PC); + } + if (!LogSerialInterface()) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_PIF_ADDR_WR64B_REG", PC, Value); return; + } + if (VAddr == 0xA4800018) + { + if (!LogSerialInterface()) + { + return; + } + LogMessage("%08X: Writing 0x%08X to SI_STATUS_REG", PC, Value); return; + } + + if (VAddr >= 0xBFC007C0 && VAddr <= 0xBFC007FC) + { + if (!LogPRDirectMemStores()) + { + return; + } + LogMessage("%08X: Writing 0x%08X to Pif Ram at 0x%X", PC, Value, VAddr - 0xBFC007C0); + return; + } + if (!LogUnknown()) + { + return; + } + LogMessage("%08X: Writing 0x%08X to %08X ????", PC, Value, VAddr); +} + +void CLogging::LogMessage(const char * Message, ...) +{ + char Msg[400]; + va_list ap; + + if (!g_Settings->LoadBool(Debugger_Enabled)) + { + return; + } + if (m_hLogFile == NULL) + { + return; + } + + va_start(ap, Message); + vsprintf(Msg, Message, ap); + va_end(ap); + + strcat(Msg, "\r\n"); + + m_hLogFile->Write(Msg,strlen(Msg)); +} + +void CLogging::StartLog(void) +{ + if (!GenerateLog()) + { + StopLog(); + return; + } + if (m_hLogFile != NULL) + { + return; + } + + CPath LogFile(CPath::MODULE_DIRECTORY); + LogFile.AppendDirectory("Logs"); + LogFile.SetNameExtension("cpudebug.log"); + + m_hLogFile = new CFile(LogFile, CFileBase::modeCreate | CFileBase::modeWrite); +} + +void CLogging::StopLog(void) +{ + if (m_hLogFile) + { + delete m_hLogFile; + m_hLogFile = NULL; + } +} \ No newline at end of file From 003bcc9096ff01c1f54fabbdeb1a4764ce0bc718 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 14 Nov 2015 08:15:20 +1100 Subject: [PATCH 054/102] [Project64] Clean up Menu Class.cpp --- .../Project64/User Interface/Menu Class.cpp | 112 +++++++++--------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/Source/Project64/User Interface/Menu Class.cpp b/Source/Project64/User Interface/Menu Class.cpp index 42b4fe3eb..6a97624cd 100644 --- a/Source/Project64/User Interface/Menu Class.cpp +++ b/Source/Project64/User Interface/Menu Class.cpp @@ -1,72 +1,72 @@ #include "stdafx.h" -CBaseMenu::CBaseMenu () : - m_MenuHandle((HMENU)CreateMenu()) +CBaseMenu::CBaseMenu() : +m_MenuHandle((HMENU)CreateMenu()) { } -bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items ) { - if (Items.begin() == Items.end()) { return false; } +bool CBaseMenu::AddMenu(HMENU hMenu, MenuItemList Items) +{ + if (Items.begin() == Items.end()) { return false; } - UINT ItemID, uFlags; - std::wstring Text, String; - for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++) + UINT ItemID, uFlags; + std::wstring Text, String; + for (MenuItemList::iterator MenuItem = Items.begin(); MenuItem != Items.end(); MenuItem++) { - ItemID = MenuItem->ID(); - uFlags = MF_STRING; - Text = g_Lang->GetString(MenuItem->Title()).c_str(); + ItemID = MenuItem->ID(); + uFlags = MF_STRING; + Text = g_Lang->GetString(MenuItem->Title()).c_str(); - if (MenuItem->Title() == EMPTY_STRING && MenuItem->ManualString().length() > 0) + if (MenuItem->Title() == EMPTY_STRING && MenuItem->ManualString().length() > 0) { - Text = MenuItem->ManualString(); - } - if (ItemID == SPLITER) + Text = MenuItem->ManualString(); + } + if (ItemID == SPLITER) { - uFlags |= MF_SEPARATOR; - } - if (MenuItem->ItemTicked()) + uFlags |= MF_SEPARATOR; + } + if (MenuItem->ItemTicked()) { - uFlags |= MFS_CHECKED; - } - if (MenuItem->ItemEnabled()) + uFlags |= MFS_CHECKED; + } + if (MenuItem->ItemEnabled()) { - uFlags |= MFS_ENABLED; - } - else + uFlags |= MFS_ENABLED; + } + else { - uFlags |= MFS_DISABLED; - } - - MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu(); - if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end())) - { - ItemID = (UINT)CreatePopupMenu(); - uFlags |= MF_POPUP; + uFlags |= MFS_DISABLED; + } - AddMenu((HMENU)ItemID,*SubMenu); - } - - if (ItemID == ID_PLUGIN_MENU) - { - ItemID = (UINT)MenuItem->SubMenu(); - uFlags |= MF_POPUP; - MENUITEMINFO lpmii; - - lpmii.cbSize = sizeof(MENUITEMINFO); - lpmii.fMask = MIIM_STATE; - lpmii.fState = 0; - SetMenuItemInfo((HMENU)ItemID, (DWORD)MenuItem->SubMenu(), FALSE,&lpmii); - } - - if (MenuItem->ShortCut().empty() == false) + MenuItemList * SubMenu = (MenuItemList *)MenuItem->SubMenu(); + if (ItemID == SUB_MENU && HIWORD(SubMenu) != 0 && (SubMenu->begin() != SubMenu->end())) { - String = Text; - String += L"\t"; - String += MenuItem->ShortCut(); - Text = String; - } - AppendMenuW(hMenu,uFlags,ItemID,Text.c_str()); - } - return true; -} + ItemID = (UINT)CreatePopupMenu(); + uFlags |= MF_POPUP; + AddMenu((HMENU)ItemID, *SubMenu); + } + + if (ItemID == ID_PLUGIN_MENU) + { + ItemID = (UINT)MenuItem->SubMenu(); + uFlags |= MF_POPUP; + MENUITEMINFO lpmii; + + lpmii.cbSize = sizeof(MENUITEMINFO); + lpmii.fMask = MIIM_STATE; + lpmii.fState = 0; + SetMenuItemInfo((HMENU)ItemID, (DWORD)MenuItem->SubMenu(), FALSE, &lpmii); + } + + if (MenuItem->ShortCut().empty() == false) + { + String = Text; + String += L"\t"; + String += MenuItem->ShortCut(); + Text = String; + } + AppendMenuW(hMenu, uFlags, ItemID, Text.c_str()); + } + return true; +} \ No newline at end of file From eab2acdecf168b971fbd51407236a88bacd53743 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 14 Nov 2015 08:18:36 +1100 Subject: [PATCH 055/102] [Project64] Cleanup main.cpp --- Source/Project64/main.cpp | 181 +++++++++++++++++++------------------- 1 file changed, 91 insertions(+), 90 deletions(-) diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp index 9f38a1d09..0c84246e3 100644 --- a/Source/Project64/main.cpp +++ b/Source/Project64/main.cpp @@ -4,27 +4,27 @@ CTraceFileLog * LogFile = NULL; -void LogLevelChanged (CTraceFileLog * LogFile) +void LogLevelChanged(CTraceFileLog * LogFile) { LogFile->SetTraceLevel((TraceLevel)g_Settings->LoadDword(Debugger_AppLogLevel)); } -void LogFlushChanged (CTraceFileLog * LogFile) +void LogFlushChanged(CTraceFileLog * LogFile) { LogFile->SetFlushFile(g_Settings->LoadDword(Debugger_AppLogFlush) != 0); } -void InitializeLog ( void) +void InitializeLog(void) { CPath LogFilePath(CPath::MODULE_DIRECTORY); LogFilePath.AppendDirectory("Logs"); if (!LogFilePath.DirectoryExists()) { - LogFilePath.DirectoryCreate(); + LogFilePath.DirectoryCreate(); } LogFilePath.SetNameExtension("Project64.log"); - LogFile = new CTraceFileLog(LogFilePath, g_Settings->LoadDword(Debugger_AppLogFlush) != 0, Log_New,500); + LogFile = new CTraceFileLog(LogFilePath, g_Settings->LoadDword(Debugger_AppLogFlush) != 0, Log_New, 500); #ifdef VALIDATE_DEBUG LogFile->SetTraceLevel((TraceLevel)(g_Settings->LoadDword(Debugger_AppLogLevel) | TraceValidate | TraceDebug)); #else @@ -32,8 +32,8 @@ void InitializeLog ( void) #endif AddTraceModule(LogFile); - g_Settings->RegisterChangeCB(Debugger_AppLogLevel,LogFile,(CSettings::SettingChangedFunc)LogLevelChanged); - g_Settings->RegisterChangeCB(Debugger_AppLogFlush,LogFile,(CSettings::SettingChangedFunc)LogFlushChanged); + g_Settings->RegisterChangeCB(Debugger_AppLogLevel, LogFile, (CSettings::SettingChangedFunc)LogLevelChanged); + g_Settings->RegisterChangeCB(Debugger_AppLogFlush, LogFile, (CSettings::SettingChangedFunc)LogFlushChanged); } /*bool ChangeDirPermission ( const CPath & Dir) @@ -92,27 +92,27 @@ CloseHandle(hDir); return true; }*/ -void FixDirectories ( void ) +void FixDirectories(void) { - CPath Directory(CPath::MODULE_DIRECTORY); - Directory.AppendDirectory("Config"); - if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); + CPath Directory(CPath::MODULE_DIRECTORY); + Directory.AppendDirectory("Config"); + if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); - Directory.UpDirectory(); - Directory.AppendDirectory("Logs"); - if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); + Directory.UpDirectory(); + Directory.AppendDirectory("Logs"); + if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); - Directory.UpDirectory(); - Directory.AppendDirectory("Save"); - if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); + Directory.UpDirectory(); + Directory.AppendDirectory("Save"); + if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); - Directory.UpDirectory(); - Directory.AppendDirectory("Screenshots"); - if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); + Directory.UpDirectory(); + Directory.AppendDirectory("Screenshots"); + if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); - Directory.UpDirectory(); - Directory.AppendDirectory("textures"); - if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); + Directory.UpDirectory(); + Directory.AppendDirectory("textures"); + if (!Directory.DirectoryExists()) Directory.DirectoryCreate(); } bool TerminatedExistingEmu() @@ -122,7 +122,7 @@ bool TerminatedExistingEmu() DWORD pid = GetCurrentProcessId(); HANDLE nSearch = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); - if(nSearch != INVALID_HANDLE_VALUE) + if (nSearch != INVALID_HANDLE_VALUE) { PROCESSENTRY32 lppe; @@ -134,7 +134,7 @@ bool TerminatedExistingEmu() { do { - if(_stricmp(lppe.szExeFile, ModuleName.c_str()) != 0 || + if (_stricmp(lppe.szExeFile, ModuleName.c_str()) != 0 || lppe.th32ProcessID == pid) { continue; @@ -142,20 +142,21 @@ bool TerminatedExistingEmu() if (!AskedUser) { AskedUser = true; - int res = MessageBox(NULL,stdstr_f("Project64.exe currently running\n\nTerminate pid %d now?",lppe.th32ProcessID).c_str(),"Terminate project64",MB_YESNO|MB_ICONEXCLAMATION); + int res = MessageBox(NULL, stdstr_f("Project64.exe currently running\n\nTerminate pid %d now?", lppe.th32ProcessID).c_str(), "Terminate project64", MB_YESNO | MB_ICONEXCLAMATION); if (res != IDYES) { break; } } HANDLE hHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, lppe.th32ProcessID); - if(hHandle != NULL) + if (hHandle != NULL) { if (TerminateProcess(hHandle, 0)) { bTerminated = true; - } else { - MessageBox(NULL,stdstr_f("Failed to terminate pid %d",lppe.th32ProcessID).c_str(),"Terminate project64 failed!",MB_YESNO|MB_ICONEXCLAMATION); + } + else { + MessageBox(NULL, stdstr_f("Failed to terminate pid %d", lppe.th32ProcessID).c_str(), "Terminate project64 failed!", MB_YESNO | MB_ICONEXCLAMATION); } CloseHandle(hHandle); } @@ -166,7 +167,7 @@ bool TerminatedExistingEmu() return bTerminated; } -const char * AppName ( void ) +const char * AppName(void) { static stdstr Name; if (Name.empty()) @@ -188,67 +189,66 @@ int main(int argc, char* argv[]) fprintf( stderr, "Cross-platform (graphical/terminal?) UI not yet implemented.\n" - ); + ); return 0; } #else int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpszArgs*/, int /*nWinMode*/) { - FixDirectories(); + FixDirectories(); - char *lbuffer = new char[10]; - if (GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, lbuffer, 10)) - setlocale(LC_ALL, lbuffer); - delete[] lbuffer; + char *lbuffer = new char[10]; + if (GetLocaleInfoA(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, lbuffer, 10)) + setlocale(LC_ALL, lbuffer); + delete[] lbuffer; - CoInitialize(NULL); + CoInitialize(NULL); try { - SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL ); - g_Settings = new CSettings; - g_Settings->Initialize(AppName()); + SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); + g_Settings = new CSettings; + g_Settings->Initialize(AppName()); - if (g_Settings->LoadBool(Setting_CheckEmuRunning) && - TerminatedExistingEmu()) - { - delete g_Settings; - g_Settings = new CSettings; - g_Settings->Initialize(AppName()); - } + if (g_Settings->LoadBool(Setting_CheckEmuRunning) && + TerminatedExistingEmu()) + { + delete g_Settings; + g_Settings = new CSettings; + g_Settings->Initialize(AppName()); + } - InitializeLog(); - - WriteTrace(TraceDebug,__FUNCTION__ ": Application Starting"); - CMipsMemoryVM::ReserveMemory(); + InitializeLog(); - g_Notify = &Notify(); + WriteTrace(TraceDebug, __FUNCTION__ ": Application Starting"); + CMipsMemoryVM::ReserveMemory(); - //Create the plugin container - WriteTrace(TraceDebug,__FUNCTION__ ": Create Plugins"); - g_Plugins = new CPlugins(g_Settings->LoadStringVal(Directory_Plugin)); + g_Notify = &Notify(); - //Select the language - g_Lang = new CLanguage(); - if (!g_Lang->LoadCurrentStrings()) - { - CLanguageSelector().Select(); - } + //Create the plugin container + WriteTrace(TraceDebug, __FUNCTION__ ": Create Plugins"); + g_Plugins = new CPlugins(g_Settings->LoadStringVal(Directory_Plugin)); + //Select the language + g_Lang = new CLanguage(); + if (!g_Lang->LoadCurrentStrings()) + { + CLanguageSelector().Select(); + } //Create the main window with Menu - WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window"); - stdstr WinTitle(AppName()); + WriteTrace(TraceDebug, __FUNCTION__ ": Create Main Window"); + stdstr WinTitle(AppName()); - WinTitle.Format("Project64 %s", VER_FILE_VERSION_STR); + WinTitle.Format("Project64 %s", VER_FILE_VERSION_STR); - CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false); + CMainGui MainWindow(true, WinTitle.c_str()), HiddenWindow(false); CMainMenu MainMenu(&MainWindow); - g_Plugins->SetRenderWindows(&MainWindow,&HiddenWindow); - Notify().SetMainWindow(&MainWindow); + g_Plugins->SetRenderWindows(&MainWindow, &HiddenWindow); + Notify().SetMainWindow(&MainWindow); if (__argc > 1) { - WriteTraceF(TraceDebug,__FUNCTION__ ": Cmd line found \"%s\"",__argv[1]); + WriteTraceF(TraceDebug, __FUNCTION__ ": Cmd line found \"%s\"", __argv[1]); MainWindow.Show(true); //Show the main window CN64System::RunFileImage(__argv[1]); } @@ -256,21 +256,22 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR / { if (g_Settings->LoadDword(RomBrowser_Enabled)) { - WriteTrace(TraceDebug,__FUNCTION__ ": Show Rom Browser"); + WriteTrace(TraceDebug, __FUNCTION__ ": Show Rom Browser"); //Display the rom browser MainWindow.ShowRomList(); MainWindow.Show(true); //Show the main window MainWindow.HighLightLastRom(); - } else { - WriteTrace(TraceDebug,__FUNCTION__ ": Show Main Window"); + } + else { + WriteTrace(TraceDebug, __FUNCTION__ ": Show Main Window"); MainWindow.Show(true); //Show the main window } } //Process Messages till program is closed - WriteTrace(TraceDebug,__FUNCTION__ ": Entering Message Loop"); + WriteTrace(TraceDebug, __FUNCTION__ ": Entering Message Loop"); MainWindow.ProcessAllMessages(); - WriteTrace(TraceDebug,__FUNCTION__ ": Message Loop Finished"); + WriteTrace(TraceDebug, __FUNCTION__ ": Message Loop Finished"); if (g_BaseSystem) { @@ -278,28 +279,28 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR / delete g_BaseSystem; g_BaseSystem = NULL; } - WriteTrace(TraceDebug,__FUNCTION__ ": System Closed"); + WriteTrace(TraceDebug, __FUNCTION__ ": System Closed"); - g_Settings->UnregisterChangeCB(Debugger_AppLogLevel,LogFile,(CSettings::SettingChangedFunc)LogLevelChanged); - g_Settings->UnregisterChangeCB(Debugger_AppLogFlush,LogFile,(CSettings::SettingChangedFunc)LogFlushChanged); + g_Settings->UnregisterChangeCB(Debugger_AppLogLevel, LogFile, (CSettings::SettingChangedFunc)LogLevelChanged); + g_Settings->UnregisterChangeCB(Debugger_AppLogFlush, LogFile, (CSettings::SettingChangedFunc)LogFlushChanged); } - catch(...) + catch (...) { - WriteTraceF(TraceError,__FUNCTION__ ": Exception caught (File: \"%s\" Line: %d)",__FILE__,__LINE__); - MessageBox(NULL,stdstr_f("Exception caught\nFile: %s\nLine: %d",__FILE__,__LINE__).c_str(),"Exception",MB_OK); + WriteTraceF(TraceError, __FUNCTION__ ": Exception caught (File: \"%s\" Line: %d)", __FILE__, __LINE__); + MessageBox(NULL, stdstr_f("Exception caught\nFile: %s\nLine: %d", __FILE__, __LINE__).c_str(), "Exception", MB_OK); } - WriteTrace(TraceDebug,__FUNCTION__ ": cleaning up global objects"); - - if (g_Rom) { delete g_Rom; g_Rom = NULL; } - if (g_Plugins) { delete g_Plugins; g_Plugins = NULL; } - if (g_Settings) { delete g_Settings; g_Settings = NULL; } - if (g_Lang) { delete g_Lang; g_Lang = NULL; } + WriteTrace(TraceDebug, __FUNCTION__ ": cleaning up global objects"); - CMipsMemoryVM::FreeReservedMemory(); + if (g_Rom) { delete g_Rom; g_Rom = NULL; } + if (g_Plugins) { delete g_Plugins; g_Plugins = NULL; } + if (g_Settings) { delete g_Settings; g_Settings = NULL; } + if (g_Lang) { delete g_Lang; g_Lang = NULL; } - CoUninitialize(); - WriteTrace(TraceDebug,__FUNCTION__ ": Done"); - CloseTrace(); + CMipsMemoryVM::FreeReservedMemory(); + + CoUninitialize(); + WriteTrace(TraceDebug, __FUNCTION__ ": Done"); + CloseTrace(); return true; } -#endif +#endif \ No newline at end of file From 23e6503a9ff9c7b13e7d68e26dfa14a4fb6fb05b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Nov 2015 17:51:07 -0500 Subject: [PATCH 056/102] [ROM browser] Loop through a string LUT of extensions. --- .../User Interface/Rom Browser Class.cpp | 41 ++++++++++++------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index 11683afb9..40abf3be7 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -545,8 +545,13 @@ void CRomBrowser::NotificationCB(LPCWSTR Status, CRomBrowser * /*_this*/) g_Notify->DisplayMessage(5, Status); } +static const char* ROM_extensions[] = { + "zip", "7z", "v64", "z64", "n64", "rom", "jap", "pal", "usa", "eur", "bin", +}; void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory, CPath & File) { + uint8_t i; + if (FileList.size() > 3000) { return; @@ -555,14 +560,15 @@ void CRomBrowser::AddFileNameToList(strlist & FileList, const stdstr & Directory stdstr Drive, Dir, Name, Extension; File.GetComponents(NULL, &Dir, &Name, &Extension); Extension.ToLower(); - if (Extension == "zip" || Extension == "7z" || Extension == "v64" || Extension == "z64" || - Extension == "n64" || Extension == "rom" || Extension == "jap" || Extension == "pal" || - Extension == "usa" || Extension == "eur" || Extension == "bin") - { - stdstr FileName = Directory + Name + Extension; - FileName.ToLower(); - FileList.push_back(FileName); - } + for (i = 0; i < sizeof(ROM_extensions) / sizeof(ROM_extensions[0]); i++) + { + if (Extension == ROM_extensions[i]) + { + stdstr FileName = Directory + Name + Extension; + FileName.ToLower(); + FileList.push_back(FileName); + } + } } void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, const stdstr & Directory, const char * lpLastRom) @@ -579,6 +585,10 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c do { + uint8_t ext_ID; + const uint8_t exts = sizeof(ROM_extensions) / sizeof(ROM_extensions[0]); +rom_entry_begin: + //TODO: Fix exception on Windows XP (Visual Studio 2010+) //WriteTraceF(TraceDebug,__FUNCTION__ ": 2 %s m_StopRefresh = %d",(LPCSTR)SearchPath,m_StopRefresh); if (m_StopRefresh) { break; } @@ -598,13 +608,14 @@ void CRomBrowser::FillRomList(strlist & FileList, const CPath & BaseDirectory, c stdstr Extension = SearchPath.GetExtension(); Extension.ToLower(); - if (Extension == "zip" || Extension == "v64" || Extension == "z64" || Extension == "n64" || - Extension == "rom" || Extension == "jap" || Extension == "pal" || Extension == "usa" || - Extension == "eur" || Extension == "bin") - { - AddRomToList(SearchPath, lpLastRom); - continue; - } + for (ext_ID = 0; ext_ID < exts; ext_ID++) + { + if (Extension == ROM_extensions[ext_ID] && Extension != "7z") + { + AddRomToList(SearchPath, lpLastRom); + goto rom_entry_begin; + } + } if (Extension == "7z") { try From a476d4c36e1b06146277aa27e5f064a7796ad360 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Nov 2015 17:55:00 -0500 Subject: [PATCH 057/102] [ROM browser] removed redundant stricmp() inverse checks --- Source/Project64/User Interface/Rom Browser Class.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index 40abf3be7..42660e946 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -652,11 +652,7 @@ rom_entry_begin: _splitpath(FileName.c_str(), drive2, dir2, FileName2, ext2); WriteTraceF(TraceDebug, __FUNCTION__ ": 6 %s", ext2); - if (_stricmp(ext2, ".v64") != 0 && _stricmp(ext2, ".z64") != 0 && - _stricmp(ext2, ".n64") != 0 && _stricmp(ext2, ".rom") != 0 && - _stricmp(ext2, ".jap") != 0 && _stricmp(ext2, ".pal") != 0 && - _stricmp(ext2, ".usa") != 0 && _stricmp(ext2, ".eur") != 0 && - _stricmp(ext2, ".bin") == 0) + if (_stricmp(ext2, ".bin") == 0) { continue; } From b6c6e192eeb157e15fc28309009104e2ee8d9694 Mon Sep 17 00:00:00 2001 From: zilmar Date: Sat, 14 Nov 2015 11:16:03 +1100 Subject: [PATCH 058/102] [Project64] Cleanup Language Class --- .../Multilanguage/Language Class.cpp | 772 +++++++++--------- .../Project64/Multilanguage/Language Class.h | 24 +- .../Multilanguage/LanguageSelector.h | 6 +- 3 files changed, 401 insertions(+), 401 deletions(-) diff --git a/Source/Project64/Multilanguage/Language Class.cpp b/Source/Project64/Multilanguage/Language Class.cpp index e2f3d5855..ea5a79511 100644 --- a/Source/Project64/Multilanguage/Language Class.cpp +++ b/Source/Project64/Multilanguage/Language Class.cpp @@ -14,499 +14,499 @@ CLanguage * g_Lang = NULL; -void CLanguage::LoadDefaultStrings (void) +void CLanguage::LoadDefaultStrings(void) { #define DEF_STR(ID,str) m_DefaultStrings.insert(LANG_STRINGS::value_type(ID,str)) - DEF_STR(EMPTY_STRING, L"" ); + DEF_STR(EMPTY_STRING, L""); /********************************************************************************* * Meta Information * *********************************************************************************/ //About DLL - DEF_STR(LANGUAGE_NAME, L"" ); - DEF_STR(LANGUAGE_AUTHOR, L"" ); - DEF_STR(LANGUAGE_VERSION, L"" ); - DEF_STR(LANGUAGE_DATE, L"" ); + DEF_STR(LANGUAGE_NAME, L""); + DEF_STR(LANGUAGE_AUTHOR, L""); + DEF_STR(LANGUAGE_VERSION, L""); + DEF_STR(LANGUAGE_DATE, L""); //About DLL Dialog - DEF_STR(INI_CURRENT_LANG, L"Current Language" ); - DEF_STR(INI_AUTHOR, L"Author" ); - DEF_STR(INI_VERSION, L"Version" ); - DEF_STR(INI_DATE, L"Date" ); - DEF_STR(INI_HOMEPAGE, L"Visit Home Page" ); - DEF_STR(INI_CURRENT_RDB, L"ROM Database (.RDB)" ); - DEF_STR(INI_CURRENT_CHT, L"Cheat Code File (.CHT)" ); - DEF_STR(INI_CURRENT_RDX, L"Extended ROM Info (.RDX)"); + DEF_STR(INI_CURRENT_LANG, L"Current Language"); + DEF_STR(INI_AUTHOR, L"Author"); + DEF_STR(INI_VERSION, L"Version"); + DEF_STR(INI_DATE, L"Date"); + DEF_STR(INI_HOMEPAGE, L"Visit Home Page"); + DEF_STR(INI_CURRENT_RDB, L"ROM Database (.RDB)"); + DEF_STR(INI_CURRENT_CHT, L"Cheat Code File (.CHT)"); + DEF_STR(INI_CURRENT_RDX, L"Extended ROM Info (.RDX)"); //About INI title - DEF_STR(INI_TITLE, L"About Config Files" ); + DEF_STR(INI_TITLE, L"About Config Files"); /********************************************************************************* * Numbers * *********************************************************************************/ - DEF_STR(NUMBER_0, L"0" ); - DEF_STR(NUMBER_1, L"1" ); - DEF_STR(NUMBER_2, L"2" ); - DEF_STR(NUMBER_3, L"3" ); - DEF_STR(NUMBER_4, L"4" ), - DEF_STR(NUMBER_5, L"5" ); - DEF_STR(NUMBER_6, L"6" ); - DEF_STR(NUMBER_7, L"7" ); - DEF_STR(NUMBER_8, L"8" ); - DEF_STR(NUMBER_9, L"9" ); + DEF_STR(NUMBER_0, L"0"); + DEF_STR(NUMBER_1, L"1"); + DEF_STR(NUMBER_2, L"2"); + DEF_STR(NUMBER_3, L"3"); + DEF_STR(NUMBER_4, L"4"), + DEF_STR(NUMBER_5, L"5"); + DEF_STR(NUMBER_6, L"6"); + DEF_STR(NUMBER_7, L"7"); + DEF_STR(NUMBER_8, L"8"); + DEF_STR(NUMBER_9, L"9"); /********************************************************************************* * Menu * *********************************************************************************/ //File Menu - DEF_STR(MENU_FILE, L"&File" ); - DEF_STR(MENU_OPEN, L"&Open ROM" ); - DEF_STR(MENU_ROM_INFO, L"ROM &Info...." ); - DEF_STR(MENU_START, L"Start Emulation" ); - DEF_STR(MENU_END, L"&End Emulation" ); - DEF_STR(MENU_CHOOSE_ROM, L"Choose ROM Directory..." ); - DEF_STR(MENU_REFRESH, L"Refresh ROM List" ); - DEF_STR(MENU_RECENT_ROM, L"Recent ROM" ); - DEF_STR(MENU_RECENT_DIR, L"Recent ROM Directories" ); - DEF_STR(MENU_EXIT, L"E&xit" ); + DEF_STR(MENU_FILE, L"&File"); + DEF_STR(MENU_OPEN, L"&Open ROM"); + DEF_STR(MENU_ROM_INFO, L"ROM &Info...."); + DEF_STR(MENU_START, L"Start Emulation"); + DEF_STR(MENU_END, L"&End Emulation"); + DEF_STR(MENU_CHOOSE_ROM, L"Choose ROM Directory..."); + DEF_STR(MENU_REFRESH, L"Refresh ROM List"); + DEF_STR(MENU_RECENT_ROM, L"Recent ROM"); + DEF_STR(MENU_RECENT_DIR, L"Recent ROM Directories"); + DEF_STR(MENU_EXIT, L"E&xit"); //System Menu - DEF_STR(MENU_SYSTEM, L"&System" ); - DEF_STR(MENU_RESET, L"&Reset" ); - DEF_STR(MENU_PAUSE, L"&Pause" ); - DEF_STR(MENU_BITMAP, L"Generate Bitmap" ); - DEF_STR(MENU_LIMIT_FPS, L"Limit FPS" ); - DEF_STR(MENU_SAVE, L"&Save State" ); - DEF_STR(MENU_SAVE_AS, L"Save As..." ); - DEF_STR(MENU_RESTORE, L"&Load State" ); - DEF_STR(MENU_LOAD, L"Load..." ); - DEF_STR(MENU_CURRENT_SAVE,L"Current Save S&tate" ); - DEF_STR(MENU_CHEAT, L"Cheats..." ); - DEF_STR(MENU_GS_BUTTON, L"GS Button" ); - DEF_STR(MENU_RESUME, L"R&esume" ); - DEF_STR(MENU_RESET_SOFT, L"&Soft Reset" ); - DEF_STR(MENU_RESET_HARD, L"&Hard Reset" ); + DEF_STR(MENU_SYSTEM, L"&System"); + DEF_STR(MENU_RESET, L"&Reset"); + DEF_STR(MENU_PAUSE, L"&Pause"); + DEF_STR(MENU_BITMAP, L"Generate Bitmap"); + DEF_STR(MENU_LIMIT_FPS, L"Limit FPS"); + DEF_STR(MENU_SAVE, L"&Save State"); + DEF_STR(MENU_SAVE_AS, L"Save As..."); + DEF_STR(MENU_RESTORE, L"&Load State"); + DEF_STR(MENU_LOAD, L"Load..."); + DEF_STR(MENU_CURRENT_SAVE, L"Current Save S&tate"); + DEF_STR(MENU_CHEAT, L"Cheats..."); + DEF_STR(MENU_GS_BUTTON, L"GS Button"); + DEF_STR(MENU_RESUME, L"R&esume"); + DEF_STR(MENU_RESET_SOFT, L"&Soft Reset"); + DEF_STR(MENU_RESET_HARD, L"&Hard Reset"); //Options Menu - DEF_STR(MENU_OPTIONS, L"&Options" ); - DEF_STR(MENU_FULL_SCREEN, L"&Full Screen" ); - DEF_STR(MENU_ON_TOP, L"&Always on &Top" ); - DEF_STR(MENU_CONFG_GFX, L"Configure Graphics Plugin..." ); - DEF_STR(MENU_CONFG_AUDIO, L"Configure Audio Plugin..." ); - DEF_STR(MENU_CONFG_CTRL, L"Configure Controller Plugin..." ); - DEF_STR(MENU_CONFG_RSP, L"Configure RSP Plugin..." ); - DEF_STR(MENU_SHOW_CPU, L"Show CPU Usage" ); - DEF_STR(MENU_SETTINGS, L"&Settings..." ); + DEF_STR(MENU_OPTIONS, L"&Options"); + DEF_STR(MENU_FULL_SCREEN, L"&Full Screen"); + DEF_STR(MENU_ON_TOP, L"&Always on &Top"); + DEF_STR(MENU_CONFG_GFX, L"Configure Graphics Plugin..."); + DEF_STR(MENU_CONFG_AUDIO, L"Configure Audio Plugin..."); + DEF_STR(MENU_CONFG_CTRL, L"Configure Controller Plugin..."); + DEF_STR(MENU_CONFG_RSP, L"Configure RSP Plugin..."); + DEF_STR(MENU_SHOW_CPU, L"Show CPU Usage"); + DEF_STR(MENU_SETTINGS, L"&Settings..."); //Debugger Menu - DEF_STR(MENU_DEBUGGER, L"&Debugger" ); + DEF_STR(MENU_DEBUGGER, L"&Debugger"); //Language Menu - DEF_STR(MENU_LANGUAGE, L"&Language" ); + DEF_STR(MENU_LANGUAGE, L"&Language"); //Help Menu - DEF_STR(MENU_HELP, L"&Help" ); - DEF_STR(MENU_ABOUT_INI, L"About Conf&ig Files" ); - DEF_STR(MENU_ABOUT_PJ64, L"&About Project64" ); - DEF_STR(MENU_FORUM, L"Support &Forum" ); - DEF_STR(MENU_HOMEPAGE, L"&Homepage" ); + DEF_STR(MENU_HELP, L"&Help"); + DEF_STR(MENU_ABOUT_INI, L"About Conf&ig Files"); + DEF_STR(MENU_ABOUT_PJ64, L"&About Project64"); + DEF_STR(MENU_FORUM, L"Support &Forum"); + DEF_STR(MENU_HOMEPAGE, L"&Homepage"); //Current Save Slot menu - DEF_STR(MENU_SLOT_DEFAULT,L"Default" ); - DEF_STR(MENU_SLOT_1, L"Slot 1" ); - DEF_STR(MENU_SLOT_2, L"Slot 2" ); - DEF_STR(MENU_SLOT_3, L"Slot 3" ); - DEF_STR(MENU_SLOT_4, L"Slot 4" ); - DEF_STR(MENU_SLOT_5, L"Slot 5" ); - DEF_STR(MENU_SLOT_6, L"Slot 6" ); - DEF_STR(MENU_SLOT_7, L"Slot 7" ); - DEF_STR(MENU_SLOT_8, L"Slot 8" ); - DEF_STR(MENU_SLOT_9, L"Slot 9" ); - DEF_STR(MENU_SLOT_10, L"Slot 10" ); + DEF_STR(MENU_SLOT_DEFAULT, L"Default"); + DEF_STR(MENU_SLOT_1, L"Slot 1"); + DEF_STR(MENU_SLOT_2, L"Slot 2"); + DEF_STR(MENU_SLOT_3, L"Slot 3"); + DEF_STR(MENU_SLOT_4, L"Slot 4"); + DEF_STR(MENU_SLOT_5, L"Slot 5"); + DEF_STR(MENU_SLOT_6, L"Slot 6"); + DEF_STR(MENU_SLOT_7, L"Slot 7"); + DEF_STR(MENU_SLOT_8, L"Slot 8"); + DEF_STR(MENU_SLOT_9, L"Slot 9"); + DEF_STR(MENU_SLOT_10, L"Slot 10"); //Pop up Menu - DEF_STR(POPUP_PLAY, L"Play Game" ); - DEF_STR(POPUP_INFO, L"ROM Information" ); - DEF_STR(POPUP_SETTINGS, L"Edit Game Settings" ); - DEF_STR(POPUP_CHEATS, L"Edit Cheats" ); - DEF_STR(POPUP_GFX_PLUGIN,L"Graphics Plugin" ); + DEF_STR(POPUP_PLAY, L"Play Game"); + DEF_STR(POPUP_INFO, L"ROM Information"); + DEF_STR(POPUP_SETTINGS, L"Edit Game Settings"); + DEF_STR(POPUP_CHEATS, L"Edit Cheats"); + DEF_STR(POPUP_GFX_PLUGIN, L"Graphics Plugin"); //Alternate Name to save Slot - DEF_STR(SAVE_SLOT_DEFAULT,L"Save Slot - Default" ); - DEF_STR(SAVE_SLOT_1, L"Save Slot - 1" ); - DEF_STR(SAVE_SLOT_2, L"Save Slot - 2" ); - DEF_STR(SAVE_SLOT_3, L"Save Slot - 3" ); - DEF_STR(SAVE_SLOT_4, L"Save Slot - 4" ); - DEF_STR(SAVE_SLOT_5, L"Save Slot - 5" ); - DEF_STR(SAVE_SLOT_6, L"Save Slot - 6" ); - DEF_STR(SAVE_SLOT_7, L"Save Slot - 7" ); - DEF_STR(SAVE_SLOT_8, L"Save Slot - 8" ); - DEF_STR(SAVE_SLOT_9, L"Save Slot - 9" ); - DEF_STR(SAVE_SLOT_10, L"Save Slot - 10" ); + DEF_STR(SAVE_SLOT_DEFAULT, L"Save Slot - Default"); + DEF_STR(SAVE_SLOT_1, L"Save Slot - 1"); + DEF_STR(SAVE_SLOT_2, L"Save Slot - 2"); + DEF_STR(SAVE_SLOT_3, L"Save Slot - 3"); + DEF_STR(SAVE_SLOT_4, L"Save Slot - 4"); + DEF_STR(SAVE_SLOT_5, L"Save Slot - 5"); + DEF_STR(SAVE_SLOT_6, L"Save Slot - 6"); + DEF_STR(SAVE_SLOT_7, L"Save Slot - 7"); + DEF_STR(SAVE_SLOT_8, L"Save Slot - 8"); + DEF_STR(SAVE_SLOT_9, L"Save Slot - 9"); + DEF_STR(SAVE_SLOT_10, L"Save Slot - 10"); /********************************************************************************* * ROM Browser * *********************************************************************************/ //ROM Browser Fields - DEF_STR(RB_FILENAME, L"File Name" ); - DEF_STR(RB_INTERNALNAME, L"Internal Name" ); - DEF_STR(RB_GOODNAME, L"Good Name" ); - DEF_STR(RB_STATUS, L"Status" ); - DEF_STR(RB_ROMSIZE, L"ROM Size" ); - DEF_STR(RB_NOTES_CORE, L"Notes (core)" ); - DEF_STR(RB_NOTES_PLUGIN, L"Notes (default plugins)" ); - DEF_STR(RB_NOTES_USER, L"Notes (user)" ); - DEF_STR(RB_CART_ID, L"Cartridge ID" ); - DEF_STR(RB_MANUFACTUER, L"Manufacturer" ); - DEF_STR(RB_COUNTRY, L"Country" ); - DEF_STR(RB_DEVELOPER, L"Developer" ); - DEF_STR(RB_CRC1, L"CRC1" ); - DEF_STR(RB_CRC2, L"CRC2" ); - DEF_STR(RB_CICCHIP, L"CIC Chip" ); - DEF_STR(RB_RELEASE_DATE, L"Release Date" ); - DEF_STR(RB_GENRE, L"Genre" ); - DEF_STR(RB_PLAYERS, L"Players" ); - DEF_STR(RB_FORCE_FEEDBACK,L"Force Feedback" ); - DEF_STR(RB_FILE_FORMAT, L"File Format" ); + DEF_STR(RB_FILENAME, L"File Name"); + DEF_STR(RB_INTERNALNAME, L"Internal Name"); + DEF_STR(RB_GOODNAME, L"Good Name"); + DEF_STR(RB_STATUS, L"Status"); + DEF_STR(RB_ROMSIZE, L"ROM Size"); + DEF_STR(RB_NOTES_CORE, L"Notes (core)"); + DEF_STR(RB_NOTES_PLUGIN, L"Notes (default plugins)"); + DEF_STR(RB_NOTES_USER, L"Notes (user)"); + DEF_STR(RB_CART_ID, L"Cartridge ID"); + DEF_STR(RB_MANUFACTUER, L"Manufacturer"); + DEF_STR(RB_COUNTRY, L"Country"); + DEF_STR(RB_DEVELOPER, L"Developer"); + DEF_STR(RB_CRC1, L"CRC1"); + DEF_STR(RB_CRC2, L"CRC2"); + DEF_STR(RB_CICCHIP, L"CIC Chip"); + DEF_STR(RB_RELEASE_DATE, L"Release Date"); + DEF_STR(RB_GENRE, L"Genre"); + DEF_STR(RB_PLAYERS, L"Players"); + DEF_STR(RB_FORCE_FEEDBACK, L"Force Feedback"); + DEF_STR(RB_FILE_FORMAT, L"File Format"); //Select ROM - DEF_STR(SELECT_ROM_DIR, L"Select current ROM directory" ); + DEF_STR(SELECT_ROM_DIR, L"Select current ROM directory"); //Messages - DEF_STR(RB_NOT_GOOD_FILE,L"Bad ROM? Use GoodN64 & check for updated RDB." ); + DEF_STR(RB_NOT_GOOD_FILE, L"Bad ROM? Use GoodN64 & check for updated RDB."); /********************************************************************************* * Options * *********************************************************************************/ //Options Title - DEF_STR(OPTIONS_TITLE,L"Settings"); + DEF_STR(OPTIONS_TITLE, L"Settings"); //Tabs - DEF_STR(TAB_PLUGIN, L"Plugins"); - DEF_STR(TAB_DIRECTORY, L"Directories"); - DEF_STR(TAB_OPTIONS, L"Options"); - DEF_STR(TAB_ROMSELECTION,L"ROM Selection"); - DEF_STR(TAB_ADVANCED, L"Advanced"); + DEF_STR(TAB_PLUGIN, L"Plugins"); + DEF_STR(TAB_DIRECTORY, L"Directories"); + DEF_STR(TAB_OPTIONS, L"Options"); + DEF_STR(TAB_ROMSELECTION, L"ROM Selection"); + DEF_STR(TAB_ADVANCED, L"Advanced"); DEF_STR(TAB_ROMSETTINGS, L"General Settings"); - DEF_STR(TAB_SHELLINTERGATION,L"Shell Integration"); - DEF_STR(TAB_ROMNOTES, L"Notes"); - DEF_STR(TAB_SHORTCUTS, L"Keyboard Shortcuts"); - DEF_STR(TAB_ROMSTATUS, L"Status"); - DEF_STR(TAB_RECOMPILER, L"Recompiler"); + DEF_STR(TAB_SHELLINTERGATION, L"Shell Integration"); + DEF_STR(TAB_ROMNOTES, L"Notes"); + DEF_STR(TAB_SHORTCUTS, L"Keyboard Shortcuts"); + DEF_STR(TAB_ROMSTATUS, L"Status"); + DEF_STR(TAB_RECOMPILER, L"Recompiler"); //Plugin Dialog - DEF_STR(PLUG_ABOUT, L"About"); - DEF_STR(PLUG_RSP, L" RSP (Reality Signal Processor) plugin: "); - DEF_STR(PLUG_GFX, L" Video (graphics) plugin: "); - DEF_STR(PLUG_AUDIO, L" Audio (sound) plugin: "); - DEF_STR(PLUG_CTRL, L" Input (controller) plugin: "); - DEF_STR(PLUG_HLE_GFX, L"Graphics HLE"); - DEF_STR(PLUG_HLE_AUDIO,L"Audio HLE"); - DEF_STR(PLUG_DEFAULT, L"** Use System Plugin **"); + DEF_STR(PLUG_ABOUT, L"About"); + DEF_STR(PLUG_RSP, L" RSP (Reality Signal Processor) plugin: "); + DEF_STR(PLUG_GFX, L" Video (graphics) plugin: "); + DEF_STR(PLUG_AUDIO, L" Audio (sound) plugin: "); + DEF_STR(PLUG_CTRL, L" Input (controller) plugin: "); + DEF_STR(PLUG_HLE_GFX, L"Graphics HLE"); + DEF_STR(PLUG_HLE_AUDIO, L"Audio HLE"); + DEF_STR(PLUG_DEFAULT, L"** Use System Plugin **"); //Directory Dialog - DEF_STR(DIR_PLUGIN, L" Plugin directory: "); - DEF_STR(DIR_ROM, L" ROM directory: "); - DEF_STR(DIR_AUTO_SAVE, L" N64 native saves directory: "); - DEF_STR(DIR_INSTANT_SAVE, L" Saved states directory: "); - DEF_STR(DIR_SCREEN_SHOT, L" Screenshot directory: "); - DEF_STR(DIR_ROM_DEFAULT, L"Last folder that a ROM was open from"); + DEF_STR(DIR_PLUGIN, L" Plugin directory: "); + DEF_STR(DIR_ROM, L" ROM directory: "); + DEF_STR(DIR_AUTO_SAVE, L" N64 native saves directory: "); + DEF_STR(DIR_INSTANT_SAVE, L" Saved states directory: "); + DEF_STR(DIR_SCREEN_SHOT, L" Screenshot directory: "); + DEF_STR(DIR_ROM_DEFAULT, L"Last folder that a ROM was open from"); DEF_STR(DIR_SELECT_PLUGIN, L"Select plugin directory"); - DEF_STR(DIR_SELECT_ROM, L"Select ROM directory"); - DEF_STR(DIR_SELECT_AUTO, L"Select N64 native saves directory"); - DEF_STR(DIR_SELECT_INSTANT,L"Select saved states directory"); + DEF_STR(DIR_SELECT_ROM, L"Select ROM directory"); + DEF_STR(DIR_SELECT_AUTO, L"Select N64 native saves directory"); + DEF_STR(DIR_SELECT_INSTANT, L"Select saved states directory"); DEF_STR(DIR_SELECT_SCREEN, L"Select screenshot directory"); - DEF_STR(DIR_TEXTURE, L" Texture pack directory: "); + DEF_STR(DIR_TEXTURE, L" Texture pack directory: "); DEF_STR(DIR_SELECT_TEXTURE, L"Select texture pack directory"); //Options (general) Tab - DEF_STR(OPTION_AUTO_SLEEP, L"Pause emulation when window is not active"); + DEF_STR(OPTION_AUTO_SLEEP, L"Pause emulation when window is not active"); DEF_STR(OPTION_AUTO_FULLSCREEN, L"Enter full-screen mode when loading a ROM"); - DEF_STR(OPTION_BASIC_MODE, L"Hide advanced settings"); - DEF_STR(OPTION_REMEMBER_CHEAT, L"Remember selected cheats"); - DEF_STR(OPTION_DISABLE_SS, L"Disable screen saver when running a ROM"); - DEF_STR(OPTION_DISPLAY_FR, L"Display speed"); - DEF_STR(OPTION_CHECK_RUNNING, L"Check if Project64 is already running"); - DEF_STR(OPTION_CHANGE_FR, L"Speed display:"); + DEF_STR(OPTION_BASIC_MODE, L"Hide advanced settings"); + DEF_STR(OPTION_REMEMBER_CHEAT, L"Remember selected cheats"); + DEF_STR(OPTION_DISABLE_SS, L"Disable screen saver when running a ROM"); + DEF_STR(OPTION_DISPLAY_FR, L"Display speed"); + DEF_STR(OPTION_CHECK_RUNNING, L"Check if Project64 is already running"); + DEF_STR(OPTION_CHANGE_FR, L"Speed display:"); //ROM Browser Tab - DEF_STR(RB_MAX_ROMS, L"Max # of ROMs remembered (0-10):"); - DEF_STR(RB_ROMS, L"ROMs"); - DEF_STR(RB_MAX_DIRS, L"Max # of ROM dirs remembered (0-10):"); - DEF_STR(RB_DIRS, L"dirs"); - DEF_STR(RB_USE, L"Use ROM browser"); - DEF_STR(RB_DIR_RECURSION, L"Use directory recursion"); + DEF_STR(RB_MAX_ROMS, L"Max # of ROMs remembered (0-10):"); + DEF_STR(RB_ROMS, L"ROMs"); + DEF_STR(RB_MAX_DIRS, L"Max # of ROM dirs remembered (0-10):"); + DEF_STR(RB_DIRS, L"dirs"); + DEF_STR(RB_USE, L"Use ROM browser"); + DEF_STR(RB_DIR_RECURSION, L"Use directory recursion"); DEF_STR(RB_AVALIABLE_FIELDS, L"Available fields:"); - DEF_STR(RB_SHOW_FIELDS, L"Order of fields:"); - DEF_STR(RB_ADD, L"Add ->"); - DEF_STR(RB_REMOVE, L"<- Remove"); - DEF_STR(RB_UP, L"Up"); - DEF_STR(RB_DOWN, L"Down"); - DEF_STR(RB_REFRESH, L"Automatically refresh browser"); + DEF_STR(RB_SHOW_FIELDS, L"Order of fields:"); + DEF_STR(RB_ADD, L"Add ->"); + DEF_STR(RB_REMOVE, L"<- Remove"); + DEF_STR(RB_UP, L"Up"); + DEF_STR(RB_DOWN, L"Down"); + DEF_STR(RB_REFRESH, L"Automatically refresh browser"); //Advanced Options - DEF_STR(ADVANCE_INFO, L"Most of these changes will not take effect until a new ROM is opened or current ROM is reset."); - DEF_STR(ADVANCE_DEFAULTS, L"Core Defaults"); - DEF_STR(ADVANCE_CPU_STYLE, L"CPU core style:"); - DEF_STR(ADVANCE_SMCM, L"Self-mod methods:"); - DEF_STR(ADVANCE_MEM_SIZE, L"Default memory size:"); - DEF_STR(ADVANCE_ABL, L"Advanced block linking"); - DEF_STR(ADVANCE_AUTO_START, L"Start emulation when ROM is opened"); - DEF_STR(ADVANCE_OVERWRITE, L"Always override default settings with ones from RDB"); - DEF_STR(ADVANCE_COMPRESS, L"Automatically compress saved states"); - DEF_STR(ADVANCE_DEBUGGER, L"Enable debugger"); - DEF_STR(ADVANCE_SMM_CACHE, L"Cache"); - DEF_STR(ADVANCE_SMM_PIDMA, L"PI DMA"); - DEF_STR(ADVANCE_SMM_VALIDATE,L"Start changed"); + DEF_STR(ADVANCE_INFO, L"Most of these changes will not take effect until a new ROM is opened or current ROM is reset."); + DEF_STR(ADVANCE_DEFAULTS, L"Core Defaults"); + DEF_STR(ADVANCE_CPU_STYLE, L"CPU core style:"); + DEF_STR(ADVANCE_SMCM, L"Self-mod methods:"); + DEF_STR(ADVANCE_MEM_SIZE, L"Default memory size:"); + DEF_STR(ADVANCE_ABL, L"Advanced block linking"); + DEF_STR(ADVANCE_AUTO_START, L"Start emulation when ROM is opened"); + DEF_STR(ADVANCE_OVERWRITE, L"Always override default settings with ones from RDB"); + DEF_STR(ADVANCE_COMPRESS, L"Automatically compress saved states"); + DEF_STR(ADVANCE_DEBUGGER, L"Enable debugger"); + DEF_STR(ADVANCE_SMM_CACHE, L"Cache"); + DEF_STR(ADVANCE_SMM_PIDMA, L"PI DMA"); + DEF_STR(ADVANCE_SMM_VALIDATE, L"Start changed"); DEF_STR(ADVANCE_SMM_PROTECT, L"Protect memory"); - DEF_STR(ADVANCE_SMM_TLB, L"TLB unmapping"); + DEF_STR(ADVANCE_SMM_TLB, L"TLB unmapping"); //ROM Options - DEF_STR(ROM_CPU_STYLE, L"CPU core style:"); - DEF_STR(ROM_VIREFRESH, L"VI refresh rate:"); - DEF_STR(ROM_MEM_SIZE, L"Memory size:"); - DEF_STR(ROM_ABL, L"Advanced block linking"); - DEF_STR(ROM_SAVE_TYPE, L"Default save type:"); - DEF_STR(ROM_COUNTER_FACTOR, L"Counter factor:"); - DEF_STR(ROM_LARGE_BUFFER, L"Larger compile buffer"); - DEF_STR(ROM_USE_TLB, L"Use TLB"); - DEF_STR(ROM_REG_CACHE, L"Register caching"); - DEF_STR(ROM_DELAY_SI, L"Delay SI interrupt"); - DEF_STR(ROM_FAST_SP, L"Fast SP"); - DEF_STR(ROM_DEFAULT, L"Default"); - DEF_STR(ROM_AUDIO_SIGNAL, L"RSP audio signal"); - DEF_STR(ROM_FIXED_AUDIO, L"Fixed audio timing"); - DEF_STR(ROM_FUNC_FIND, L"Function lookup method:"); - DEF_STR(ROM_CUSTOM_SMM, L"Custom self mod Method"); - DEF_STR(ROM_SYNC_AUDIO, L"Sync using audio"); - DEF_STR(ROM_COUNTPERBYTE, L"AI count per byte:"); - DEF_STR(ROM_32BIT, L"32-bit engine:"); - DEF_STR(ROM_DELAY_DP, L"Delay DP interrupt:"); + DEF_STR(ROM_CPU_STYLE, L"CPU core style:"); + DEF_STR(ROM_VIREFRESH, L"VI refresh rate:"); + DEF_STR(ROM_MEM_SIZE, L"Memory size:"); + DEF_STR(ROM_ABL, L"Advanced block linking"); + DEF_STR(ROM_SAVE_TYPE, L"Default save type:"); + DEF_STR(ROM_COUNTER_FACTOR, L"Counter factor:"); + DEF_STR(ROM_LARGE_BUFFER, L"Larger compile buffer"); + DEF_STR(ROM_USE_TLB, L"Use TLB"); + DEF_STR(ROM_REG_CACHE, L"Register caching"); + DEF_STR(ROM_DELAY_SI, L"Delay SI interrupt"); + DEF_STR(ROM_FAST_SP, L"Fast SP"); + DEF_STR(ROM_DEFAULT, L"Default"); + DEF_STR(ROM_AUDIO_SIGNAL, L"RSP audio signal"); + DEF_STR(ROM_FIXED_AUDIO, L"Fixed audio timing"); + DEF_STR(ROM_FUNC_FIND, L"Function lookup method:"); + DEF_STR(ROM_CUSTOM_SMM, L"Custom self mod Method"); + DEF_STR(ROM_SYNC_AUDIO, L"Sync using audio"); + DEF_STR(ROM_COUNTPERBYTE, L"AI count per byte:"); + DEF_STR(ROM_32BIT, L"32-bit engine:"); + DEF_STR(ROM_DELAY_DP, L"Delay DP interrupt:"); //Core Styles - DEF_STR(CORE_INTERPTER, L"Interpreter"); - DEF_STR(CORE_RECOMPILER, L"Recompiler"); - DEF_STR(CORE_SYNC, L"Synchronize cores"); + DEF_STR(CORE_INTERPTER, L"Interpreter"); + DEF_STR(CORE_RECOMPILER, L"Recompiler"); + DEF_STR(CORE_SYNC, L"Synchronize cores"); //Self Mod Methods - DEF_STR(SMCM_NONE, L"None"); - DEF_STR(SMCM_CACHE, L"Cache"); - DEF_STR(SMCM_PROECTED, L"Protect memory"); - DEF_STR(SMCM_CHECK_MEM, L"Check memory & cache"); - DEF_STR(SMCM_CHANGE_MEM, L"Change memory & cache"); - DEF_STR(SMCM_CHECK_ADV, L"Check memory advance"); - DEF_STR(SMCM_CACHE2, L"Clear code on cache"); + DEF_STR(SMCM_NONE, L"None"); + DEF_STR(SMCM_CACHE, L"Cache"); + DEF_STR(SMCM_PROECTED, L"Protect memory"); + DEF_STR(SMCM_CHECK_MEM, L"Check memory & cache"); + DEF_STR(SMCM_CHANGE_MEM, L"Change memory & cache"); + DEF_STR(SMCM_CHECK_ADV, L"Check memory advance"); + DEF_STR(SMCM_CACHE2, L"Clear code on cache"); //Function Lookup method - DEF_STR(FLM_PLOOKUP, L"Physical lookup table"); - DEF_STR(FLM_VLOOKUP, L"Virtual lookup table"); - DEF_STR(FLM_CHANGEMEM, L"Change memory"); + DEF_STR(FLM_PLOOKUP, L"Physical lookup table"); + DEF_STR(FLM_VLOOKUP, L"Virtual lookup table"); + DEF_STR(FLM_CHANGEMEM, L"Change memory"); //RDRAM Size - DEF_STR(RDRAM_4MB, L"4 MB"); - DEF_STR(RDRAM_8MB, L"8 MB"); + DEF_STR(RDRAM_4MB, L"4 MB"); + DEF_STR(RDRAM_8MB, L"8 MB"); //Advanced Block Linking - DEF_STR(ABL_ON, L"On"); - DEF_STR(ABL_OFF, L"Off"); + DEF_STR(ABL_ON, L"On"); + DEF_STR(ABL_OFF, L"Off"); //Save Type - DEF_STR(SAVE_FIRST_USED, L"Use first-used save type"); - DEF_STR(SAVE_4K_EEPROM, L"4-kbit EEPROM"); - DEF_STR(SAVE_16K_EEPROM, L"16-kbit EEPROM"); - DEF_STR(SAVE_SRAM, L"SRAM"); - DEF_STR(SAVE_FLASHRAM, L"Flash RAM"); + DEF_STR(SAVE_FIRST_USED, L"Use first-used save type"); + DEF_STR(SAVE_4K_EEPROM, L"4-kbit EEPROM"); + DEF_STR(SAVE_16K_EEPROM, L"16-kbit EEPROM"); + DEF_STR(SAVE_SRAM, L"SRAM"); + DEF_STR(SAVE_FLASHRAM, L"Flash RAM"); //Shell Integration Tab - DEF_STR(SHELL_TEXT, L"File extension association:"); + DEF_STR(SHELL_TEXT, L"File extension association:"); //ROM Notes - DEF_STR(NOTE_STATUS, L"ROM status:"); - DEF_STR(NOTE_CORE, L"Core note:"); - DEF_STR(NOTE_PLUGIN, L"Plugin note:"); + DEF_STR(NOTE_STATUS, L"ROM status:"); + DEF_STR(NOTE_CORE, L"Core note:"); + DEF_STR(NOTE_PLUGIN, L"Plugin note:"); // Accelerator Selector - DEF_STR(ACCEL_CPUSTATE_TITLE, L"CPU state:"); - DEF_STR(ACCEL_MENUITEM_TITLE, L"Menu item:"); + DEF_STR(ACCEL_CPUSTATE_TITLE, L"CPU state:"); + DEF_STR(ACCEL_MENUITEM_TITLE, L"Menu item:"); DEF_STR(ACCEL_CURRENTKEYS_TITLE, L"Current keys:"); - DEF_STR(ACCEL_SELKEY_TITLE, L"Select new shortcut key:"); - DEF_STR(ACCEL_ASSIGNEDTO_TITLE, L"Currently assigned to:"); - DEF_STR(ACCEL_ASSIGN_BTN, L"Assign"); - DEF_STR(ACCEL_REMOVE_BTN, L"Remove"); - DEF_STR(ACCEL_RESETALL_BTN, L"Reset all"); - DEF_STR(ACCEL_CPUSTATE_1, L"Game not playing"); - DEF_STR(ACCEL_CPUSTATE_2, L"Game playing"); - DEF_STR(ACCEL_CPUSTATE_3, L"Game playing (windowed)"); - DEF_STR(ACCEL_CPUSTATE_4, L"Game playing (full-screen)"); - DEF_STR(ACCEL_DETECTKEY, L"Detect Key"); + DEF_STR(ACCEL_SELKEY_TITLE, L"Select new shortcut key:"); + DEF_STR(ACCEL_ASSIGNEDTO_TITLE, L"Currently assigned to:"); + DEF_STR(ACCEL_ASSIGN_BTN, L"Assign"); + DEF_STR(ACCEL_REMOVE_BTN, L"Remove"); + DEF_STR(ACCEL_RESETALL_BTN, L"Reset all"); + DEF_STR(ACCEL_CPUSTATE_1, L"Game not playing"); + DEF_STR(ACCEL_CPUSTATE_2, L"Game playing"); + DEF_STR(ACCEL_CPUSTATE_3, L"Game playing (windowed)"); + DEF_STR(ACCEL_CPUSTATE_4, L"Game playing (full-screen)"); + DEF_STR(ACCEL_DETECTKEY, L"Detect Key"); // Frame Rate Option - DEF_STR(STR_FR_VIS, L"Vertical interrupts per second"); - DEF_STR(STR_FR_DLS, L"Display lists per second"); - DEF_STR(STR_FR_PERCENT, L"Percentage of full speed"); + DEF_STR(STR_FR_VIS, L"Vertical interrupts per second"); + DEF_STR(STR_FR_DLS, L"Display lists per second"); + DEF_STR(STR_FR_PERCENT, L"Percentage of full speed"); // Increase speed - DEF_STR(STR_INSREASE_SPEED, L"Increase Game Speed"); - DEF_STR(STR_DECREASE_SPEED, L"Decrease Game Speed"); + DEF_STR(STR_INSREASE_SPEED, L"Increase Game Speed"); + DEF_STR(STR_DECREASE_SPEED, L"Decrease Game Speed"); //Bottom page buttons - DEF_STR(BOTTOM_RESET_PAGE, L"Reset Page"); - DEF_STR(BOTTOM_RESET_ALL, L"Reset All"); - DEF_STR(BOTTOM_APPLY, L"Apply"); - DEF_STR(BOTTOM_CLOSE, L"Close"); + DEF_STR(BOTTOM_RESET_PAGE, L"Reset Page"); + DEF_STR(BOTTOM_RESET_ALL, L"Reset All"); + DEF_STR(BOTTOM_APPLY, L"Apply"); + DEF_STR(BOTTOM_CLOSE, L"Close"); /********************************************************************************* * ROM Information * *********************************************************************************/ //ROM Info Title - DEF_STR(INFO_TITLE, L"ROM Information"); + DEF_STR(INFO_TITLE, L"ROM Information"); //ROM Info Text - DEF_STR(INFO_ROM_NAME_TEXT, L"ROM name:"); - DEF_STR(INFO_FILE_NAME_TEXT, L"File name:"); - DEF_STR(INFO_LOCATION_TEXT, L"Location:"); - DEF_STR(INFO_SIZE_TEXT, L"ROM size:"); - DEF_STR(INFO_CART_ID_TEXT, L"Cartridge ID:"); + DEF_STR(INFO_ROM_NAME_TEXT, L"ROM name:"); + DEF_STR(INFO_FILE_NAME_TEXT, L"File name:"); + DEF_STR(INFO_LOCATION_TEXT, L"Location:"); + DEF_STR(INFO_SIZE_TEXT, L"ROM size:"); + DEF_STR(INFO_CART_ID_TEXT, L"Cartridge ID:"); DEF_STR(INFO_MANUFACTURER_TEXT, L"Manufacturer:"); - DEF_STR(INFO_COUNTRY_TEXT, L"Country:"); - DEF_STR(INFO_CRC1_TEXT, L"CRC1:"); - DEF_STR(INFO_CRC2_TEXT, L"CRC2:"); - DEF_STR(INFO_CIC_CHIP_TEXT, L"CIC chip:"); - DEF_STR(INFO_MD5_TEXT, L"MD5:"); + DEF_STR(INFO_COUNTRY_TEXT, L"Country:"); + DEF_STR(INFO_CRC1_TEXT, L"CRC1:"); + DEF_STR(INFO_CRC2_TEXT, L"CRC2:"); + DEF_STR(INFO_CIC_CHIP_TEXT, L"CIC chip:"); + DEF_STR(INFO_MD5_TEXT, L"MD5:"); /********************************************************************************* * Cheats * *********************************************************************************/ //Cheat List - DEF_STR(CHEAT_TITLE, L"Cheats"); - DEF_STR(CHEAT_LIST_FRAME, L"Cheats:"); - DEF_STR(CHEAT_NOTES_FRAME, L" Notes: "); - DEF_STR(CHEAT_MARK_ALL, L"Mark All"); - DEF_STR(CHEAT_MARK_NONE, L"Unmark All"); + DEF_STR(CHEAT_TITLE, L"Cheats"); + DEF_STR(CHEAT_LIST_FRAME, L"Cheats:"); + DEF_STR(CHEAT_NOTES_FRAME, L" Notes: "); + DEF_STR(CHEAT_MARK_ALL, L"Mark All"); + DEF_STR(CHEAT_MARK_NONE, L"Unmark All"); //Add Cheat - DEF_STR(CHEAT_ADDCHEAT_FRAME, L"Add Cheat"); - DEF_STR(CHEAT_ADDCHEAT_NAME, L"Name:"); - DEF_STR(CHEAT_ADDCHEAT_CODE, L"Code:"); + DEF_STR(CHEAT_ADDCHEAT_FRAME, L"Add Cheat"); + DEF_STR(CHEAT_ADDCHEAT_NAME, L"Name:"); + DEF_STR(CHEAT_ADDCHEAT_CODE, L"Code:"); DEF_STR(CHEAT_ADDCHEAT_INSERT, L"Insert"); - DEF_STR(CHEAT_ADDCHEAT_CLEAR, L"Clear"); - DEF_STR(CHEAT_ADDCHEAT_NOTES, L" Cheat Notes: "); - DEF_STR(CHEAT_ADD_TO_DB, L"Add to DB"); + DEF_STR(CHEAT_ADDCHEAT_CLEAR, L"Clear"); + DEF_STR(CHEAT_ADDCHEAT_NOTES, L" Cheat Notes: "); + DEF_STR(CHEAT_ADD_TO_DB, L"Add to DB"); //Code extension - DEF_STR(CHEAT_CODE_EXT_TITLE, L"Code Extensions"); - DEF_STR(CHEAT_CODE_EXT_TXT, L"Please choose a value to be used for:"); - DEF_STR(CHEAT_OK, L"OK"); - DEF_STR(CHEAT_CANCEL, L"Cancel"); + DEF_STR(CHEAT_CODE_EXT_TITLE, L"Code Extensions"); + DEF_STR(CHEAT_CODE_EXT_TXT, L"Please choose a value to be used for:"); + DEF_STR(CHEAT_OK, L"OK"); + DEF_STR(CHEAT_CANCEL, L"Cancel"); //Digital Value - DEF_STR(CHEAT_QUANTITY_TITLE, L"Quantity Digit"); - DEF_STR(CHEAT_CHOOSE_VALUE, L"Please choose a value for:"); - DEF_STR(CHEAT_VALUE, L"&Value"); - DEF_STR(CHEAT_FROM, L"from"); - DEF_STR(CHEAT_TO, L"to"); - DEF_STR(CHEAT_NOTES, L"&Notes:"); - DEF_STR(CHEAT_ADDCHEAT_ADD, L"Add Cheat"); - DEF_STR(CHEAT_ADDCHEAT_NEW, L"New Cheat"); - DEF_STR(CHEAT_ADDCHEAT_CODEDES,L"
"); - DEF_STR(CHEAT_ADDCHEAT_OPT, L"Options:"); + DEF_STR(CHEAT_QUANTITY_TITLE, L"Quantity Digit"); + DEF_STR(CHEAT_CHOOSE_VALUE, L"Please choose a value for:"); + DEF_STR(CHEAT_VALUE, L"&Value"); + DEF_STR(CHEAT_FROM, L"from"); + DEF_STR(CHEAT_TO, L"to"); + DEF_STR(CHEAT_NOTES, L"&Notes:"); + DEF_STR(CHEAT_ADDCHEAT_ADD, L"Add Cheat"); + DEF_STR(CHEAT_ADDCHEAT_NEW, L"New Cheat"); + DEF_STR(CHEAT_ADDCHEAT_CODEDES, L"
"); + DEF_STR(CHEAT_ADDCHEAT_OPT, L"Options:"); DEF_STR(CHEAT_ADDCHEAT_OPTDES, L"