SPU2-X: Further tweaks and additions to the debugger.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4218 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
ramapcsx2 2011-01-16 02:10:19 +00:00
parent c46f8ae224
commit 6f1b8c23af
6 changed files with 38 additions and 19 deletions

View File

@ -274,7 +274,7 @@ void V_Core::PlainDMAWrite(u16 *pMem, u32 size)
if ((Cores[i].IRQEnable && (Cores[i].IRQA >= TSA)) || (Cores[i].IRQA < TDA))
{
ConLog("DMAwrite Core %d: IRQ Called (IRQ passed). IRQA = %x Cycles = %d\n", i, Cores[i].IRQA, Cycles );
//ConLog("DMAwrite Core %d: IRQ Called (IRQ passed). IRQA = %x Cycles = %d\n", i, Cores[i].IRQA, Cycles );
SetIrqCall(i);
}
}
@ -302,7 +302,7 @@ void V_Core::PlainDMAWrite(u16 *pMem, u32 size)
if( Cores[i].IRQEnable && (Cores[i].IRQA >= TSA) && (Cores[i].IRQA < TDA) )
{
ConLog("DMAwrite Core %d: IRQ Called (IRQ passed). IRQA = %x Cycles = %d\n", i, Cores[i].IRQA, Cycles );
//ConLog("DMAwrite Core %d: IRQ Called (IRQ passed). IRQA = %x Cycles = %d\n", i, Cores[i].IRQA, Cycles );
SetIrqCall(i);
}
}
@ -403,7 +403,10 @@ void V_Core::DoDMAwrite(u16* pMem, u32 size)
}
if( IsDevBuild )
{
DebugCores[Index].lastsize = size;
DebugCores[Index].dmaFlag = 2;
}
TSA &= ~7;

View File

@ -112,8 +112,8 @@ static void __forceinline IncrementNextA(V_Core& thiscore, uint voiceidx)
{
if( Cores[i].IRQEnable && (vc.NextA==Cores[i].IRQA ) )
{
if( IsDevBuild )
ConLog(" * SPU2 Core %d: IRQ Called (IRQA (%05X) passed; voice %d).\n", i, Cores[i].IRQA, thiscore.Index * 24 + voiceidx);
//if( IsDevBuild )
// ConLog(" * SPU2 Core %d: IRQ Called (IRQA (%05X) passed; voice %d).\n", i, Cores[i].IRQA, thiscore.Index * 24 + voiceidx);
SetIrqCall(i);
}

View File

@ -53,7 +53,7 @@ void UpdateDebugDialog()
if(!debugDialogOpen) return;
lCount++;
if(lCount>=(SampleRate/50))
if(lCount>=(SampleRate/100)) // Increase to SampleRate/200 for smooth display.
{
HDC hdc = GetDC(hDebugDialog);
@ -152,7 +152,7 @@ void UpdateDebugDialog()
SetTextColor(hdc,RGB( 0,255, 0));
SetBkColor (hdc,RGB( 0, 0, 0));
static wchar_t t[1024];
static wchar_t t[256];
swprintf_s(t,L"%06x",vc.StartA);
TextOut(hdc,IX+4,IY+4,t,6);
@ -180,8 +180,8 @@ void UpdateDebugDialog()
SetDCBrushColor(hdc,RGB( 0, 0, 0));
SetDCPenColor(hdc,RGB( 255, 128, 32));
FillRectangle(hdc,JX,JY,252,46);
DrawRectangle(hdc,JX,JY,252,46);
FillRectangle(hdc,JX,JY,252,60);
DrawRectangle(hdc,JX,JY,252,60);
SetTextColor(hdc,RGB(255,255,255));
SetBkColor (hdc,RGB( 0, 0, 0));
@ -189,8 +189,11 @@ void UpdateDebugDialog()
TextOut(hdc,JX+4,JY+ 4,L"REVB",4);
TextOut(hdc,JX+4,JY+18,L"IRQE",4);
TextOut(hdc,JX+4,JY+32,L"ADMA",4);
static wchar_t t[256];
swprintf_s(t,L"DMA%s",c==0 ? "4" : "7");
TextOut(hdc,JX+4,JY+46,t, 4);
SetDCBrushColor(hdc,RGB( 0,255, 0));
SetDCBrushColor(hdc,RGB( 255,0, 0));
if(cx.FxEnable)
{
@ -207,7 +210,7 @@ void UpdateDebugDialog()
for(int j=0;j<64;j++)
{
int i=j*256/64;
int val = (cd.admaWaveformL[i] * 20) / 32768;
int val = (cd.admaWaveformL[i] * 26) / 32768;
int y=0;
if(val>0)
@ -217,14 +220,14 @@ void UpdateDebugDialog()
if(val!=0)
{
FillRectangle(hdc,JX+60+j,JY+24-y, 1, val);
FillRectangle(hdc,JX+60+j,JY+30-y, 1, val);
}
}
for(int j=0;j<64;j++)
{
int i=j*256/64;
int val = (cd.admaWaveformR[i] * 20) / 32768;
int val = (cd.admaWaveformR[i] * 26) / 32768;
int y=0;
if(val>0)
@ -234,10 +237,19 @@ void UpdateDebugDialog()
if(val!=0)
{
FillRectangle(hdc,JX+136+j,JY+24-y, 1, val);
FillRectangle(hdc,JX+136+j,JY+30-y, 1, val);
}
}
}
if(cd.dmaFlag > 0) // So it shows x times this is called, since dmas are so fast
{
static wchar_t t[256];
swprintf_s(t,L"size = %d",cd.lastsize);
TextOut(hdc,JX+64,JY+46,t,wcslen(t));
FillRectangle(hdc,JX+40,JY+46,10,10);
cd.dmaFlag--;
}
}
ReleaseDC(hDebugDialog,hdc);

View File

@ -79,12 +79,12 @@ BEGIN
COMBOBOX IDC_SYNCHMODE,163,103,134,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
END
IDD_DEBUG DIALOGEX 0, 0, 303, 443
IDD_DEBUG DIALOGEX 0, 0, 303, 473
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "SPU2-X Debug"
FONT 9, "Lucida Console", 400, 0, 0x0
BEGIN
DEFPUSHBUTTON "Close",IDOK,246,421,50,14
DEFPUSHBUTTON "Close",IDOK,246,451,50,14
END
IDD_DSOUND DIALOGEX 0, 0, 196, 218
@ -213,7 +213,7 @@ BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 296
TOPMARGIN, 7
BOTTOMMARGIN, 435
BOTTOMMARGIN, 465
END
IDD_DSOUND, DIALOG

View File

@ -212,8 +212,12 @@ struct V_CoreDebug
// Last Transfer Size
u32 lastsize;
// draw adma waveform in the visual debugger
s32 admaWaveformL[0x100];
s32 admaWaveformR[0x100];
// Enabled when a dma write starts, disabled when the visual debugger showed it once
s32 dmaFlag;
};
// Debug tracking information - 24 voices and 2 cores.

View File

@ -381,7 +381,7 @@ __forceinline void TimeUpdate(u32 cClocks)
{
if(has_to_call_irq)
{
ConLog("* SPU2-X: Irq Called (%04x) at cycle %d.\n", Spdif.Info, Cycles);
//ConLog("* SPU2-X: Irq Called (%04x) at cycle %d.\n", Spdif.Info, Cycles);
has_to_call_irq=false;
if(_irqcallback) _irqcallback();
}
@ -976,8 +976,8 @@ static void __fastcall RegWrite_Core( u16 value )
}
if(thiscore.IRQEnable!=irqe)
{
ConLog("* SPU2-X: IRQ %s at cycle %d. Current IRQA = %x\n",
((thiscore.IRQEnable==0)?"disabled":"enabled"), Cycles, thiscore.IRQA);
//ConLog("* SPU2-X: IRQ %s at cycle %d. Current IRQA = %x\n",
// ((thiscore.IRQEnable==0)?"disabled":"enabled"), Cycles, thiscore.IRQA);
if(!thiscore.IRQEnable)
Spdif.Info &= ~(4 << thiscore.Index);