From 48d8925a80a13c56bef001265ea205e38e74f4b1 Mon Sep 17 00:00:00 2001 From: zilmar Date: Fri, 22 Mar 2013 16:47:20 +1100 Subject: [PATCH] Project64: Clean up external release to be beta release --- .gitignore | 30 + Project64.sln | 51 +- Source/Common/MemTest.h | 2 - .../Project64/N64 System/C Core/Logging.cpp | 3 - .../N64 System/C Core/r4300i Commands.cpp | 678 +----------------- .../N64 System/C Core/r4300i Commands.h | 2 +- .../Interpreter/Interpreter CPU.cpp | 35 +- .../Interpreter/Interpreter Ops 32.cpp | 49 +- .../Interpreter/Interpreter Ops.cpp | 360 ++++++---- Source/Project64/N64 System/Mips/Dma.cpp | 57 +- Source/Project64/N64 System/Mips/Dma.h | 3 +- Source/Project64/N64 System/Mips/Eeprom.cpp | 12 +- Source/Project64/N64 System/Mips/Eeprom.h | 3 +- Source/Project64/N64 System/Mips/FlashRam.cpp | 58 +- Source/Project64/N64 System/Mips/FlashRam.h | 3 +- .../N64 System/Mips/Memory Virtual Mem.cpp | 6 +- Source/Project64/N64 System/Mips/Pif Ram.cpp | 14 - .../N64 System/Mips/Register Class.cpp | 72 +- .../N64 System/Mips/Register Class.h | 3 +- .../N64 System/Mips/System Timing.cpp | 2 - Source/Project64/N64 System/N64 Class.cpp | 13 +- .../N64 System/Recompiler/Loop Analysis.cpp | 2 +- .../Recompiler/Recompiler Class.cpp | 4 - .../N64 System/Recompiler/Recompiler Ops.cpp | 53 +- .../N64 System/Recompiler/Recompiler Ops.h | 1 + .../N64 System/Recompiler/Reg Info.cpp | 36 +- .../N64 System/Recompiler/Reg Info.h | 1 + Source/Project64/Project64.vcproj | 16 +- Source/Project64/Settings.h | 4 +- Source/Project64/Settings/Debug Settings.cpp | 6 +- Source/Project64/Settings/Debug Settings.h | 1 + Source/Project64/Settings/Settings Class.cpp | 4 +- Source/Project64/User Interface/Gui Class.cpp | 19 +- Source/Project64/User Interface/Gui Class.h | 4 +- .../Project64/User Interface/Icons/pj64.ico | Bin 26582 -> 26582 bytes .../User Interface/Main Menu Class.cpp | 2 + .../User Interface/Rom Browser Class.cpp | 5 +- Source/Project64/ValidateBinary.cpp | 6 +- Source/Project64/main.cpp | 12 +- Source/RSP/Main.cpp | 12 - 40 files changed, 519 insertions(+), 1125 deletions(-) diff --git a/.gitignore b/.gitignore index f9f25cc4f..56e7d1717 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,33 @@ /Plugin/RSP/pdb /Plugin/RSP/RSP 1.7.dll /Source/Project64/User Interface/UI Resources.aps +/Bin/Beta Release/Config/Project64.cache3 +/Bin/Beta Release/Config/Project64.cfg +/Bin/Beta Release/Config/Project64.cht +/Bin/Beta Release/Config/Project64.rdb +/Bin/Beta Release/Config/Project64.rdn +/Bin/Beta Release/Config/Project64.rdx +/Bin/Beta Release/Config/Project64.zcache +/Bin/Beta Release/Logs/Project64.log +/Bin/Beta Release/Project64.exe +/Bin/Beta Release/map/Project64.map +/Bin/Beta Release/pdb/Project64.pdb +/Bin/Debug/Config/Project64.cache3 +/Bin/Debug/Config/Project64.cht +/Bin/Debug/Config/Project64.rdb +/Bin/Debug/Config/Project64.rdn +/Bin/Debug/Config/Project64.rdx +/Bin/Debug/Config/Project64.zcache +/Bin/Debug/Project64.exe +/Bin/External Release/Config/Project64.cache3 +/Bin/External Release/Config/Project64.cfg +/Bin/External Release/Config/Project64.cht +/Bin/External Release/Config/Project64.rdb +/Bin/External Release/Config/Project64.rdn +/Bin/External Release/Config/Project64.rdx +/Bin/External Release/Config/Project64.zcache +/Bin/External Release/Logs/CPUoutput.log +/Bin/External Release/Logs/Project64.log +/Bin/External Release/Logs/RSP_x86Log.txt +/Bin/External Release/Project64.exe +/Bin/External Release/d3d syslog.txt diff --git a/Project64.sln b/Project64.sln index 214b29af3..3725514da 100644 --- a/Project64.sln +++ b/Project64.sln @@ -31,76 +31,57 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project64Setup", "Source\In EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Beta Release|Win32 = Beta Release|Win32 Debug|Win32 = Debug|Win32 - External Release|Win32 = External Release|Win32 Release|Win32 = Release|Win32 - StaticRelease|Win32 = StaticRelease|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Beta Release|Win32.ActiveCfg = Release|Win32 + {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Beta Release|Win32.Build.0 = Release|Win32 {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Debug|Win32.ActiveCfg = Debug|Win32 {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Debug|Win32.Build.0 = Debug|Win32 - {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.External Release|Win32.ActiveCfg = Release|Win32 - {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.External Release|Win32.Build.0 = Release|Win32 {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Release|Win32.ActiveCfg = Release|Win32 {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.Release|Win32.Build.0 = Release|Win32 - {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {B4A4B994-9111-42B1-93C2-6F1CA8BC4421}.StaticRelease|Win32.Build.0 = Release|Win32 + {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Beta Release|Win32.ActiveCfg = Beta Release|Win32 + {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Beta Release|Win32.Build.0 = Beta Release|Win32 {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Debug|Win32.ActiveCfg = Debug|Win32 {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Debug|Win32.Build.0 = Debug|Win32 - {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.External Release|Win32.ActiveCfg = External Release|Win32 - {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.External Release|Win32.Build.0 = External Release|Win32 {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Release|Win32.ActiveCfg = Release|Win32 {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.Release|Win32.Build.0 = Release|Win32 - {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {7E534C8E-1ACE-4A88-8807-39A11ED4DA18}.StaticRelease|Win32.Build.0 = Release|Win32 + {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Beta Release|Win32.ActiveCfg = Release|Win32 + {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Beta Release|Win32.Build.0 = Release|Win32 {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Debug|Win32.ActiveCfg = Debug|Win32 {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Debug|Win32.Build.0 = Debug|Win32 - {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.External Release|Win32.ActiveCfg = Release|Win32 - {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.External Release|Win32.Build.0 = Release|Win32 {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Release|Win32.ActiveCfg = Release|Win32 {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.Release|Win32.Build.0 = Release|Win32 - {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {A7ED562C-63F3-4B7E-B6B3-2CF7848752E1}.StaticRelease|Win32.Build.0 = Release|Win32 + {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Beta Release|Win32.ActiveCfg = Release|Win32 + {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Beta Release|Win32.Build.0 = Release|Win32 {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Debug|Win32.ActiveCfg = Debug|Win32 {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Debug|Win32.Build.0 = Debug|Win32 - {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.External Release|Win32.ActiveCfg = Release|Win32 - {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.External Release|Win32.Build.0 = Release|Win32 {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Release|Win32.ActiveCfg = Release|Win32 {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.Release|Win32.Build.0 = Release|Win32 - {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {8B9961B1-88D9-4EA3-A752-507A00DD9F3D}.StaticRelease|Win32.Build.0 = Release|Win32 + {3326E128-33AF-422C-BB7C-67CC6B915610}.Beta Release|Win32.ActiveCfg = Release|Win32 + {3326E128-33AF-422C-BB7C-67CC6B915610}.Beta Release|Win32.Build.0 = Release|Win32 {3326E128-33AF-422C-BB7C-67CC6B915610}.Debug|Win32.ActiveCfg = Debug|Win32 {3326E128-33AF-422C-BB7C-67CC6B915610}.Debug|Win32.Build.0 = Debug|Win32 - {3326E128-33AF-422C-BB7C-67CC6B915610}.External Release|Win32.ActiveCfg = Release|Win32 - {3326E128-33AF-422C-BB7C-67CC6B915610}.External Release|Win32.Build.0 = Release|Win32 {3326E128-33AF-422C-BB7C-67CC6B915610}.Release|Win32.ActiveCfg = Release|Win32 {3326E128-33AF-422C-BB7C-67CC6B915610}.Release|Win32.Build.0 = Release|Win32 - {3326E128-33AF-422C-BB7C-67CC6B915610}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {3326E128-33AF-422C-BB7C-67CC6B915610}.StaticRelease|Win32.Build.0 = Release|Win32 + {4BC6906B-213E-40D7-9FC7-1A93E228393D}.Beta Release|Win32.ActiveCfg = Release|Win32 + {4BC6906B-213E-40D7-9FC7-1A93E228393D}.Beta Release|Win32.Build.0 = Release|Win32 {4BC6906B-213E-40D7-9FC7-1A93E228393D}.Debug|Win32.ActiveCfg = Debug|Win32 {4BC6906B-213E-40D7-9FC7-1A93E228393D}.Debug|Win32.Build.0 = Debug|Win32 - {4BC6906B-213E-40D7-9FC7-1A93E228393D}.External Release|Win32.ActiveCfg = Release|Win32 - {4BC6906B-213E-40D7-9FC7-1A93E228393D}.External Release|Win32.Build.0 = Release|Win32 {4BC6906B-213E-40D7-9FC7-1A93E228393D}.Release|Win32.ActiveCfg = Release|Win32 {4BC6906B-213E-40D7-9FC7-1A93E228393D}.Release|Win32.Build.0 = Release|Win32 - {4BC6906B-213E-40D7-9FC7-1A93E228393D}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {4BC6906B-213E-40D7-9FC7-1A93E228393D}.StaticRelease|Win32.Build.0 = Release|Win32 + {731BD205-2826-4631-B7AF-117658E88DBC}.Beta Release|Win32.ActiveCfg = Release|Win32 + {731BD205-2826-4631-B7AF-117658E88DBC}.Beta Release|Win32.Build.0 = Release|Win32 {731BD205-2826-4631-B7AF-117658E88DBC}.Debug|Win32.ActiveCfg = Debug|Win32 {731BD205-2826-4631-B7AF-117658E88DBC}.Debug|Win32.Build.0 = Debug|Win32 - {731BD205-2826-4631-B7AF-117658E88DBC}.External Release|Win32.ActiveCfg = Release|Win32 - {731BD205-2826-4631-B7AF-117658E88DBC}.External Release|Win32.Build.0 = Release|Win32 {731BD205-2826-4631-B7AF-117658E88DBC}.Release|Win32.ActiveCfg = Release|Win32 {731BD205-2826-4631-B7AF-117658E88DBC}.Release|Win32.Build.0 = Release|Win32 - {731BD205-2826-4631-B7AF-117658E88DBC}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {731BD205-2826-4631-B7AF-117658E88DBC}.StaticRelease|Win32.Build.0 = Release|Win32 + {360A34F3-3172-4B09-8BC9-B3FBEE677863}.Beta Release|Win32.ActiveCfg = Release|Win32 {360A34F3-3172-4B09-8BC9-B3FBEE677863}.Debug|Win32.ActiveCfg = Debug|Win32 - {360A34F3-3172-4B09-8BC9-B3FBEE677863}.Debug|Win32.Build.0 = Debug|Win32 - {360A34F3-3172-4B09-8BC9-B3FBEE677863}.External Release|Win32.ActiveCfg = Release|Win32 - {360A34F3-3172-4B09-8BC9-B3FBEE677863}.External Release|Win32.Build.0 = Release|Win32 {360A34F3-3172-4B09-8BC9-B3FBEE677863}.Release|Win32.ActiveCfg = Release|Win32 {360A34F3-3172-4B09-8BC9-B3FBEE677863}.Release|Win32.Build.0 = Release|Win32 - {360A34F3-3172-4B09-8BC9-B3FBEE677863}.StaticRelease|Win32.ActiveCfg = Release|Win32 - {360A34F3-3172-4B09-8BC9-B3FBEE677863}.StaticRelease|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Source/Common/MemTest.h b/Source/Common/MemTest.h index 33aa5fc50..6db895fdd 100644 --- a/Source/Common/MemTest.h +++ b/Source/Common/MemTest.h @@ -1,7 +1,5 @@ #ifdef _DEBUG -#ifndef EXTERNAL_RELEASE #define MEM_LEAK_TEST -#endif #ifdef MEM_LEAK_TEST diff --git a/Source/Project64/N64 System/C Core/Logging.cpp b/Source/Project64/N64 System/C Core/Logging.cpp index eb85b80c6..717e76f02 100644 --- a/Source/Project64/N64 System/C Core/Logging.cpp +++ b/Source/Project64/N64 System/C Core/Logging.cpp @@ -10,8 +10,6 @@ ****************************************************************************/ #include "stdafx.h" -#if (!defined(EXTERNAL_RELEASE)) - void LoadLogSetting (HKEY hKey,char * String, BOOL * Value); void SaveLogOptions (void); @@ -707,4 +705,3 @@ void StopLog (void) { } hLogFile = NULL; } -#endif \ No newline at end of file diff --git a/Source/Project64/N64 System/C Core/r4300i Commands.cpp b/Source/Project64/N64 System/C Core/r4300i Commands.cpp index cb1348e4a..72f39adf7 100644 --- a/Source/Project64/N64 System/C Core/r4300i Commands.cpp +++ b/Source/Project64/N64 System/C Core/r4300i Commands.cpp @@ -711,680 +711,4 @@ char * R4300iOpcodeName ( DWORD OpCode, DWORD PC ) { } return CommandName; -} - - -#ifdef OLD_CODE -#include -#include -#include -#include "main.h" -#include "CPU.h" -#include "debugger.h" - -#if (!defined(EXTERNAL_RELEASE)) -#define R4300i_MaxCommandLines 30 - -typedef struct { - DWORD Location; - char String[150]; - DWORD status; -} R4300ICOMMANDLINE; - -#define R4300i_Status_PC 1 -#define R4300i_Status_BP 2 - -#define IDC_LIST 1000 -#define IDC_ADDRESS 1001 -#define IDCfunctION_COMBO 1002 -#define IDC_GO_BUTTON 1003 -#define IDC_BREAK_BUTTON 1004 -#define IDC_STEP_BUTTON 1005 -#define IDC_SKIP_BUTTON 1006 -#define IDC_BP_BUTTON 1007 -#define IDC_R4300I_REGISTERS_BUTTON 1008 -#define IDCrsP_DEBUGGER_BUTTON 1009 -#define IDCrsP_REGISTERS_BUTTON 1010 -#define IDC_MEMORY_BUTTON 1011 -#define IDC_SCRL_BAR 1012 - -void Paint_R4300i_Commands ( HWND hDlg ); -void R4300i_Commands_Setup ( HWND hDlg ); -void RefreshR4300iCommands ( void ); - -LRESULT CALLBACK R4300i_Commands_Proc ( HWND, UINT, WPARAM, LPARAM ); - -static HWND R4300i_Commands_hDlg, hList, hAddress, hFunctionlist, hGoButton, hBreakButton, - hStepButton, hSkipButton, hBPButton, hR4300iRegisters, hRSPDebugger, hRSPRegisters, - hMemory, hScrlBar; -static R4300ICOMMANDLINE r4300iCommandLine[30]; -BOOL InR4300iCommandsWindow = FALSE; - -void Create_R4300i_Commands_Window ( int Child ) { - DWORD ThreadID; - if ( Child ) { - InR4300iCommandsWindow = TRUE; - DialogBox( GetModuleHandle(NULL), "BLANK", NULL,(DLGPROC) R4300i_Commands_Proc ); - InR4300iCommandsWindow = FALSE; - memset(r4300iCommandLine,0,sizeof(r4300iCommandLine)); - SetR4300iCommandToRunning(); - } else { - if (!InR4300iCommandsWindow) { - SetCoreToStepping(); - CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)Create_R4300i_Commands_Window, - (LPVOID)TRUE,0, &ThreadID); - } else { - SetForegroundWindow(R4300i_Commands_hDlg); - } - } -} - -void Disable_R4300i_Commands_Window ( void ) { - SCROLLINFO si; - - EnableWindow(hList, FALSE); - EnableWindow(hAddress, FALSE); - EnableWindow(hScrlBar, FALSE); - EnableWindow(hGoButton, FALSE); - EnableWindow(hStepButton, FALSE); - EnableWindow(hSkipButton, FALSE); - EnableWindow(hR4300iRegisters, FALSE); - EnableWindow(hRSPRegisters, FALSE); - EnableWindow(hRSPDebugger, FALSE); - EnableWindow(hMemory, FALSE); - - si.cbSize = sizeof(si); - si.fMask = SIF_RANGE | SIF_POS | SIF_PAGE; - si.nMin = 0; - si.nMax = 0; - si.nPos = 1; - si.nPage = 1; - SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); -} - -int DisplayR4300iCommand (DWORD location, int InsertPos) { - DWORD OpCode, count, LinesUsed = 1, status; - BOOL Redraw = FALSE; - - for (count = 0; count < NoOfMapEntries; count ++ ) { - if (MapTable[count].VAddr == location) { - - if (strcmp(r4300iCommandLine[InsertPos].String, MapTable[count].Label) !=0 ) { - Redraw = TRUE; - } - - if (Redraw) { - r4300iCommandLine[InsertPos].Location = -1; - r4300iCommandLine[InsertPos].status = 0; - sprintf(r4300iCommandLine[InsertPos].String," %s:",MapTable[count].Label); - if ( SendMessage(hList,LB_GETCOUNT,0,0) <= InsertPos) { - SendMessage(hList,LB_INSERTSTRING,(WPARAM)InsertPos, (LPARAM)location); - } else { - RECT ItemRC; - SendMessage(hList,LB_GETITEMRECT,(WPARAM)InsertPos, (LPARAM)&ItemRC); - RedrawWindow(hList,&ItemRC,NULL, RDW_INVALIDATE ); - } - } - InsertPos += 1; - if (InsertPos >= R4300i_MaxCommandLines) { - return LinesUsed; - } - LinesUsed = 2; - count = NoOfMapEntries; - } - } - - - Redraw = FALSE; - __try { - if (!r4300i_LW_VAddr(location, &OpCode)) { - r4300iCommandLine[InsertPos].Location = location; - r4300iCommandLine[InsertPos].status = 0; - sprintf(r4300iCommandLine[InsertPos].String," 0x%08X\tCould not resolve address",location); - if ( SendMessage(hList,LB_GETCOUNT,0,0) <= InsertPos) { - SendMessage(hList,LB_INSERTSTRING,(WPARAM)InsertPos, (LPARAM)location); - } else { - RECT ItemRC; - SendMessage(hList,LB_GETITEMRECT,(WPARAM)InsertPos, (LPARAM)&ItemRC); - RedrawWindow(hList,&ItemRC,NULL, RDW_INVALIDATE ); - } - return LinesUsed; - } - } __except( r4300i_Command_MemoryFilter( GetExceptionCode(), GetExceptionInformation()) ) { - g_Notify->DisplayError(GS(MSG_UNKNOWN_MEM_ACTION)); - ExitThread(0); - } - if (SelfModCheck == ModCode_ChangeMemory) { - if ( (OpCode >> 16) == 0x7C7C) { - OpCode = OrigMem[(OpCode & 0xFFFF)].OriginalValue; - } - } - - status = 0; - if (location == PROGRAM_COUNTER) {status = R4300i_Status_PC; } - if (CheckForR4300iBPoint(location)) { status |= R4300i_Status_BP; } - if (r4300iCommandLine[InsertPos].Location != location) { Redraw = TRUE; } - if (r4300iCommandLine[InsertPos].status != status) { Redraw = TRUE; } - if (Redraw) { - r4300iCommandLine[InsertPos].Location = location; - r4300iCommandLine[InsertPos].status = status; - sprintf(r4300iCommandLine[InsertPos].String," 0x%08X\t%s",location, - R4300iOpcodeName ( OpCode, location )); - if ( SendMessage(hList,LB_GETCOUNT,0,0) <= InsertPos) { - SendMessage(hList,LB_INSERTSTRING,(WPARAM)InsertPos, (LPARAM)location); - } else { - RECT ItemRC; - SendMessage(hList,LB_GETITEMRECT,(WPARAM)InsertPos, (LPARAM)&ItemRC); - RedrawWindow(hList,&ItemRC,NULL, RDW_INVALIDATE ); - } - } - return LinesUsed; -} - -void DrawR4300iCommand ( LPARAM lParam ) { - char Command[150], Offset[30], Instruction[30], Arguments[40]; - LPDRAWITEMSTRUCT ditem; - COLORREF oldColor; - int ResetColor; - HBRUSH hBrush; - RECT TextRect; - char *p1, *p2; - - ditem = (LPDRAWITEMSTRUCT)lParam; - strcpy(Command, r4300iCommandLine[ditem->itemID].String); - - if (strchr(Command,'\t')) { - p1 = strchr(Command,'\t'); - sprintf(Offset,"%.*s",p1 - Command, Command); - p1++; - if (strchr(p1,'\t')) { - p2 = strchr(p1,'\t'); - sprintf(Instruction,"%.*s",p2 - p1, p1); - sprintf(Arguments,"%s",p2 + 1); - } else { - sprintf(Instruction,"%s",p1); - sprintf(Arguments,"\0"); - } - sprintf(Command,"\0"); - } else { - sprintf(Offset,"\0"); - sprintf(Instruction,"\0"); - sprintf(Arguments,"\0"); - } - - if (PROGRAM_COUNTER == r4300iCommandLine[ditem->itemID].Location) { - ResetColor = TRUE; - hBrush = (HBRUSH)(COLOR_HIGHLIGHT + 1); - oldColor = SetTextColor(ditem->hDC,RGB(255,255,255)); - } else { - ResetColor = FALSE; - hBrush = (HBRUSH)GetStockObject(WHITE_BRUSH); - } - - if (CheckForR4300iBPoint( r4300iCommandLine[ditem->itemID].Location )) { - ResetColor = TRUE; - if (PROGRAM_COUNTER == r4300iCommandLine[ditem->itemID].Location) { - SetTextColor(ditem->hDC,RGB(255,0,0)); - } else { - oldColor = SetTextColor(ditem->hDC,RGB(255,0,0)); - } - } - - FillRect( ditem->hDC, &ditem->rcItem,hBrush); - SetBkMode( ditem->hDC, TRANSPARENT ); - - if (strlen (Command) == 0 ) { - SetRect(&TextRect,ditem->rcItem.left,ditem->rcItem.top, ditem->rcItem.left + 83, - ditem->rcItem.bottom); - DrawText(ditem->hDC,Offset,strlen(Offset), &TextRect,DT_SINGLELINE | DT_VCENTER); - - SetRect(&TextRect,ditem->rcItem.left + 83,ditem->rcItem.top, ditem->rcItem.left + 165, - ditem->rcItem.bottom); - DrawText(ditem->hDC,Instruction,strlen(Instruction), &TextRect,DT_SINGLELINE | DT_VCENTER); - - SetRect(&TextRect,ditem->rcItem.left + 165,ditem->rcItem.top, ditem->rcItem.right, - ditem->rcItem.bottom); - DrawText(ditem->hDC,Arguments,strlen(Arguments), &TextRect,DT_SINGLELINE | DT_VCENTER); - } else { - DrawText(ditem->hDC,Command,strlen(Command), &ditem->rcItem,DT_SINGLELINE | DT_VCENTER); - } - - if (ResetColor == TRUE) { - SetTextColor( ditem->hDC, oldColor ); - } - -} - -void Enable_R4300i_Commands_Window ( void ) { - SCROLLINFO si; - char Location[10]; - - if (!InR4300iCommandsWindow) { return; } - EnableWindow(hList, TRUE); - EnableWindow(hAddress, TRUE); - EnableWindow(hScrlBar, TRUE); - EnableWindow(hGoButton, TRUE); - EnableWindow(hStepButton, TRUE); - EnableWindow(hSkipButton, FALSE); - EnableWindow(hR4300iRegisters, TRUE); - EnableWindow(hRSPRegisters, FALSE); - EnableWindow(hRSPDebugger, FALSE); - EnableWindow(hMemory, TRUE); - Update_r4300iCommandList(); - - si.cbSize = sizeof(si); - si.fMask = SIF_RANGE | SIF_POS | SIF_PAGE; - si.nMin = 0; - si.nMax = 300; - si.nPos = 145; - si.nPage = 10; - SetScrollInfo(hScrlBar,SB_CTL,&si,TRUE); - - sprintf(Location,"%X",PROGRAM_COUNTER); - SetWindowText(hAddress,Location); - - SetForegroundWindow(R4300i_Commands_hDlg); -} - -void __cdecl Enter_R4300i_Commands_Window ( void ) { - if (!HaveDebugger) { return; } - Create_R4300i_Commands_Window ( FALSE ); -} - -void Paint_R4300i_Commands (HWND hDlg) { - PAINTSTRUCT ps; - RECT rcBox; - HFONT hOldFont; - int OldBkMode; - - BeginPaint( hDlg, &ps ); - - rcBox.left = 5; rcBox.top = 5; - rcBox.right = 343; rcBox.bottom = 463; - DrawEdge( ps.hdc, &rcBox, EDGE_RAISED, BF_RECT ); - - rcBox.left = 8; rcBox.top = 8; - rcBox.right = 340; rcBox.bottom = 460; - DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); - - rcBox.left = 347; rcBox.top = 7; - rcBox.right = 446; rcBox.bottom = 42; - DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); - - rcBox.left = 352; rcBox.top = 2; - rcBox.right = 400; rcBox.bottom = 15; - FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW); - - if (NoOfMapEntries) { - rcBox.left = 347; rcBox.top = 49; - rcBox.right = 446; rcBox.bottom = 84; - DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED, BF_RECT ); - - rcBox.left = 352; rcBox.top = 44; - rcBox.right = 390; rcBox.bottom = 57; - FillRect( ps.hdc, &rcBox,(HBRUSH)COLOR_WINDOW); - } - - rcBox.left = 14; rcBox.top = 14; - rcBox.right = 88; rcBox.bottom = 32; - DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED , BF_RECT ); - - rcBox.left = 86; rcBox.top = 14; - rcBox.right = 173; rcBox.bottom = 32; - DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED , BF_RECT ); - - rcBox.left = 171; rcBox.top = 14; - rcBox.right = 320; rcBox.bottom = 32; - DrawEdge( ps.hdc, &rcBox, EDGE_ETCHED , BF_RECT ); - - hOldFont = (HFONT)SelectObject( ps.hdc,GetStockObject(DEFAULT_GUI_FONT ) ); - OldBkMode = SetBkMode( ps.hdc, TRANSPARENT ); - - TextOut( ps.hdc, 23,16,"Offset",6); - TextOut( ps.hdc, 97,16,"Instruction",11); - TextOut( ps.hdc, 180,16,"Arguments",9); - TextOut( ps.hdc, 354,2," Address ",9); - TextOut( ps.hdc, 354,19,"0x",2); - - if (NoOfMapEntries) { - TextOut( ps.hdc, 354,44," goto:",6); - } - - SelectObject( ps.hdc,hOldFont ); - SetBkMode( ps.hdc, OldBkMode ); - - EndPaint( hDlg, &ps ); -} - -LRESULT CALLBACK R4300i_Commands_Proc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { - switch (uMsg) { - case WM_INITDIALOG: - R4300i_Commands_hDlg = hDlg; - R4300i_Commands_Setup( hDlg ); - break; - case WM_MOVE: - StoreCurrentWinPos("R4300i Commands",hDlg); - break; - case WM_DRAWITEM: - if (wParam == IDC_LIST) { - DrawR4300iCommand (lParam); - } - break; - case WM_PAINT: - Paint_R4300i_Commands( hDlg ); - RedrawWindow(hScrlBar,NULL,NULL, RDW_INVALIDATE |RDW_ERASE); - return TRUE; - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDCfunctION_COMBO: - if (HIWORD(wParam) == CBN_SELENDOK ) { - DWORD Selected, Location; - char Value[20]; - - Selected = SendMessage(hFunctionlist,CB_GETCURSEL,0,0); - if ((int)Selected >= 0) { - Location = SendMessage(hFunctionlist,CB_GETITEMDATA,(WPARAM)Selected,0); - sprintf(Value,"%08X",Location); - SetWindowText(hAddress,Value); - } - } - break; - case IDC_LIST: - if (HIWORD(wParam) == LBN_DBLCLK ) { - DWORD Location, Selected; - Selected = SendMessage(hList,LB_GETCURSEL,(WPARAM)0, (LPARAM)0); - Location = r4300iCommandLine[Selected].Location; - if (Location != (DWORD)-1) { - if (CheckForR4300iBPoint(Location)) { - RemoveR4300iBreakPoint(Location); - } else { - Add_R4300iBPoint(Location, FALSE); - } - RefreshR4300iCommands(); - } - } - break; - case IDC_ADDRESS: - if (HIWORD(wParam) == EN_CHANGE ) { - RefreshR4300iCommands(); - } - break; - case IDC_GO_BUTTON: - SetR4300iCommandToRunning(); - break; - case IDC_BREAK_BUTTON: - SetR4300iCommandToStepping(); - break; - case IDC_STEP_BUTTON: - StepOpcode(); - break; - /*case IDC_SKIP_BUTTON: - SkipNextR4300iOpCode = TRUE; - WaitingForrsPStep = FALSE; - break;*/ - case IDC_BP_BUTTON: Enter_BPoint_Window(); break; - case IDC_R4300I_REGISTERS_BUTTON: Enter_R4300i_Register_Window(); break; - case IDC_MEMORY_BUTTON: Enter_Memory_Window(); break; - case IDCANCEL: - EndDialog( hDlg, IDCANCEL ); - break; - } - break; - case WM_VSCROLL: - if ((HWND)lParam == hScrlBar) { - DWORD location; - char Value[20]; - - GetWindowText(hAddress,Value,sizeof(Value)); - location = AsciiToHex(Value) & ~3; - - switch (LOWORD(wParam)) { - case SB_LINEDOWN: - if (location < 0xFFFFFFFC) { - sprintf(Value,"%08X",location + 0x4); - SetWindowText(hAddress,Value); - } else { - sprintf(Value,"%08X",0xFFFFFFFC); - SetWindowText(hAddress,Value); - } - break; - case SB_LINEUP: - if (location > 0x4 ) { - sprintf(Value,"%08X",location - 0x4); - SetWindowText(hAddress,Value); - } else { - sprintf(Value,"%08X",0); - SetWindowText(hAddress,Value); - } - break; - case SB_PAGEDOWN: - if (location < 0xFFFFFF8C) { - sprintf(Value,"%08X",location + 0x74); - SetWindowText(hAddress,Value); - } else { - sprintf(Value,"%08X",0xFFFFFF8F); - SetWindowText(hAddress,Value); - } - break; - case SB_PAGEUP: - if (location > 0x74 ) { - sprintf(Value,"%08X",location - 0x74); - SetWindowText(hAddress,Value); - } else { - sprintf(Value,"%08X",0); - SetWindowText(hAddress,Value); - } - break; - } - } - break; - default: - return FALSE; - } - return TRUE; -} - -void R4300i_Commands_Setup ( HWND hDlg ) { -#define WindowWidth 457 -#define WindowHeight 494 - DWORD X, Y; - - hList = CreateWindowEx(WS_EX_STATICEDGE, "LISTBOX","", WS_CHILD | WS_VISIBLE | - LBS_OWNERDRAWFIXED | LBS_NOTIFY,14,30,303,445, hDlg, - (HMENU)IDC_LIST, GetModuleHandle(NULL),NULL ); - if ( hList) { - SendMessage(hList,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - SendMessage(hList,LB_SETITEMHEIGHT, (WPARAM)0,(LPARAM)MAKELPARAM(14, 0)); - } - - hAddress = CreateWindowEx(0,"EDIT","", WS_CHILD | ES_UPPERCASE | WS_VISIBLE | - WS_BORDER | WS_TABSTOP,372,17,65,18, hDlg,(HMENU)IDC_ADDRESS,GetModuleHandle(NULL), NULL ); - if (hAddress) { - SendMessage(hAddress,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - SendMessage(hAddress,EM_SETLIMITTEXT, (WPARAM)8,(LPARAM)0); - } - - hFunctionlist = CreateWindowEx(0,"COMBOBOX","", WS_CHILD | WS_VSCROLL | - CBS_DROPDOWNLIST | CBS_SORT | WS_TABSTOP,352,56,89,150,hDlg, - (HMENU)IDCfunctION_COMBO,GetModuleHandle(NULL),NULL); - if (hFunctionlist) { - SendMessage(hFunctionlist,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hGoButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Go", WS_CHILD | - BS_DEFPUSHBUTTON | WS_VISIBLE | WS_TABSTOP, 347,56,100,24, hDlg,(HMENU)IDC_GO_BUTTON, - GetModuleHandle(NULL),NULL ); - if (hGoButton) { - SendMessage(hGoButton,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hBreakButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Break", WS_DISABLED | - WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,85,100,24,hDlg, - (HMENU)IDC_BREAK_BUTTON,GetModuleHandle(NULL),NULL ); - if (hBreakButton) { - SendMessage(hBreakButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hStepButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Step", WS_CHILD | - BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,114,100,24,hDlg, - (HMENU)IDC_STEP_BUTTON,GetModuleHandle(NULL),NULL ); - if (hStepButton) { - SendMessage(hStepButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hSkipButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Skip", WS_CHILD | - BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,143,100,24,hDlg, - (HMENU)IDC_SKIP_BUTTON,GetModuleHandle(NULL),NULL ); - if (hSkipButton) { - SendMessage(hSkipButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hBPButton = CreateWindowEx(WS_EX_STATICEDGE, "BUTTON","&Break Points", WS_CHILD | - BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,324,100,24,hDlg, - (HMENU)IDC_BP_BUTTON,GetModuleHandle(NULL),NULL ); - if (hBPButton) { - SendMessage(hBPButton,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hR4300iRegisters = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON","R4300i &Registers...", - WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,353,100,24,hDlg, - (HMENU)IDC_R4300I_REGISTERS_BUTTON,GetModuleHandle(NULL),NULL ); - if (hR4300iRegisters) { - SendMessage(hR4300iRegisters,WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hRSPDebugger = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON", "RSP &Debugger...", - WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,382,100,24,hDlg, - (HMENU)IDCrsP_DEBUGGER_BUTTON,GetModuleHandle(NULL),NULL ); - if (hRSPDebugger) { - SendMessage(hRSPDebugger,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hRSPRegisters = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON", "RSP R&egisters...", - WS_CHILD | BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,411,100,24,hDlg, - (HMENU)IDCrsP_REGISTERS_BUTTON,GetModuleHandle(NULL),NULL ); - if (hRSPRegisters) { - SendMessage(hRSPRegisters,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hMemory = CreateWindowEx(WS_EX_STATICEDGE,"BUTTON", "&Memory...", WS_CHILD | - BS_PUSHBUTTON | WS_VISIBLE | WS_TABSTOP | BS_TEXT, 347,440,100,24,hDlg, - (HMENU)IDC_MEMORY_BUTTON,GetModuleHandle(NULL),NULL ); - if (hMemory) { - SendMessage(hMemory,WM_SETFONT,(WPARAM)GetStockObject(DEFAULT_GUI_FONT),0); - } - - hScrlBar = CreateWindowEx(WS_EX_STATICEDGE, "SCROLLBAR","", WS_CHILD | WS_VISIBLE | - WS_TABSTOP | SBS_VERT, 318,14,18,439, hDlg, (HMENU)IDC_SCRL_BAR, GetModuleHandle(NULL), NULL ); - - if ( RomFileSize != 0 ) { - Enable_R4300i_Commands_Window(); - } else { - Disable_R4300i_Commands_Window(); - } - - if ( !GetStoredWinPos( "R4300i Commands", &X, &Y ) ) { - X = (GetSystemMetrics( SM_CXSCREEN ) - WindowWidth) / 2; - Y = (GetSystemMetrics( SM_CYSCREEN ) - WindowHeight) / 2; - } - SetWindowText(hDlg,"R4300i Commands"); - - SetWindowPos(hDlg,NULL,X,Y,WindowWidth,WindowHeight, SWP_NOZORDER | - SWP_SHOWWINDOW); - -} -#endif - -#if (!defined(EXTERNAL_RELEASE)) -void RefreshR4300iCommands ( void ) { - DWORD location, LinesUsed; - char AsciiAddress[20]; - int count; - - if (InR4300iCommandsWindow == FALSE) { return; } - - GetWindowText(hAddress,AsciiAddress,sizeof(AsciiAddress)); - location = AsciiToHex(AsciiAddress) & ~3; - - if (location > 0xFFFFFF88) { location = 0xFFFFFF88; } - for (count = 0 ; count < R4300i_MaxCommandLines; count += LinesUsed ){ - LinesUsed = DisplayR4300iCommand ( location, count ); - location += 4; - } -} - -void SetR4300iCommandToRunning ( void ) { - if (CheckForR4300iBPoint(PROGRAM_COUNTER)) { - StepOpcode(); - } - SetCoreToRunning(); - if (InR4300iCommandsWindow == FALSE) { return; } - EnableWindow(hGoButton, FALSE); - EnableWindow(hBreakButton, TRUE); - EnableWindow(hStepButton, FALSE); - EnableWindow(hSkipButton, FALSE); - SendMessage(hGoButton, BM_SETSTYLE,BS_PUSHBUTTON,TRUE); - SendMessage(hBreakButton, BM_SETSTYLE,BS_DEFPUSHBUTTON,TRUE); - SetFocus(hBreakButton); -} - -void SetR4300iCommandToStepping ( void ) { - EnableWindow(hGoButton, TRUE); - EnableWindow(hBreakButton, FALSE); - EnableWindow(hStepButton, TRUE); - EnableWindow(hSkipButton, TRUE); - SendMessage(hBreakButton, BM_SETSTYLE, BS_PUSHBUTTON,TRUE); - SendMessage(hStepButton, BM_SETSTYLE, BS_DEFPUSHBUTTON,TRUE); - SetFocus(hStepButton); - SetCoreToStepping(); -} - -void SetR4300iCommandViewto ( UINT NewLocation ) { - unsigned int location; - char Value[20]; - - if (InR4300iCommandsWindow == FALSE) { return; } - - GetWindowText(hAddress,Value,sizeof(Value)); - location = AsciiToHex(Value) & ~3; - - if ( NewLocation < location || NewLocation >= location + 120 ) { - sprintf(Value,"%08X",NewLocation); - SetWindowText(hAddress,Value); - } else { - RefreshR4300iCommands(); - } -} - -void Update_r4300iCommandList (void) { - if (!InR4300iCommandsWindow) { return; } - - if (NoOfMapEntries == 0) { - ShowWindow(hFunctionlist, FALSE); - SetWindowPos(hGoButton,0,347,56,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - SetWindowPos(hBreakButton,0,347,85,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - SetWindowPos(hStepButton,0,347,114,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - SetWindowPos(hSkipButton,0,347,143,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - } else { - DWORD count, pos; - - ShowWindow(hFunctionlist, TRUE); - SetWindowPos(hGoButton,0,347,86,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - SetWindowPos(hBreakButton,0,347,115,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - SetWindowPos(hStepButton,0,347,144,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - SetWindowPos(hSkipButton,0,347,173,0,0, SWP_NOZORDER | SWP_NOSIZE| SWP_SHOWWINDOW); - - SendMessage(hFunctionlist,CB_RESETCONTENT,(WPARAM)0,(LPARAM)0); - for (count = 0; count < NoOfMapEntries; count ++ ) { - pos = SendMessage(hFunctionlist,CB_ADDSTRING,(WPARAM)0,(LPARAM)MapTable[count].Label); - SendMessage(hFunctionlist,CB_SETITEMDATA,(WPARAM)pos,(LPARAM)MapTable[count].VAddr); - } - SendMessage(hFunctionlist,CB_SETCURSEL,(WPARAM)-1,(LPARAM)0); - - InvalidateRect( R4300i_Commands_hDlg, NULL, TRUE ); - } -} - -#endif - -#endif \ No newline at end of file +} \ No newline at end of file diff --git a/Source/Project64/N64 System/C Core/r4300i Commands.h b/Source/Project64/N64 System/C Core/r4300i Commands.h index 99f8990dd..5f3a207c7 100644 --- a/Source/Project64/N64 System/C Core/r4300i Commands.h +++ b/Source/Project64/N64 System/C Core/r4300i Commands.h @@ -14,7 +14,7 @@ extern "C" { #endif -#if (!defined(EXTERNAL_RELEASE)) +#ifdef _DEBUG void Disable_R4300i_Commands_Window ( void ); void Enable_R4300i_Commands_Window ( void ); void __cdecl Enter_R4300i_Commands_Window ( void ); diff --git a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp index 981a72ff3..61326c01f 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter CPU.cpp @@ -76,9 +76,10 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) { case R4300i_SPECIAL_DDIVU: break; default: -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC); -#endif + if (g_Settings->LoadBool(Debugger_Enabled)) + { + g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC); + } return TRUE; } break; @@ -98,15 +99,17 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) { case R4300i_COP0_CO_TLBWR: break; case R4300i_COP0_CO_TLBP: break; default: -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Does %s effect Delay slot at %X?\n6",R4300iOpcodeName(Command.Hex,PC+4), PC); -#endif + if (g_Settings->LoadBool(Debugger_Enabled)) + { + g_Notify->DisplayError("Does %s effect Delay slot at %X?\n6",R4300iOpcodeName(Command.Hex,PC+4), PC); + } return TRUE; } } else { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Does %s effect Delay slot at %X?\n7",R4300iOpcodeName(Command.Hex,PC+4), PC); -#endif + if (g_Settings->LoadBool(Debugger_Enabled)) + { + g_Notify->DisplayError("Does %s effect Delay slot at %X?\n7",R4300iOpcodeName(Command.Hex,PC+4), PC); + } return TRUE; } } @@ -125,10 +128,11 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) { case R4300i_COP1_D: break; case R4300i_COP1_W: break; case R4300i_COP1_L: break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC); -#endif + if (g_Settings->LoadBool(Debugger_Enabled)) + { + g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC); + } return TRUE; } break; @@ -168,9 +172,10 @@ bool DelaySlotEffectsCompare (DWORD PC, DWORD Reg1, DWORD Reg2) { case R4300i_SDC1: break; case R4300i_SD: break; default: -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC); -#endif + if (g_Settings->LoadBool(Debugger_Enabled)) + { + g_Notify->DisplayError("Does %s effect Delay slot at %X?",R4300iOpcodeName(Command.Hex,PC+4), PC); + } return TRUE; } return FALSE; diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp index bbd118d49..b58d7ecc9 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops 32.cpp @@ -843,9 +843,7 @@ void R4300iOp32::LB (void) { if (m_Opcode.rt == 0) { return; } if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) { if (bShowTLBMisses()) { -#ifndef EXTERNAL_RELEASE g_Notify->DisplayError("LB TLB: %X",Address); -#endif } TLB_READ_EXCEPTION(Address); } else { @@ -889,12 +887,10 @@ void R4300iOp32::LW (void) { DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } -#ifndef EXTERNAL_RELEASE if (LogOptions.GenerateLog) { Log_LW((*_PROGRAM_COUNTER),Address); } -#endif if (m_Opcode.rt == 0) { return; } @@ -1069,10 +1065,9 @@ void R4300iOp32::SPECIAL_SLTU (void) { } void R4300iOp32::SPECIAL_TEQ (void) { - if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0]) { -#ifndef EXTERNAL_RELEASE + if (_GPR[m_Opcode.rs].W[0] == _GPR[m_Opcode.rt].W[0] && g_Settings->LoadBool(Debugger_Enabled)) + { g_Notify->DisplayError("Should trap this ???"); -#endif } } @@ -1188,12 +1183,11 @@ void R4300iOp32::REGIMM_BGEZAL (void) { } /************************** COP0 functions **************************/ void R4300iOp32::COP0_MF (void) { -#if (!defined(EXTERNAL_RELEASE)) - if (LogOptions.LogCP0reads) { - LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), - CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); + if (LogOptions.LogCP0reads) + { + LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); } -#endif + if (m_Opcode.rd == 9) { g_SystemTimer->UpdateTimers(); @@ -1202,16 +1196,14 @@ void R4300iOp32::COP0_MF (void) { } void R4300iOp32::COP0_MT (void) { -#if (!defined(EXTERNAL_RELEASE)) - if (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]); + if (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]); 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)); } } -#endif + switch (m_Opcode.rd) { case 0: //Index case 2: //EntryLo0 @@ -1252,18 +1244,18 @@ void R4300iOp32::COP0_MT (void) { } else { _CP0[m_Opcode.rd] = _GPR[m_Opcode.rt].UW[0]; } - if ((_CP0[m_Opcode.rd] & 0x18) != 0) { -#ifndef EXTERNAL_RELEASE + if ((_CP0[m_Opcode.rd] & 0x18) != 0 && g_Settings->LoadBool(Debugger_Enabled)) + { g_Notify->DisplayError("Left kernel mode ??"); -#endif } g_Reg->CheckInterrupts(); break; case 13: //cause _CP0[m_Opcode.rd] &= 0xFFFFCFF; -#ifndef EXTERNAL_RELEASE - if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 ){ g_Notify->DisplayError("Set IP0 or IP1"); } -#endif + if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && g_Settings->LoadBool(Debugger_Enabled) ) + { + g_Notify->DisplayError("Set IP0 or IP1"); + } break; default: UnknownOpcode(); @@ -1278,10 +1270,9 @@ void R4300iOp32::COP1_MF (void) { void R4300iOp32::COP1_CF (void) { TEST_COP1_USABLE_EXCEPTION - if (m_Opcode.fs != 31 && m_Opcode.fs != 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("CFC1 what register are you writing to ?"); -#endif + if (m_Opcode.fs != 31 && m_Opcode.fs != 0) + { + if (g_Settings->LoadBool(Debugger_Enabled)) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); } return; } _GPR[m_Opcode.rt].W[0] = (int)_FPCR[m_Opcode.fs]; diff --git a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp index 53ef0aeca..2d3988daf 100644 --- a/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp +++ b/Source/Project64/N64 System/Interpreter/Interpreter Ops.cpp @@ -987,9 +987,7 @@ void R4300iOp::LB (void) { if (m_Opcode.rt == 0) { return; } if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) { if (bShowTLBMisses()) { -#ifndef EXTERNAL_RELEASE g_Notify->DisplayError("LB TLB: %X",Address); -#endif } TLB_READ_EXCEPTION(Address); } else { @@ -1034,12 +1032,10 @@ void R4300iOp::LW (void) { DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } -#ifndef EXTERNAL_RELEASE if (LogOptions.GenerateLog) { Log_LW((*_PROGRAM_COUNTER),Address); } -#endif if (m_Opcode.rt == 0) { return; } @@ -1113,24 +1109,34 @@ void R4300iOp::LWU (void) { } } -void R4300iOp::SB (void) { +void R4300iOp::SB (void) +{ DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if (!g_MMU->SB_VAddr(Address,_GPR[m_Opcode.rt].UB[0])) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SB TLB: %X",Address); -#endif + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SB TLB: %X",Address); + } } } void R4300iOp::SH (void) { DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 1) != 0) { ADDRESS_ERROR_EXCEPTION(Address,FALSE); } - if (!g_MMU->SH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SH TLB: %X",Address); -#endif + if (!g_MMU->SH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0])) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SH TLB: %X",Address); + } } } @@ -1140,22 +1146,32 @@ void R4300iOp::SWL (void) { Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SWL TLB: %X",Address); -#endif - g_Notify->BreakPoint(__FILE__,__LINE__); + if (!g_MMU->LW_VAddr((Address & ~3),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SWL TLB: %X",Address); + } return; } Value &= SWL_MASK[Offset]; Value += _GPR[m_Opcode.rt].UW[0] >> SWL_SHIFT[Offset]; - if (!g_MMU->SW_VAddr((Address & ~0x03),Value)) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SWL TLB: %X",Address); -#endif - g_Notify->BreakPoint(__FILE__,__LINE__); + if (!g_MMU->SW_VAddr((Address & ~0x03),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SWL TLB: %X",Address); + } } } @@ -1163,15 +1179,16 @@ void R4300iOp::SWL (void) { void R4300iOp::SW (void) { DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address,FALSE); } -#if (!defined(EXTERNAL_RELEASE)) if (LogOptions.GenerateLog) { Log_SW((*_PROGRAM_COUNTER),Address,_GPR[m_Opcode.rt].UW[0]); } -#endif if (!g_MMU->SW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) { - g_Notify->BreakPoint(__FILE__,__LINE__); + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } if (bShowTLBMisses()) { g_Notify->DisplayError("SW TLB: %X",Address); @@ -1196,22 +1213,32 @@ void R4300iOp::SDL (void) { Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; Offset = Address & 7; - if (!g_MMU->LD_VAddr((Address & ~7),Value)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SDL TLB: %X",Address); -#endif + if (!g_MMU->LD_VAddr((Address & ~7),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SDL TLB: %X",Address); + } return; } Value &= SDL_MASK[Offset]; Value += _GPR[m_Opcode.rt].UDW >> SDL_SHIFT[Offset]; - if (!g_MMU->SD_VAddr((Address & ~7),Value)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SDL TLB: %X",Address); -#endif + if (!g_MMU->SD_VAddr((Address & ~7),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SDL TLB: %X",Address); + } } } @@ -1233,22 +1260,32 @@ void R4300iOp::SDR (void) { Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; Offset = Address & 7; - if (!g_MMU->LD_VAddr((Address & ~7),Value)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SDL TLB: %X",Address); -#endif + if (!g_MMU->LD_VAddr((Address & ~7),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SDR TLB: %X",Address); + } return; } Value &= SDR_MASK[Offset]; Value += _GPR[m_Opcode.rt].UDW << SDR_SHIFT[Offset]; - if (!g_MMU->SD_VAddr((Address & ~7),Value)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SDL TLB: %X",Address); -#endif + if (!g_MMU->SD_VAddr((Address & ~7),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SDR TLB: %X",Address); + } } } @@ -1258,41 +1295,53 @@ void R4300iOp::SWR (void) { Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; Offset = Address & 3; - if (!g_MMU->LW_VAddr((Address & ~3),Value)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SWL TLB: %X",Address); -#endif + if (!g_MMU->LW_VAddr((Address & ~3),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SWR TLB: %X",Address); + } return; } Value &= SWR_MASK[Offset]; Value += _GPR[m_Opcode.rt].UW[0] << SWR_SHIFT[Offset]; - if (!g_MMU->SW_VAddr((Address & ~0x03),Value)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SWL TLB: %X",Address); -#endif + if (!g_MMU->SW_VAddr((Address & ~0x03),Value)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SWR TLB: %X",Address); + } } } -void R4300iOp::CACHE (void) { -#if (!defined(EXTERNAL_RELEASE)) +void R4300iOp::CACHE (void) +{ if (!LogOptions.LogCache) { return; } LogMessage("%08X: Cache operation %d, 0x%08X", (*_PROGRAM_COUNTER), m_Opcode.rt, _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset ); -#endif } -void R4300iOp::LL (void) { +void R4300iOp::LL (void) +{ DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } if (m_Opcode.rt == 0) { return; } - if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) { - if (bShowTLBMisses()) { + if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) + { + if (bShowTLBMisses()) + { g_Notify->DisplayError("LL TLB: %X",Address); } TLB_READ_EXCEPTION(Address); @@ -1302,7 +1351,8 @@ void R4300iOp::LL (void) { } } -void R4300iOp::LWC1 (void) { +void R4300iOp::LWC1 (void) +{ DWORD Address = _GPR[m_Opcode.base].UW[0] + (DWORD)((short)m_Opcode.offset); TEST_COP1_USABLE_EXCEPTION if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } @@ -1317,10 +1367,9 @@ void R4300iOp::LWC1 (void) { void R4300iOp::SC (void) { DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address,FALSE); } -#if (!defined(EXTERNAL_RELEASE)) Log_SW((*_PROGRAM_COUNTER),Address,_GPR[m_Opcode.rt].UW[0]); -#endif - if ((*_LLBit) == 1) { + if ((*_LLBit) == 1) + { if (!g_MMU->SW_VAddr(Address,_GPR[m_Opcode.rt].UW[0])) { g_Notify->BreakPoint(__FILE__,__LINE__); @@ -1336,11 +1385,17 @@ void R4300iOp::SC (void) { void R4300iOp::LD (void) { DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } - if (!g_MMU->LD_VAddr(Address,_GPR[m_Opcode.rt].UDW)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("LD TLB: %X",Address); -#endif + if (!g_MMU->LD_VAddr(Address,_GPR[m_Opcode.rt].UDW)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("LD TLB: %X",Address); + } + return; } #ifdef Interpreter_StackTest if (m_Opcode.rt == 29) { @@ -1355,11 +1410,16 @@ void R4300iOp::LDC1 (void) { TEST_COP1_USABLE_EXCEPTION if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address,TRUE); } - if (!g_MMU->LD_VAddr(Address,*(unsigned __int64 *)_FPR_D[m_Opcode.ft])) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("LD TLB: %X",Address); -#endif + if (!g_MMU->LD_VAddr(Address,*(unsigned __int64 *)_FPR_D[m_Opcode.ft])) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("LDC1 TLB: %X",Address); + } } } @@ -1368,11 +1428,16 @@ void R4300iOp::SWC1 (void) { TEST_COP1_USABLE_EXCEPTION if ((Address & 3) != 0) { ADDRESS_ERROR_EXCEPTION(Address,FALSE); } - if (!g_MMU->SW_VAddr(Address,*(DWORD *)_FPR_S[m_Opcode.ft])) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SWC1 TLB: %X",Address); -#endif + if (!g_MMU->SW_VAddr(Address,*(DWORD *)_FPR_S[m_Opcode.ft])) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SWC1 TLB: %X",Address); + } } } @@ -1381,22 +1446,33 @@ void R4300iOp::SDC1 (void) { TEST_COP1_USABLE_EXCEPTION if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address,FALSE); } - if (!g_MMU->SD_VAddr(Address,*(__int64 *)_FPR_D[m_Opcode.ft])) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SDC1 TLB: %X",Address); -#endif + if (!g_MMU->SD_VAddr(Address,*(__int64 *)_FPR_D[m_Opcode.ft])) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SDC1 TLB: %X",Address); + } } } -void R4300iOp::SD (void) { +void R4300iOp::SD (void) +{ DWORD Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset; if ((Address & 7) != 0) { ADDRESS_ERROR_EXCEPTION(Address,FALSE); } - if (!g_MMU->SD_VAddr(Address,_GPR[m_Opcode.rt].UDW)) { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SD TLB: %X",Address); -#endif + if (!g_MMU->SD_VAddr(Address,_GPR[m_Opcode.rt].UDW)) + { + if (bHaveDebugger()) + { + g_Notify->BreakPoint(__FILE__,__LINE__); + } + if (bShowTLBMisses()) + { + g_Notify->DisplayError("SD TLB: %X",Address); + } } } /********************** R4300i OpCodes: Special **********************/ @@ -1547,9 +1623,10 @@ void R4300iOp::SPECIAL_DDIV (void) { _RegLO->DW = _GPR[m_Opcode.rs].DW / _GPR[m_Opcode.rt].DW; _RegHI->DW = _GPR[m_Opcode.rs].DW % _GPR[m_Opcode.rt].DW; } else { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("DDIV by 0 ???"); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("DDIV by 0 ???"); + } } } @@ -1558,9 +1635,10 @@ void R4300iOp::SPECIAL_DDIVU (void) { _RegLO->UDW = _GPR[m_Opcode.rs].UDW / _GPR[m_Opcode.rt].UDW; _RegHI->UDW = _GPR[m_Opcode.rs].UDW % _GPR[m_Opcode.rt].UDW; } else { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("DDIVU by 0 ???"); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("DDIVU by 0 ???"); + } } } @@ -1634,10 +1712,9 @@ void R4300iOp::SPECIAL_DSUBU (void) { } void R4300iOp::SPECIAL_TEQ (void) { - if (_GPR[m_Opcode.rs].DW == _GPR[m_Opcode.rt].DW) { -#ifndef EXTERNAL_RELEASE + if (_GPR[m_Opcode.rs].DW == _GPR[m_Opcode.rt].DW && bHaveDebugger()) + { g_Notify->DisplayError("Should trap this ???"); -#endif } } @@ -1766,13 +1843,13 @@ void R4300iOp::REGIMM_BGEZAL (void) { _GPR[31].DW = (long)((*_PROGRAM_COUNTER) + 8); } /************************** COP0 functions **************************/ -void R4300iOp::COP0_MF (void) { -#if (!defined(EXTERNAL_RELEASE)) - if (LogOptions.LogCP0reads) { - LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), - CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); +void R4300iOp::COP0_MF (void) +{ + if (LogOptions.LogCP0reads) + { + LogMessage("%08X: R4300i Read from %s (0x%08X)", (*_PROGRAM_COUNTER), CRegName::Cop0[m_Opcode.rd], _CP0[m_Opcode.rd]); } -#endif + if (m_Opcode.rd == 9) { g_SystemTimer->UpdateTimers(); @@ -1781,16 +1858,15 @@ void R4300iOp::COP0_MF (void) { } void R4300iOp::COP0_MT (void) { -#if (!defined(EXTERNAL_RELEASE)) - if (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]); - 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)); + if (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]); + 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)); } } -#endif + switch (m_Opcode.rd) { case 0: //Index case 2: //EntryLo0 @@ -1831,18 +1907,18 @@ void R4300iOp::COP0_MT (void) { } else { _CP0[m_Opcode.rd] = _GPR[m_Opcode.rt].UW[0]; } - if ((_CP0[m_Opcode.rd] & 0x18) != 0) { -#ifndef EXTERNAL_RELEASE + if ((_CP0[m_Opcode.rd] & 0x18) != 0 && bHaveDebugger()) + { g_Notify->DisplayError("Left kernel mode ??"); -#endif } g_Reg->CheckInterrupts(); break; case 13: //cause _CP0[m_Opcode.rd] &= 0xFFFFCFF; -#ifndef EXTERNAL_RELEASE - if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 ){ g_Notify->DisplayError("Set IP0 or IP1"); } -#endif + if ((_GPR[m_Opcode.rt].UW[0] & 0x300) != 0 && bHaveDebugger()) + { + g_Notify->DisplayError("Set IP0 or IP1"); + } break; default: UnknownOpcode(); @@ -1897,10 +1973,9 @@ void R4300iOp::COP1_DMF (void) { void R4300iOp::COP1_CF (void) { TEST_COP1_USABLE_EXCEPTION - if (m_Opcode.fs != 31 && m_Opcode.fs != 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("CFC1 what register are you writing to ?"); -#endif + if (m_Opcode.fs != 31 && m_Opcode.fs != 0) + { + if (bHaveDebugger()) { g_Notify->DisplayError("CFC1 what register are you writing to ?"); } return; } _GPR[m_Opcode.rt].DW = (int)_FPCR[m_Opcode.fs]; @@ -1928,9 +2003,7 @@ void R4300iOp::COP1_CT (void) { } return; } -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("CTC1 what register are you writing to ?"); -#endif + if (bHaveDebugger()) { g_Notify->DisplayError("CTC1 what register are you writing to ?"); } } /************************* COP1: BC1 functions ***********************/ @@ -2122,18 +2195,15 @@ void R4300iOp::COP1_S_CMP (void) { Temp0 = *(float *)_FPR_S[m_Opcode.fs]; Temp1 = *(float *)_FPR_S[m_Opcode.ft]; - if (_isnan(Temp0) || _isnan(Temp1)) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Nan ?"); -#endif + if (_isnan(Temp0) || _isnan(Temp1)) + { + if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTION__ ": Nan ?"); } less = FALSE; equal = FALSE; unorded = TRUE; - if ((m_Opcode.funct & 8) != 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Signal InvalidOperationException\nin r4300i_COP1_S_CMP\n%X %ff\n%X %ff", - Temp0,Temp0,Temp1,Temp1); -#endif + if ((m_Opcode.funct & 8) != 0) + { + if (bHaveDebugger()) { g_Notify->DisplayError("Signal InvalidOperationException\nin r4300i_COP1_S_CMP\n%X %ff\n%X %ff", Temp0,Temp0,Temp1,Temp1); } } } else { less = Temp0 < Temp1; @@ -2288,17 +2358,15 @@ void R4300iOp::COP1_D_CMP (void) { Temp0.DW = *(__int64 *)_FPR_D[m_Opcode.fs]; Temp1.DW = *(__int64 *)_FPR_D[m_Opcode.ft]; - if (_isnan(Temp0.D) || _isnan(Temp1.D)) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Nan ?"); -#endif + if (_isnan(Temp0.D) || _isnan(Temp1.D)) + { + if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTION__ ": Nan ?"); } less = FALSE; equal = FALSE; unorded = TRUE; - if ((m_Opcode.funct & 8) != 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Signal InvalidOperationException\nin r4300i_COP1_D_CMP"); -#endif + if ((m_Opcode.funct & 8) != 0) + { + if (bHaveDebugger()) { g_Notify->DisplayError("Signal InvalidOperationException\nin "__FUNCTION__); } } } else { less = Temp0.D < Temp1.D; diff --git a/Source/Project64/N64 System/Mips/Dma.cpp b/Source/Project64/N64 System/Mips/Dma.cpp index 5bb5bfed3..c0cb06b88 100644 --- a/Source/Project64/N64 System/Mips/Dma.cpp +++ b/Source/Project64/N64 System/Mips/Dma.cpp @@ -30,10 +30,9 @@ void CDMA::OnFirstDMA (void) { void CDMA::PI_DMA_READ (void) { // PI_STATUS_REG |= PI_STATUS_DMA_BUSY; - if ( g_Reg->PI_DRAM_ADDR_REG + g_Reg->PI_RD_LEN_REG + 1 > g_MMU->RdramSize()) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("PI_DMA_READ not in Memory"); -#endif + if ( g_Reg->PI_DRAM_ADDR_REG + g_Reg->PI_RD_LEN_REG + 1 > g_MMU->RdramSize()) + { + if (bHaveDebugger()) { g_Notify->DisplayError("PI_DMA_READ not in Memory"); } g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; g_Reg->CheckInterrupts(); @@ -73,9 +72,10 @@ void CDMA::PI_DMA_READ (void) { g_Reg->CheckInterrupts(); return; } -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("PI_DMA_READ where are you dmaing to ?"); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("PI_DMA_READ where are you dmaing to ?"); + } g_Reg->PI_STATUS_REG &= ~PI_STATUS_DMA_BUSY; g_Reg->MI_INTR_REG |= MI_INTR_PI; g_Reg->CheckInterrupts(); @@ -177,19 +177,23 @@ void CDMA::PI_DMA_WRITE (void) { void CDMA::SP_DMA_READ (void) { g_Reg->SP_DRAM_ADDR_REG &= 0x1FFFFFFF; - if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize()) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SP DMA\nSP_DRAM_ADDR_REG not in RDRam space"); -#endif + if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize()) + { + if (bHaveDebugger()) + { + g_Notify->DisplayError(__FUNCTION__ "\nSP_DRAM_ADDR_REG not in RDRam space"); + } g_Reg->SP_DMA_BUSY_REG = 0; g_Reg->SP_STATUS_REG &= ~SP_STATUS_DMA_BUSY; return; } - if (g_Reg->SP_RD_LEN_REG + 1 + (g_Reg->SP_MEM_ADDR_REG & 0xFFF) > 0x1000) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SP DMA\ncould not fit copy in memory segement"); -#endif + if (g_Reg->SP_RD_LEN_REG + 1 + (g_Reg->SP_MEM_ADDR_REG & 0xFFF) > 0x1000) + { + if (bHaveDebugger()) + { + g_Notify->DisplayError(__FUNCTION__ "\ncould not fit copy in memory segement"); + } return; } @@ -204,18 +208,23 @@ void CDMA::SP_DMA_READ (void) { g_Reg->SP_STATUS_REG &= ~SP_STATUS_DMA_BUSY; } -void CDMA::SP_DMA_WRITE (void) { - if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize()) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SP DMA WRITE\nSP_DRAM_ADDR_REG not in RDRam space"); -#endif +void CDMA::SP_DMA_WRITE (void) +{ + if (g_Reg->SP_DRAM_ADDR_REG > g_MMU->RdramSize()) + { + if (bHaveDebugger()) + { + g_Notify->DisplayError("SP DMA WRITE\nSP_DRAM_ADDR_REG not in RDRam space"); + } return; } - if (g_Reg->SP_WR_LEN_REG + 1 + (g_Reg->SP_MEM_ADDR_REG & 0xFFF) > 0x1000) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("SP DMA WRITE\ncould not fit copy in memory segement"); -#endif + if (g_Reg->SP_WR_LEN_REG + 1 + (g_Reg->SP_MEM_ADDR_REG & 0xFFF) > 0x1000) + { + if (bHaveDebugger()) + { + g_Notify->DisplayError("SP DMA WRITE\ncould not fit copy in memory segement"); + } return; } diff --git a/Source/Project64/N64 System/Mips/Dma.h b/Source/Project64/N64 System/Mips/Dma.h index a8c6c2dc4..2dc7f1ff9 100644 --- a/Source/Project64/N64 System/Mips/Dma.h +++ b/Source/Project64/N64 System/Mips/Dma.h @@ -10,7 +10,8 @@ ****************************************************************************/ #pragma once -class CDMA +class CDMA : + private CDebugSettings { CDMA(); diff --git a/Source/Project64/N64 System/Mips/Eeprom.cpp b/Source/Project64/N64 System/Mips/Eeprom.cpp index cbad12fc6..b9e21a4e2 100644 --- a/Source/Project64/N64 System/Mips/Eeprom.cpp +++ b/Source/Project64/N64 System/Mips/Eeprom.cpp @@ -60,17 +60,13 @@ void CEeprom::EepromCommand ( BYTE * Command) { } break; case 4: // Read from Eeprom -#ifndef EXTERNAL_RELEASE - if (Command[0] != 2) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } - if (Command[1] != 8) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } -#endif + if (Command[0] != 2 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } + if (Command[1] != 8 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } ReadFrom(&Command[4],Command[3]); break; case 5: -#ifndef EXTERNAL_RELEASE - if (Command[0] != 10) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } - if (Command[1] != 1) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } -#endif + if (Command[0] != 10 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } + if (Command[1] != 1 && bHaveDebugger()) { g_Notify->DisplayError("What am I meant to do with this Eeprom Command"); } WriteTo(&Command[4],Command[3]); break; case 6: //RTC Status query diff --git a/Source/Project64/N64 System/Mips/Eeprom.h b/Source/Project64/N64 System/Mips/Eeprom.h index 4924cbb8b..f94b849f1 100644 --- a/Source/Project64/N64 System/Mips/Eeprom.h +++ b/Source/Project64/N64 System/Mips/Eeprom.h @@ -10,7 +10,8 @@ ****************************************************************************/ #pragma once -class CEeprom +class CEeprom : + private CDebugSettings { public: CEeprom ( bool ReadOnly ); diff --git a/Source/Project64/N64 System/Mips/FlashRam.cpp b/Source/Project64/N64 System/Mips/FlashRam.cpp index a5395e0cd..8a44e679f 100644 --- a/Source/Project64/N64 System/Mips/FlashRam.cpp +++ b/Source/Project64/N64 System/Mips/FlashRam.cpp @@ -37,16 +37,20 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len) if (m_hFile == NULL) { if (!LoadFlashram()) { return; } } - if (len > 0x10000) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("DmaFromFlashram FlipBuffer to small (len: %d)",len); -#endif + if (len > 0x10000) + { + if (bHaveDebugger()) + { + g_Notify->DisplayError("DmaFromFlashram FlipBuffer to small (len: %d)",len); + } len = 0x10000; } - if ((len & 3) != 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Unaligned flash ram read ???"); -#endif + if ((len & 3) != 0) + { + if (bHaveDebugger()) + { + g_Notify->DisplayError("Unaligned flash ram read ???"); + } return; } memset(FlipBuffer,0,sizeof(FlipBuffer)); @@ -72,18 +76,21 @@ void CFlashram::DmaFromFlashram ( BYTE * dest, int StartOffset, int len) } break; case FLASHRAM_MODE_STATUS: - if (StartOffset != 0 && len != 8) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Reading m_FlashStatus not being handled correctly\nStart: %X len: %X",StartOffset,len); -#endif + if (StartOffset != 0 && len != 8) + { + if (bHaveDebugger()) + { + g_Notify->DisplayError("Reading m_FlashStatus not being handled correctly\nStart: %X len: %X",StartOffset,len); + } } *((DWORD *)(dest)) = (DWORD)((m_FlashStatus >> 32) & 0xFFFFFFFF); *((DWORD *)(dest) + 1) = (DWORD)(m_FlashStatus & 0xFFFFFFFF); break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("DmaFromFlashram Start: %X, Offset: %X len: %X",dest - g_MMU->Rdram(),StartOffset,len); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("DmaFromFlashram Start: %X, Offset: %X len: %X",dest - g_MMU->Rdram(),StartOffset,len); + } } } @@ -92,10 +99,11 @@ void CFlashram::DmaToFlashram(BYTE * Source, int StartOffset, int len) { case FLASHRAM_MODE_WRITE: m_FlashRamPointer = Source; break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("DmaToFlashram Start: %X, Offset: %X len: %X",Source - g_MMU->Rdram(),StartOffset,len); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("DmaToFlashram Start: %X, Offset: %X len: %X",Source - g_MMU->Rdram(),StartOffset,len); + } } } @@ -105,9 +113,10 @@ DWORD CFlashram::ReadFromFlashStatus (DWORD PAddr) switch (PAddr) { case 0x08000000: return (DWORD)(m_FlashStatus >> 32); default: -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Reading from flash ram status (%X)",PAddr); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("Reading from flash ram status (%X)",PAddr); + } break; } return (DWORD)(m_FlashStatus >> 32); @@ -210,9 +219,10 @@ void CFlashram::WriteToFlashCommand(DWORD FlashRAM_Command) { m_FlashRAM_Offset = (FlashRAM_Command & 0xffff) * 128; m_FlashStatus = 0x1111800400C20000; break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("Writing %X to flash ram command register",FlashRAM_Command); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("Writing %X to flash ram command register",FlashRAM_Command); + } } } diff --git a/Source/Project64/N64 System/Mips/FlashRam.h b/Source/Project64/N64 System/Mips/FlashRam.h index f824b60b0..59681c670 100644 --- a/Source/Project64/N64 System/Mips/FlashRam.h +++ b/Source/Project64/N64 System/Mips/FlashRam.h @@ -10,7 +10,8 @@ ****************************************************************************/ #pragma once -class CFlashram +class CFlashram : + private CDebugSettings { enum Modes { FLASHRAM_MODE_NOPES = 0, diff --git a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp index 9de27fb45..682ebc283 100644 --- a/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp +++ b/Source/Project64/N64 System/Mips/Memory Virtual Mem.cpp @@ -2211,9 +2211,7 @@ int CMipsMemoryVM::SW_NonMemory ( DWORD PAddr, DWORD Value ) { g_Reg->m_RspIntrReg &= ~MI_INTR_SP; g_Reg->CheckInterrupts(); } -#ifndef EXTERNAL_RELEASE if ( ( Value & SP_SET_INTR ) != 0) { g_Notify->DisplayError("SP_SET_INTR"); } -#endif if ( ( Value & SP_CLR_SSTEP ) != 0) { g_Reg->SP_STATUS_REG &= ~SP_STATUS_SSTEP; } @@ -4034,9 +4032,7 @@ void CMipsMemoryVM::ChangeSpStatus (void) g_Reg->m_RspIntrReg &= ~MI_INTR_SP; g_Reg->CheckInterrupts(); } -#ifndef EXTERNAL_RELEASE - if ( ( RegModValue & SP_SET_INTR ) != 0) { g_Notify->DisplayError("SP_SET_INTR"); } -#endif + if ( ( RegModValue & SP_SET_INTR ) != 0 && bHaveDebugger()) { g_Notify->DisplayError("SP_SET_INTR"); } if ( ( RegModValue & SP_CLR_SSTEP ) != 0) { g_Reg->SP_STATUS_REG &= ~SP_STATUS_SSTEP; diff --git a/Source/Project64/N64 System/Mips/Pif Ram.cpp b/Source/Project64/N64 System/Mips/Pif Ram.cpp index 7aa9e178c..fb6ab4fe7 100644 --- a/Source/Project64/N64 System/Mips/Pif Ram.cpp +++ b/Source/Project64/N64 System/Mips/Pif Ram.cpp @@ -267,7 +267,6 @@ void CPifRam::SI_DMA_READ (void) } } -#ifndef EXTERNAL_RELEASE if (LogOptions.LogPRDMAMemStores) { int count; char HexData[100], AsciiData[100], Addon[20]; @@ -298,7 +297,6 @@ void CPifRam::SI_DMA_READ (void) } LogMessage(""); } -#endif if (g_System->bDelaySI()) { g_SystemTimer->SetTimer(CSystemTimer::SiTimer,0x900,false); @@ -360,7 +358,6 @@ void CPifRam::SI_DMA_WRITE (void) } } -#ifndef EXTERNAL_RELEASE if (LogOptions.LogPRDMAMemLoads) { int count; char HexData[100], AsciiData[100], Addon[20]; @@ -392,7 +389,6 @@ void CPifRam::SI_DMA_WRITE (void) } LogMessage(""); } -#endif PifRamWrite(); @@ -442,9 +438,7 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command) } break; case 0x02: //read from controller pack -#ifndef EXTERNAL_RELEASE if (LogOptions.LogControllerPak) { LogControllerPakData("Read: Before Gettting Results"); } -#endif if (bShowPifRamErrors()) { if (Command[0] != 3) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); } @@ -467,14 +461,10 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command) } else { Command[1] |= 0x80; } -#ifndef EXTERNAL_RELEASE if (LogOptions.LogControllerPak) { LogControllerPakData("Read: After Gettting Results"); } -#endif break; case 0x03: //write controller pak -#ifndef EXTERNAL_RELEASE if (LogOptions.LogControllerPak) { LogControllerPakData("Write: Before Processing"); } -#endif if (bShowPifRamErrors()) { if (Command[0] != 35) { g_Notify->DisplayError("What am I meant to do with this Controller Command"); } @@ -495,9 +485,7 @@ void CPifRam::ProcessControllerCommand ( int Control, BYTE * Command) } else { Command[1] |= 0x80; } -#ifndef EXTERNAL_RELEASE if (LogOptions.LogControllerPak) { LogControllerPakData("Write: After Processing"); } -#endif break; default: if (bShowPifRamErrors()) { g_Notify->DisplayError("Unknown ControllerCommand %d",Command[2]); } @@ -540,7 +528,6 @@ void CPifRam::LogControllerPakData (char * Description) { BYTE * PIF_Ram = g_MMU->PifRam(); -#if (!defined(EXTERNAL_RELEASE)) int count, count2; char HexData[100], AsciiData[100], Addon[20]; LogMessage("\t%s:",Description); @@ -574,5 +561,4 @@ void CPifRam::LogControllerPakData (char * Description) } } LogMessage(""); -#endif } \ 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 90133fc2d..673e33ba9 100644 --- a/Source/Project64/N64 System/Mips/Register Class.cpp +++ b/Source/Project64/N64 System/Mips/Register Class.cpp @@ -307,15 +307,17 @@ void CRegisters::CheckInterrupts ( void ) void CRegisters::DoAddressError ( BOOL DelaySlot, DWORD BadVaddr, BOOL FromRead) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("AddressError"); - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { - g_Notify->DisplayError("EXL set in AddressError Exception"); + if (bHaveDebugger()) + { + g_Notify->DisplayError("AddressError"); + if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { + g_Notify->DisplayError("EXL set in AddressError Exception"); + } + if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { + g_Notify->DisplayError("ERL set in AddressError Exception"); + } } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { - g_Notify->DisplayError("ERL set in AddressError Exception"); - } -#endif + if (FromRead) { CAUSE_REGISTER = EXC_RADE; } else { @@ -348,14 +350,15 @@ void CRegisters::FixFpuLocations ( void ) { void CRegisters::DoBreakException ( BOOL DelaySlot) { -#ifndef EXTERNAL_RELEASE - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { - g_Notify->DisplayError("EXL set in Break Exception"); + if (bHaveDebugger()) + { + if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { + g_Notify->DisplayError("EXL set in Break Exception"); + } + if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { + g_Notify->DisplayError("ERL set in Break Exception"); + } } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { - g_Notify->DisplayError("ERL set in Break Exception"); - } -#endif CAUSE_REGISTER = EXC_BREAK; if (DelaySlot) { @@ -370,14 +373,15 @@ void CRegisters::DoBreakException ( BOOL DelaySlot) void CRegisters::DoCopUnusableException ( BOOL DelaySlot, int Coprocessor ) { -#ifndef EXTERNAL_RELEASE - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { - g_Notify->DisplayError("EXL set in Break Exception"); + if (bHaveDebugger()) + { + if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { + g_Notify->DisplayError("EXL set in Break Exception"); + } + if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { + g_Notify->DisplayError("ERL set in Break Exception"); + } } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { - g_Notify->DisplayError("ERL set in Break Exception"); - } -#endif CAUSE_REGISTER = EXC_CPU; if (Coprocessor == 1) { CAUSE_REGISTER |= 0x10000000; } @@ -397,11 +401,9 @@ BOOL CRegisters::DoIntrException ( BOOL DelaySlot ) if (( STATUS_REGISTER & STATUS_IE ) == 0 ) { return FALSE; } if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { return FALSE; } if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { return FALSE; } -#if (!defined(EXTERNAL_RELEASE)) if (LogOptions.GenerateLog && LogOptions.LogExceptions && !LogOptions.NoInterrupts) { LogMessage("%08X: Interupt Generated", m_PROGRAM_COUNTER ); } -#endif CAUSE_REGISTER = FAKE_CAUSE_REGISTER; CAUSE_REGISTER |= EXC_INT; if (DelaySlot) { @@ -437,23 +439,25 @@ void CRegisters::DoTLBReadMiss ( BOOL DelaySlot, DWORD BadVaddr ) } STATUS_REGISTER |= STATUS_EXL; } else { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s",BadVaddr,g_TLB->AddressDefined(BadVaddr)?"TRUE":"FALSE"); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("TLBMiss - EXL Set\nBadVaddr = %X\nAddress Defined: %s",BadVaddr,g_TLB->AddressDefined(BadVaddr)?"TRUE":"FALSE"); + } m_PROGRAM_COUNTER = 0x80000180; } } void CRegisters::DoSysCallException ( BOOL DelaySlot) { -#ifndef EXTERNAL_RELEASE - if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { - g_Notify->DisplayError("EXL set in SysCall Exception"); + if (bHaveDebugger()) + { + if (( STATUS_REGISTER & STATUS_EXL ) != 0 ) { + g_Notify->DisplayError("EXL set in SysCall Exception"); + } + if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { + g_Notify->DisplayError("ERL set in SysCall Exception"); + } } - if (( STATUS_REGISTER & STATUS_ERL ) != 0 ) { - g_Notify->DisplayError("ERL set in SysCall Exception"); - } -#endif CAUSE_REGISTER = EXC_SYSCALL; if (DelaySlot) { diff --git a/Source/Project64/N64 System/Mips/Register Class.h b/Source/Project64/N64 System/Mips/Register Class.h index 08cf0cd92..d13fb2231 100644 --- a/Source/Project64/N64 System/Mips/Register Class.h +++ b/Source/Project64/N64 System/Mips/Register Class.h @@ -474,7 +474,8 @@ protected: class CN64System; class CSystemEvents; -class CRegisters: +class CRegisters : + private CDebugSettings, protected CSystemRegisters, public CP0registers, public Rdram_InterfaceReg, diff --git a/Source/Project64/N64 System/Mips/System Timing.cpp b/Source/Project64/N64 System/Mips/System Timing.cpp index 08d2c8c74..6a54bd85a 100644 --- a/Source/Project64/N64 System/Mips/System Timing.cpp +++ b/Source/Project64/N64 System/Mips/System Timing.cpp @@ -171,11 +171,9 @@ void CSystemTimer::TimerDone (void) if (Profiling) { LastTimer = StartTimer(Timer_Done); } -#if (!defined(EXTERNAL_RELEASE)) if (LogOptions.GenerateLog && LogOptions.LogExceptions && !LogOptions.NoInterrupts) { LogMessage("%08X: Timer Done (Type: %d CurrentTimer: %d)", *_PROGRAM_COUNTER, m_Current, *_Timer ); } -#endif */ switch (m_Current) { case CSystemTimer::CompareTimer: diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index eebc8cf90..3e0d65e04 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -276,11 +276,12 @@ void CN64System::StartEmulation2 ( bool NewThread ) g_Notify->HideRomBrowser(); -#ifndef EXTERNAL_RELEASE - LogOptions.GenerateLog = g_Settings->LoadDword(Debugger_GenerateDebugLog); - LoadLogOptions(&LogOptions, FALSE); - StartLog(); -#endif + if (bHaveDebugger()) + { + LogOptions.GenerateLog = g_Settings->LoadDword(Debugger_GenerateDebugLog); + LoadLogOptions(&LogOptions, FALSE); + StartLog(); + } CInterpreterCPU::BuildCPU(); @@ -322,10 +323,12 @@ void CN64System::StartEmulation2 ( bool NewThread ) } g_Notify->MakeWindowOnTop(g_Settings->LoadBool(UserInterface_AlwaysOnTop)); +#ifdef BETA_RELEASE if (!g_Settings->LoadBool(Beta_IsValidExe)) { return; } +#endif ThreadInfo * Info = new ThreadInfo; HANDLE * hThread = new HANDLE; diff --git a/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp b/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp index 2c7e8c1e1..295d9f0d6 100644 --- a/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp +++ b/Source/Project64/N64 System/Recompiler/Loop Analysis.cpp @@ -10,7 +10,7 @@ ****************************************************************************/ #include "stdafx.h" -#ifndef EXTERNAL_RELEASE +#ifdef _DEBUG #define CHECKED_BUILD 1 #endif diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp index d192faae9..a31d3f0c1 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Class.cpp @@ -718,9 +718,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void ) DoTLBMiss(NextInstruction == DELAY_SLOT,PROGRAM_COUNTER); NextInstruction = NORMAL; if (!TranslateVaddr(PROGRAM_COUNTER, &Addr)) { -#ifndef EXTERNAL_RELEASE g_Notify->DisplayError("Failed to translate PC to a PAddr: %X\n\nEmulation stopped",PROGRAM_COUNTER); -#endif ExitThread(0); } } @@ -732,9 +730,7 @@ void CRecompiler::RecompilerMain_ChangeMemory ( void ) __try { Value = (DWORD)(*(DelaySlotTable + (Addr >> 12))); } __except(EXCEPTION_EXECUTE_HANDLER) { -#ifndef EXTERNAL_RELEASE g_Notify->DisplayError("Executing Delay Slot from non maped space\nPROGRAM_COUNTER = 0x%X",PROGRAM_COUNTER); -#endif ExitThread(0); } if ( (Value >> 16) == 0x7C7C) { diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp index 003e86edb..a96dd4276 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.cpp @@ -79,10 +79,8 @@ void CRecompilerOps::Compile_Branch (CRecompilerOps::BranchFunction CompareFunc, } } break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("Unknown branch type"); -#endif + if (bHaveDebugger()) { g_Notify->DisplayError("Unknown branch type"); } } } else { EffectDelaySlot = true; @@ -298,9 +296,10 @@ void CRecompilerOps::Compile_Branch (CRecompilerOps::BranchFunction CompareFunc, m_Section->GenerateSectionLinkage(); m_NextInstruction = END_BLOCK; } else { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction); + } } } @@ -419,10 +418,8 @@ void CRecompilerOps::Compile_BranchLikely (BranchFunction CompareFunc, BOOL Link m_Section->m_Jump.RegSet = m_RegWorkingSet; m_Section->GenerateSectionLinkage(); m_NextInstruction = END_BLOCK; - } else { -#ifndef EXTERNAL_RELEASE + } else if (bHaveDebugger()) { g_Notify->DisplayError("WTF\n\nBranchLikely\nNextInstruction = %X", m_NextInstruction); -#endif } } @@ -1344,10 +1341,8 @@ void CRecompilerOps::J (void) { m_Section->m_Jump.RegSet = m_RegWorkingSet; m_Section->GenerateSectionLinkage(); m_NextInstruction = END_BLOCK; - } else { -#ifndef EXTERNAL_RELEASE + } else if (bHaveDebugger()) { g_Notify->DisplayError("WTF\n\nJ\nNextInstruction = %X", m_NextInstruction); -#endif } } @@ -1748,10 +1743,11 @@ void CRecompilerOps::CACHE (void){ case 21: case 25: break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("cache: %d",m_Opcode.rt); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("cache: %d",m_Opcode.rt); + } } } @@ -1944,10 +1940,8 @@ void CRecompilerOps::SPECIAL_JR (void) { } } m_NextInstruction = END_BLOCK; - } else { -#ifndef EXTERNAL_RELEASE + } else if (bHaveDebugger()) { g_Notify->DisplayError("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction); -#endif } } @@ -2000,10 +1994,8 @@ void CRecompilerOps::SPECIAL_JALR (void) m_Section->GenerateSectionLinkage(); } m_NextInstruction = END_BLOCK; - } else { -#ifndef EXTERNAL_RELEASE + } else if (bHaveDebugger()) { g_Notify->DisplayError("WTF\n\nBranch\nNextInstruction = %X", m_NextInstruction); -#endif } } @@ -2872,9 +2864,7 @@ void CRecompilerOps::SPECIAL_XOR (void) { if (IsConst(m_Opcode.rt) && IsConst(m_Opcode.rs)) { if (IsMapped(m_Opcode.rd)) { UnMap_GPR(m_Opcode.rd, FALSE); } if (Is64Bit(m_Opcode.rt) || Is64Bit(m_Opcode.rs)) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("XOR 1"); -#endif + if (bHaveDebugger()) { g_Notify->DisplayError("XOR 1"); } CRecompilerOps::UnknownOpcode(); } else { m_RegWorkingSet.SetMipsRegState(m_Opcode.rd,CRegInfo::STATE_CONST_32); @@ -4023,14 +4013,10 @@ void CRecompilerOps::COP0_MT (void) { case 13: //cause if (IsConst(m_Opcode.rt)) { AndConstToVariable(0xFFFFCFF,&_CP0[m_Opcode.rd], CRegName::Cop0[m_Opcode.rd]); -#ifndef EXTERNAL_RELEASE - if ((GetMipsRegLo(m_Opcode.rt) & 0x300) != 0 ){ g_Notify->DisplayError("Set IP0 or IP1"); } -#endif + if ((GetMipsRegLo(m_Opcode.rt) & 0x300) != 0 && bHaveDebugger() ){ g_Notify->DisplayError("Set IP0 or IP1"); } } else { - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix - CRecompilerOps::UnknownOpcode(); -#endif + UnknownOpcode(); + return; } BeforeCallDirect(m_RegWorkingSet); MoveConstToX86reg((DWORD)g_Reg,x86_ECX); @@ -4038,10 +4024,7 @@ void CRecompilerOps::COP0_MT (void) { AfterCallDirect(m_RegWorkingSet); break; default: - g_Notify->BreakPoint(__FILE__,__LINE__); -#ifdef tofix - CRecompilerOps::UnknownOpcode(); -#endif + UnknownOpcode(); } } diff --git a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h index db01f0585..178dff803 100644 --- a/Source/Project64/N64 System/Recompiler/Recompiler Ops.h +++ b/Source/Project64/N64 System/Recompiler/Recompiler Ops.h @@ -13,6 +13,7 @@ class CCodeSection; class CRecompilerOps : + protected CDebugSettings, protected CX86Ops, protected CSystemRegisters, protected CN64SystemSettings, diff --git a/Source/Project64/N64 System/Recompiler/Reg Info.cpp b/Source/Project64/N64 System/Recompiler/Reg Info.cpp index 440c50aa2..faa1d92f0 100644 --- a/Source/Project64/N64 System/Recompiler/Reg Info.cpp +++ b/Source/Project64/N64 System/Recompiler/Reg Info.cpp @@ -191,9 +191,10 @@ void CRegInfo::ChangeFPURegFormat (int Reg, FPU_STATE OldFormat, FPU_STATE NewFo return; } -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("ChangeFormat: Register not on stack!!"); -#endif + if (bHaveDebugger()) + { + g_Notify->DisplayError("ChangeFormat: Register not on stack!!"); + } } void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format) @@ -335,10 +336,8 @@ void CRegInfo::Load_FPR_ToTop ( int Reg, int RegToLoad, FPU_STATE Format) MoveVariableToX86reg(&g_Reg->m_FPR_D[RegToLoad],Name,TempReg); fpuLoadQwordFromX86Reg(&StackTopPos(),TempReg); break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("Load_FPR_ToTop\nUnkown format to load %d",Format); -#endif + if (bHaveDebugger()) { g_Notify->DisplayError("Load_FPR_ToTop\nUnkown format to load %d",Format); } } SetX86Protected(TempReg,FALSE); FpuRoundingModel(StackTopPos()) = RoundDefault; @@ -563,9 +562,7 @@ void CRegInfo::Map_GPR_32bit (int MipsReg, bool SignValue, int MipsRegToLoad) { Reg = FreeX86Reg(); if (Reg < 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Map_GPR_32bit\n\nOut of registers"); -#endif + if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nOut of registers"); } g_Notify->BreakPoint(__FILE__,__LINE__); return; } @@ -619,16 +616,18 @@ void CRegInfo::Map_GPR_64bit ( int MipsReg, int MipsRegToLoad) int count; if (MipsReg == 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("Map_GPR_32bit\n\nWhy are you trying to map reg 0"); -#endif + if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_32bit\n\nWhy are you trying to map reg 0"); } return; } ProtectGPR(MipsReg); if (IsUnknown(MipsReg) || IsConst(MipsReg)) { x86Hi = FreeX86Reg(); - if (x86Hi < 0) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); return; } + if (x86Hi < 0) + { + if (bHaveDebugger()) { g_Notify->DisplayError("Map_GPR_64bit\n\nOut of registers"); } + return; + } SetX86Protected(x86Hi,TRUE); x86lo = FreeX86Reg(); @@ -971,10 +970,8 @@ void CRegInfo::UnMap_FPR (int Reg, int WriteBackValue ) MoveVariableToX86reg(&_FPR_D[x86fpu_MappedTo[StackTopPos()]],Name,TempReg); fpuStoreQwordFromX86Reg(&StackTopPos(),TempReg, TRUE); break; -#ifndef EXTERNAL_RELEASE default: - g_Notify->DisplayError("UnMap_FPR\nUnknown format to load %d",x86fpu_State[StackTopPos()]); -#endif + if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTION__ "\nUnknown format to load %d",x86fpu_State[StackTopPos()]); } } SetX86Protected(TempReg,FALSE); FpuRoundingModel(RegPos) = RoundDefault; @@ -994,10 +991,9 @@ void CRegInfo::UnMap_FPR (int Reg, int WriteBackValue ) void CRegInfo::UnMap_GPR (DWORD Reg, bool WriteBackValue) { - if (Reg == 0) { -#ifndef EXTERNAL_RELEASE - g_Notify->DisplayError("UnMap_GPR\n\nWhy are you trying to unmap reg 0"); -#endif + if (Reg == 0) + { + if (bHaveDebugger()) { g_Notify->DisplayError(__FUNCTION__ "\n\nWhy are you trying to unmap reg 0"); } return; } diff --git a/Source/Project64/N64 System/Recompiler/Reg Info.h b/Source/Project64/N64 System/Recompiler/Reg Info.h index d545b3359..bb8b33ebe 100644 --- a/Source/Project64/N64 System/Recompiler/Reg Info.h +++ b/Source/Project64/N64 System/Recompiler/Reg Info.h @@ -11,6 +11,7 @@ #pragma once class CRegInfo : + private CDebugSettings, private CX86Ops, private CSystemRegisters { diff --git a/Source/Project64/Project64.vcproj b/Source/Project64/Project64.vcproj index e194c881e..f3f62d362 100644 --- a/Source/Project64/Project64.vcproj +++ b/Source/Project64/Project64.vcproj @@ -135,7 +135,7 @@ /> @@ -156,7 +156,7 @@ /> RegisterChangeCB(Debugger_Enabled,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); g_Settings->RegisterChangeCB(Debugger_GenerateLogFiles,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); g_Settings->RegisterChangeCB(Debugger_ShowTLBMisses,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); @@ -34,7 +36,7 @@ CDebugSettings::CDebugSettings() CDebugSettings::~CDebugSettings() { m_RefCount -= 1; - if (m_RefCount == 0) + if (m_RefCount == 0 && g_Settings) { g_Settings->UnregisterChangeCB(Debugger_Enabled,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); g_Settings->UnregisterChangeCB(Debugger_GenerateLogFiles,this,(CSettings::SettingChangedFunc)StaticRefreshSettings); diff --git a/Source/Project64/Settings/Debug Settings.h b/Source/Project64/Settings/Debug Settings.h index 2f812a9d5..92772d79a 100644 --- a/Source/Project64/Settings/Debug Settings.h +++ b/Source/Project64/Settings/Debug Settings.h @@ -38,4 +38,5 @@ private: static bool m_bShowDivByZero; static int m_RefCount; + static bool m_Registered; }; \ No newline at end of file diff --git a/Source/Project64/Settings/Settings Class.cpp b/Source/Project64/Settings/Settings Class.cpp index 4609ae90a..ba6346a5b 100644 --- a/Source/Project64/Settings/Settings Class.cpp +++ b/Source/Project64/Settings/Settings Class.cpp @@ -117,7 +117,7 @@ void CSettings::AddHowToHandleSetting () AddHandler(Rdb_GoodName, new CSettingTypeRomDatabase("Good Name",Game_GameName)); AddHandler(Rdb_SaveChip, new CSettingTypeRDBSaveChip("Save Type",SaveChip_Auto)); -#ifndef EXTERNAL_RELEASE +#ifdef _DEBUG AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type",CPU_SyncCores)); #else AddHandler(Rdb_CpuType, new CSettingTypeRDBCpuType("CPU Type",CPU_Recompiler)); @@ -282,12 +282,14 @@ void CSettings::AddHowToHandleSetting () AddHandler(Debugger_GenerateLogFiles, new CSettingTypeApplication("Debugger","Generate Log Files", false)); +#ifdef BETA_RELEASE AddHandler(Beta_IsBetaVersion, new CSettingTypeTempBool(true)); AddHandler(Beta_UserName, new CSettingTypeTempString("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")); AddHandler(Beta_EmailAddress, new CSettingTypeTempString("????????????????????????????????????????????????????????????????????????????????")); AddHandler(Beta_UserNameMD5, new CSettingTypeTempString("CBBABA8D2262FF1F7A47CEAD87FC4304")); AddHandler(Beta_EmailAddressMD5, new CSettingTypeTempString("47A3D7CBF1DA291D5EB30DCAAF21B9F8")); AddHandler(Beta_IsValidExe, new CSettingTypeTempBool(true)); +#endif //Plugin AddHandler(Plugin_RSP_Current, new CSettingTypeApplication("Plugin","RSP Dll", "RSP\\RSP 1.7.dll")); diff --git a/Source/Project64/User Interface/Gui Class.cpp b/Source/Project64/User Interface/Gui Class.cpp index 862e0a746..128539912 100644 --- a/Source/Project64/User Interface/Gui Class.cpp +++ b/Source/Project64/User Interface/Gui Class.cpp @@ -42,6 +42,7 @@ CMainGui::CMainGui (bool bMainWindow, const char * WindowTitle ) : m_ThreadId(GetCurrentThreadId()), m_bMainWindow(bMainWindow) { +#ifdef BETA_RELEASE m_hacked = false; if (g_Settings) { @@ -51,6 +52,7 @@ CMainGui::CMainGui (bool bMainWindow, const char * WindowTitle ) : m_hacked = true; } } +#endif m_Menu = NULL; m_hMainWindow = 0; @@ -63,7 +65,9 @@ CMainGui::CMainGui (bool bMainWindow, const char * WindowTitle ) : m_SaveRomBrowserTop = 0; m_SaveRomBrowserLeft = 0; +#ifdef BETA_RELEASE m_InvalidExeMsg = RegisterWindowMessage("Invalid"); +#endif if (m_bMainWindow) { @@ -374,9 +378,7 @@ void CMainGui::Show (bool Visible) { void CMainGui::EnterLogOptions (void) { -#ifndef EXTERNAL_RELEASE ::EnterLogOptions((HWND)m_hMainWindow); -#endif } int CMainGui::Height (void) { @@ -472,7 +474,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam CMainGui * _this = (CMainGui *)lpcs->lpCreateParams; SetProp((HWND)hWnd,"Class",_this); -#if defined(EXTERNAL_RELEASE) || defined(VALIDATE_BIN_LOCAL) +#if defined(BETA_RELEASE) || defined(VALIDATE_BIN_LOCAL) TestValidBinary(); SetTimer((HWND)hWnd,0,10000,NULL); #endif @@ -488,10 +490,12 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam _this->ChangeWinSize(640,480); +#ifdef BETA_RELEASE if (_this->m_hacked) { MessageBox(NULL,"Exe has been corrupted","Stopping",MB_OK|MB_ICONEXCLAMATION); } +#endif } break; case WM_SYSCOMMAND: @@ -560,6 +564,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam } } break; +#ifdef BETA_RELEASE case WM_TIMER: { CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); @@ -582,6 +587,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam } } break; +#endif case WM_SIZE: { CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); @@ -871,6 +877,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam WriteTrace(TraceDebug,__FUNCTION__ ": WM_DESTROY - Done"); break; default: +#ifdef BETA_RELEASE { CMainGui * _this = (CMainGui *)GetProp((HWND)hWnd,"Class"); if (_this) @@ -883,6 +890,7 @@ DWORD CALLBACK CMainGui::MainGui_Proc (WND_HANDLE hWnd, DWORD uMsg, DWORD wParam } } } +#endif return DefWindowProc((HWND)hWnd,uMsg,wParam,lParam); } return TRUE; @@ -922,6 +930,7 @@ DWORD CALLBACK AboutBoxCancelProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lP return CallWindowProc(pfnWndAboutBoxCancelProc, hWnd, uMsg, wParam, lParam); } +#ifdef BETA_RELEASE LPSTR ValidateDecryptString (LPSTR String, int Len); LPSTR ValidateEncryptString (LPSTR String, int Len); @@ -936,7 +945,6 @@ LPSTR ValidateDecryptString2 (LPSTR String, int Len) return String; } - DWORD CALLBACK AboutUserProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD /*lParam*/) { static char UserInfo[] = "hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh"; @@ -989,6 +997,7 @@ DWORD CALLBACK AboutUserProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD /*lPara } return TRUE; } +#endif DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) { @@ -1208,12 +1217,14 @@ DWORD CALLBACK AboutBoxProc (HWND hWnd, DWORD uMsg, DWORD wParam, DWORD lParam) break; case WM_COMMAND: switch (LOWORD(wParam)) { +#ifdef BETA_RELEASE case IDC_VERSION: if ((GetKeyState(VK_CONTROL) & 0x80)) { DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_About_UserInfo), (HWND)hWnd, (DLGPROC)AboutUserProc); } break; +#endif case IDOK: case IDCANCEL: if (hbmpBackgroundTop) diff --git a/Source/Project64/User Interface/Gui Class.h b/Source/Project64/User Interface/Gui Class.h index ccdf28af6..ab50e3c5d 100644 --- a/Source/Project64/User Interface/Gui Class.h +++ b/Source/Project64/User Interface/Gui Class.h @@ -100,9 +100,11 @@ private: WND_HANDLE m_hMainWindow, m_hStatusWnd; DWORD m_ThreadId; +#ifdef BETA_RELEASE bool m_hacked; - const bool m_bMainWindow; DWORD m_InvalidExeMsg; +#endif + const bool m_bMainWindow; CriticalSection m_CS; bool m_SaveMainWindowPos; diff --git a/Source/Project64/User Interface/Icons/pj64.ico b/Source/Project64/User Interface/Icons/pj64.ico index baa3e7f299b1a4d9a1a9d3376b21782fda205e08..3fcaf4b2cd043ba43e44efab2b8d610bef9cef53 100644 GIT binary patch delta 4120 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 delta 6749 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 { stdstr_f User("Beta For: %s",g_Settings->LoadString(Beta_UserName).c_str()); @@ -1131,6 +1132,7 @@ void CMainMenu::FillOutMenu ( MENU_HANDLE hMenu ) { HelpMenu.push_back(MENU_ITEM(NO_ID, EMPTY_STRING,EMPTY_STDSTR,NULL,Email )); HelpMenu.push_back(MENU_ITEM(SPLITER )); } +#endif HelpMenu.push_back(MENU_ITEM(ID_HELP_CONTENTS, MENU_USER_MAN )); HelpMenu.push_back(MENU_ITEM(ID_HELP_GAMEFAQ, MENU_GAME_FAQ )); diff --git a/Source/Project64/User Interface/Rom Browser Class.cpp b/Source/Project64/User Interface/Rom Browser Class.cpp index 37a0b063f..481f4ed5d 100644 --- a/Source/Project64/User Interface/Rom Browser Class.cpp +++ b/Source/Project64/User Interface/Rom Browser Class.cpp @@ -1581,8 +1581,9 @@ void CRomBrowser::FixRomListWindow (void) { SetWindowPos((HWND)m_MainWindow,NULL,0,0,WindowWidth,WindowHeight,SWP_NOMOVE|SWP_NOZORDER); } -void CRomBrowser::ShowRomList (void) { - if (g_Settings->LoadBool(GameRunning_CPU_Running)) { return; } +void CRomBrowser::ShowRomList (void) +{ + if (m_Visible || g_Settings->LoadBool(GameRunning_CPU_Running)) { return; } m_ShowingRomBrowser = true; WatchThreadStop(); if (m_hRomList == NULL) { CreateRomListControl(); } diff --git a/Source/Project64/ValidateBinary.cpp b/Source/Project64/ValidateBinary.cpp index 89bf28aae..8f40e3f3f 100644 --- a/Source/Project64/ValidateBinary.cpp +++ b/Source/Project64/ValidateBinary.cpp @@ -1,4 +1,6 @@ #include "stdafx.h" +#ifdef BETA_RELEASE + #include #pragma comment(lib, "Wininet.lib") @@ -413,7 +415,7 @@ void TestValidBinaryThread ( ) void TestValidBinary ( ) { -#if defined(EXTERNAL_RELEASE) || defined(VALIDATE_BIN_LOCAL) +#if defined(BETA_RELEASE) || defined(VALIDATE_BIN_LOCAL) static DWORD ThreadID = 0; if (ThreadID == 0) { @@ -422,3 +424,5 @@ void TestValidBinary ( ) } #endif } + +#endif \ No newline at end of file diff --git a/Source/Project64/main.cpp b/Source/Project64/main.cpp index 90aeca300..0acc5295f 100644 --- a/Source/Project64/main.cpp +++ b/Source/Project64/main.cpp @@ -337,15 +337,17 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lps //Create the main window with Menu WriteTrace(TraceDebug,__FUNCTION__ ": Create Main Window"); stdstr WinTitle(AppName); - if (g_Settings->LoadBool(Beta_IsBetaVersion)) - { - WinTitle.Format("Project64 %s (%s)",VersionInfo(VERSION_PRODUCT_VERSION).c_str(),g_Settings->LoadString(Beta_UserName).c_str()); - } +#ifdef BETA_RELEASE + WinTitle.Format("Project64 %s (%s)",VersionInfo(VERSION_PRODUCT_VERSION).c_str(),g_Settings->LoadString(Beta_UserName).c_str()); +#else + WinTitle.Format("Project64 %s",VersionInfo(VERSION_PRODUCT_VERSION).c_str()); +#endif CMainGui MainWindow(true,WinTitle.c_str()), HiddenWindow(false); CMainMenu MainMenu(&MainWindow); g_Plugins->SetRenderWindows(&MainWindow,&HiddenWindow); g_Notify->SetMainWindow(&MainWindow); +#ifdef BETA_RELEASE { stdstr_f User("%s",g_Settings->LoadString(Beta_UserName).c_str()); stdstr_f Email("%s",g_Settings->LoadString(Beta_EmailAddress).c_str()); @@ -356,7 +358,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lps return false; } } - +#endif if (__argc > 1) { WriteTraceF(TraceDebug,__FUNCTION__ ": Cmd line found \"%s\"",__argv[1]); MainWindow.Show(true); //Show the main window diff --git a/Source/RSP/Main.cpp b/Source/RSP/Main.cpp index ead68db22..255170004 100644 --- a/Source/RSP/Main.cpp +++ b/Source/RSP/Main.cpp @@ -205,8 +205,6 @@ __declspec(dllexport) void GetDllInfo ( PLUGIN_INFO * PluginInfo ) { output: none *******************************************************************/ -#if !defined(EXTERNAL_RELEASE) - void FixMenuState (void) { EnableMenuItem(hRSPMenu,ID_RSPCOMMANDS,MF_BYCOMMAND| (DebuggingEnabled ? MF_ENABLED : (MF_GRAYED | MF_DISABLED))); @@ -251,8 +249,6 @@ __declspec(dllexport) void GetRspDebugInfo ( RSPDEBUG_INFO * DebugInfo ) DebugInfo->Enter_RSP_Commands_Window = Enter_RSP_Commands_Window; } -#endif - /****************************************************************** Function: InitiateRSP Purpose: This function is called when the DLL is started to give @@ -328,9 +324,6 @@ __declspec(dllexport) void InitiateRSP ( RSP_INFO Rsp_Info, DWORD * CycleCount) above. output: none *******************************************************************/ - -#if !defined(EXTERNAL_RELEASE) - __declspec(dllexport) void InitiateRSPDebugger ( DEBUG_INFO Debug_Info) { DebugInfo = Debug_Info; } @@ -476,8 +469,6 @@ void ProcessMenuItem(int ID) { } } -#endif - /****************************************************************** Function: RomOpen Purpose: This function is called when a rom is opened. @@ -518,8 +509,6 @@ static BOOL GetBooleanCheck(HWND hDlg, DWORD DialogID) { return (IsDlgButtonChecked(hDlg, DialogID) == BST_CHECKED) ? TRUE : FALSE; } -#if !defined(EXTERNAL_RELEASE) - BOOL CALLBACK CompilerDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { char Buffer[256]; @@ -598,7 +587,6 @@ BOOL CALLBACK CompilerDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam } return TRUE; } -#endif BOOL CALLBACK ConfigDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { HWND hWndItem;