SPU2X: Better control of debug messages. (Now they actually print when enable at the SPU2X debug GUI).

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4842 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
avihal@gmail.com 2011-08-04 16:51:59 +00:00
parent 0a4c082e4b
commit fc359249e4
2 changed files with 9 additions and 8 deletions

View File

@ -47,12 +47,14 @@ void FileLog(const char *fmt, ...) {
#endif
}
//Note to developer on the usage of ConLog:
// while ConLog doesn't print anything if messages to console are disabled at the GUI,
// it's still better to outright not call it on tight loop scenarios, by testing MsgToConsole() (which is inline and very quick).
// Else, there's some (small) overhead in calling and returning from ConLog.
void ConLog(const char *fmt, ...) {
#ifdef SPU2_LOG
va_list list;
if(!MsgToConsole()) return;
va_list list;
va_start(list, fmt);
vsprintf(s,fmt, list);
va_end(list);
@ -65,7 +67,6 @@ void ConLog(const char *fmt, ...) {
fputs(s,spu2Log);
fflush(spu2Log);
}
#endif
}
void V_VolumeSlide::DebugDump( FILE* dump, const char* title, const char* nameLR )

View File

@ -80,7 +80,7 @@ __forceinline void spu2M_Write( u32 addr, s16 value )
const int cacheIdx = addr / pcm_WordsPerBlock;
pcm_cache_data[cacheIdx].Validated = false;
ConLog( "* SPU2-X: PcmCache Block Clear at 0x%x (cacheIdx=0x%x)\n", addr, cacheIdx);
if(MsgToConsole()) ConLog( "* SPU2-X: PcmCache Block Clear at 0x%x (cacheIdx=0x%x)\n", addr, cacheIdx);
}
*GetMemPtr( addr ) = value;
}
@ -360,7 +360,7 @@ __forceinline void TimeUpdate(u32 cClocks)
if( dClocks > (u32)(TickInterval*SanityInterval) )
{
ConLog( " * SPU2 > TimeUpdate Sanity Check (Tick Delta: %d) (PS2 Ticks: %d)\n", dClocks/TickInterval, cClocks/TickInterval );
if(MsgToConsole()) ConLog( " * SPU2 > TimeUpdate Sanity Check (Tick Delta: %d) (PS2 Ticks: %d)\n", dClocks/TickInterval, cClocks/TickInterval );
dClocks = TickInterval * SanityInterval;
lClocks = cClocks - dClocks;
}
@ -942,12 +942,12 @@ static void __fastcall RegWrite_Core( u16 value )
if(value&0x000E)
{
ConLog("* SPU2-X: Core %d ATTR unknown bits SET! value=%04x\n",core,value);
if(MsgToConsole()) ConLog("* SPU2-X: Core %d ATTR unknown bits SET! value=%04x\n",core,value);
}
if(thiscore.AttrBit0!=bit0)
{
ConLog("* SPU2-X: ATTR bit 0 set to %d\n",thiscore.AttrBit0);
if(MsgToConsole()) ConLog("* SPU2-X: ATTR bit 0 set to %d\n",thiscore.AttrBit0);
}
if(thiscore.IRQEnable!=irqe)
{