diff --git a/plugins/spu2-x/src/Config.h b/plugins/spu2-x/src/Config.h index 9a19f99a65..30956b11dc 100644 --- a/plugins/spu2-x/src/Config.h +++ b/plugins/spu2-x/src/Config.h @@ -40,7 +40,7 @@ static __forceinline bool MsgToConsole() { return _MsgToConsole & DebugEnabled; static __forceinline bool MsgKeyOnOff() { return _MsgKeyOnOff & MsgToConsole(); } static __forceinline bool MsgVoiceOff() { return _MsgVoiceOff & MsgToConsole(); } static __forceinline bool MsgDMA() { return _MsgDMA & MsgToConsole(); } -static __forceinline bool MsgAutoDMA() { return _MsgAutoDMA & MsgDMA(); } +static __forceinline bool MsgAutoDMA() { return _MsgAutoDMA & MsgToConsole(); } static __forceinline bool MsgOverruns() { return _MsgOverruns & MsgToConsole(); } static __forceinline bool MsgCache() { return _MsgCache & MsgToConsole(); } diff --git a/plugins/spu2-x/src/PS2E-spu2.cpp b/plugins/spu2-x/src/PS2E-spu2.cpp index 0998c15c01..84fd5d0149 100644 --- a/plugins/spu2-x/src/PS2E-spu2.cpp +++ b/plugins/spu2-x/src/PS2E-spu2.cpp @@ -366,6 +366,46 @@ EXPORT_C_(s32) SPU2init() return 0; } +// Bit ugly to have this here instead of in RealttimeDebugger.cpp, but meh :p +extern bool debugDialogOpen; +extern HWND hDebugDialog; + +static BOOL CALLBACK DebugProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) +{ + int wmId,wmEvent; + + switch(uMsg) + { + case WM_PAINT: + return FALSE; + case WM_INITDIALOG: + { + debugDialogOpen=true; + } + break; + + case WM_COMMAND: + wmId = LOWORD(wParam); + wmEvent = HIWORD(wParam); + // Parse the menu selections: + switch (wmId) + { + case IDOK: + case IDCANCEL: + debugDialogOpen=false; + EndDialog(hWnd,0); + break; + default: + return FALSE; + } + break; + + default: + return FALSE; + } + return TRUE; +} + uptr gsWindowHandle = 0; EXPORT_C_(s32) SPU2open(void *pDsp) @@ -379,12 +419,12 @@ EXPORT_C_(s32) SPU2open(void *pDsp) else gsWindowHandle = 0; - /* - if(debugDialogOpen==0) + // uncomment for a visual debug display showing all core's activity! + /*if(debugDialogOpen==0) { - hDebugDialog = CreateDialogParam(hInstance,MAKEINTRESOURCE(IDD_DEBUG),0,DebugProc,0); - ShowWindow(hDebugDialog,SW_SHOWNORMAL); - debugDialogOpen=1; + hDebugDialog = CreateDialogParam(hInstance,MAKEINTRESOURCE(IDD_DEBUG),0,DebugProc,0); + ShowWindow(hDebugDialog,SW_SHOWNORMAL); + debugDialogOpen=1; }*/ IsOpened = true; diff --git a/plugins/spu2-x/src/Windows/ConfigDebug.cpp b/plugins/spu2-x/src/Windows/ConfigDebug.cpp index af21bfe7ec..45293c4d76 100644 --- a/plugins/spu2-x/src/Windows/ConfigDebug.cpp +++ b/plugins/spu2-x/src/Windows/ConfigDebug.cpp @@ -159,7 +159,7 @@ static void EnableMessages( HWND hWnd ) ENABLE_CONTROL(IDC_MSGKEY, MsgToConsole()); ENABLE_CONTROL(IDC_MSGVOICE,MsgToConsole()); ENABLE_CONTROL(IDC_MSGDMA, MsgToConsole()); - ENABLE_CONTROL(IDC_MSGADMA, MsgDMA()); + ENABLE_CONTROL(IDC_MSGADMA, MsgToConsole()); ENABLE_CONTROL(IDC_DBG_OVERRUNS, MsgToConsole()); ENABLE_CONTROL(IDC_DBG_CACHE, MsgToConsole()); } @@ -230,11 +230,10 @@ static BOOL CALLBACK DialogProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) HANDLE_CHECK(IDC_MSGKEY,_MsgKeyOnOff); HANDLE_CHECK(IDC_MSGVOICE,_MsgVoiceOff); - HANDLE_CHECKNB(IDC_MSGDMA,_MsgDMA); - ENABLE_CONTROL(IDC_MSGADMA, MsgDMA()); + HANDLE_CHECK(IDC_MSGDMA,_MsgDMA); + HANDLE_CHECK(IDC_MSGADMA,_MsgAutoDMA); break; - HANDLE_CHECK(IDC_MSGADMA,_MsgAutoDMA); HANDLE_CHECK(IDC_DBG_OVERRUNS,_MsgOverruns); HANDLE_CHECK(IDC_DBG_CACHE,_MsgCache); HANDLE_CHECK(IDC_LOGREGS,_AccessLog); diff --git a/plugins/spu2-x/src/Windows/RealtimeDebugger.cpp b/plugins/spu2-x/src/Windows/RealtimeDebugger.cpp index 9c76eefeca..91c40d37d4 100644 --- a/plugins/spu2-x/src/Windows/RealtimeDebugger.cpp +++ b/plugins/spu2-x/src/Windows/RealtimeDebugger.cpp @@ -15,49 +15,11 @@ * along with SPU2-X. If not, see . */ - #include "Global.h" #include "Dialogs.h" - -static bool debugDialogOpen=false; -static HWND hDebugDialog=NULL; - -static BOOL CALLBACK DebugProc(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) -{ - int wmId,wmEvent; - - switch(uMsg) - { - case WM_PAINT: - return FALSE; - case WM_INITDIALOG: - { - debugDialogOpen=true; - } - break; - - case WM_COMMAND: - wmId = LOWORD(wParam); - wmEvent = HIWORD(wParam); - // Parse the menu selections: - switch (wmId) - { - case IDOK: - case IDCANCEL: - debugDialogOpen=false; - EndDialog(hWnd,0); - break; - default: - return FALSE; - } - break; - - default: - return FALSE; - } - return TRUE; -} +bool debugDialogOpen=false; +HWND hDebugDialog=NULL; #ifdef PCSX2_DEVBUILD @@ -91,7 +53,7 @@ void UpdateDebugDialog() if(!debugDialogOpen) return; lCount++; - if(lCount>=(SampleRate/10)) + if(lCount>=(SampleRate/100)) { HDC hdc = GetDC(hDebugDialog); diff --git a/plugins/spu2-x/src/spu2sys.cpp b/plugins/spu2-x/src/spu2sys.cpp index cffa01f331..e31a4d9422 100644 --- a/plugins/spu2-x/src/spu2sys.cpp +++ b/plugins/spu2-x/src/spu2sys.cpp @@ -273,6 +273,7 @@ void V_Voice::Stop() uint TickInterval = 768; static const int SanityInterval = 4800; +extern void UpdateDebugDialog(); __forceinline void TimeUpdate(u32 cClocks) { @@ -295,7 +296,10 @@ __forceinline void TimeUpdate(u32 cClocks) lClocks = cClocks - dClocks; } + // Uncomment for a visual debug display showing all core's activity! + // Also need to uncomment a few lines in SPU2open //UpdateDebugDialog(); + if( SynchMode == 1 ) // AsyncMix on SndBuffer::UpdateTempoChangeAsyncMixing(); else TickInterval = 768; // Reset to default, in case the user hotswitched from async to something else.