From ae0f0f8dcdf62daf0c389f7824a5c7f49272b563 Mon Sep 17 00:00:00 2001 From: "fires.gc" Date: Wed, 22 Oct 2008 10:36:26 +0000 Subject: [PATCH] reverted log manager... i hope that i havn't reverted to much but a lot of files are affected. if someone runs in any problems please tell me. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@936 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../wxWidgets/lib/vc_lib/msw/wx/msw/rcdefs.h | 2 +- Source/Core/Core/Core.vcproj | 12 +- Source/Core/Core/Src/Boot/Boot_BIOSEmu.cpp | 4 +- Source/Core/Core/Src/CoreTiming.cpp | 2 +- Source/Core/Core/Src/HW/AudioInterface.cpp | 10 +- Source/Core/Core/Src/HW/CommandProcessor.cpp | 8 +- Source/Core/Core/Src/HW/DSP.cpp | 10 +- Source/Core/Core/Src/HW/DVDInterface.cpp | 6 +- Source/Core/Core/Src/HW/EXI_Channel.cpp | 12 +- Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp | 4 +- .../Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp | 6 +- .../Core/Core/Src/HW/PeripheralInterface.cpp | 6 +- Source/Core/Core/Src/HW/PixelEngine.cpp | 10 +- Source/Core/Core/Src/HW/SerialInterface.cpp | 6 +- Source/Core/Core/Src/HW/VideoInterface.cpp | 4 +- Source/Core/Core/Src/HW/WII_IOB.cpp | 12 +- Source/Core/Core/Src/HW/WII_IPC.cpp | 10 +- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 4 +- Source/Core/Core/Src/LogManager.cpp | 236 ++++++---------- Source/Core/Core/Src/LogManager.h | 33 +-- .../Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp | 20 +- Source/Core/Core/Src/PowerPC/PowerPC.cpp | 10 +- Source/Core/Core/Src/PowerPC/SignatureDB.cpp | 2 +- .../Core/DebuggerWX/Src/BreakpointWindow.cpp | 18 +- Source/Core/DebuggerWX/Src/Debugger.h | 2 - Source/Core/DebuggerWX/Src/LogWindow.cpp | 252 ++++-------------- Source/Core/DebuggerWX/Src/LogWindow.h | 4 - Source/Dolphin.sln | 2 - .../Plugin_DSP_HLE/Src/Debugger/Debugger.cpp | 157 +++++++---- .../Plugin_DSP_HLE/Src/Debugger/Debugger.h | 27 +- 30 files changed, 350 insertions(+), 541 deletions(-) diff --git a/Externals/wxWidgets/lib/vc_lib/msw/wx/msw/rcdefs.h b/Externals/wxWidgets/lib/vc_lib/msw/wx/msw/rcdefs.h index dc2c7fecc6..66c9f7fccf 100644 --- a/Externals/wxWidgets/lib/vc_lib/msw/wx/msw/rcdefs.h +++ b/Externals/wxWidgets/lib/vc_lib/msw/wx/msw/rcdefs.h @@ -14,7 +14,7 @@ #define _WX_RCDEFS_H -#define WX_MSC_FULL_VER 140050727 +#define WX_MSC_FULL_VER 150030729 diff --git a/Source/Core/Core/Core.vcproj b/Source/Core/Core/Core.vcproj index 0084e6eb7b..bd2ab5fb2d 100644 --- a/Source/Core/Core/Core.vcproj +++ b/Source/Core/Core/Core.vcproj @@ -45,7 +45,7 @@ =0x20) @@ -258,7 +258,7 @@ bool AllowIdleSkipping() void Write16(const u16 _Value, const u32 _Address) { - LOG(COMMANDPROCESSOR + 100, "(w): 0x%04x @ 0x%08x",_Value,_Address); + LOG(COMMANDPROCESSOR, "(w): 0x%04x @ 0x%08x",_Value,_Address); //Spin until queue is empty - it WILL become empty because this is the only thread //that submits data @@ -275,7 +275,7 @@ void Write16(const u16 _Value, const u32 _Address) while (fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > 0 && !(fifo.bFF_BPEnable && fifo.bFF_Breakpoint)) //while (fifo.bFF_GPReadEnable && fifo.CPReadWriteDistance > fifo.CPHiWatermark && !(fifo.bFF_BPEnable && fifo.bFF_Breakpoint)) ct++; - if (ct) {LOG(COMMANDPROCESSOR + 200, "(Write16): %lu cycles for nothing :[ ", ct);} + if (ct) {LOG(COMMANDPROCESSOR, "(Write16): %lu cycles for nothing :[ ", ct);} } #ifdef _WIN32 //EnterCriticalSection(&fifo.sync); @@ -426,7 +426,7 @@ void GatherPipeBursted() while (!(fifo.bFF_BPEnable && fifo.bFF_Breakpoint) && fifo.CPReadWriteDistance > (s32)fifo.CPHiWatermark) //Common::SleepCurrentThread(1000); // 1s for test. We shouldn't fall here ever ct++; - if (ct) {LOG(COMMANDPROCESSOR + 100, "(GatherPipeBursted): %lu cycle for nothing :[ ", ct);} + if (ct) {LOG(COMMANDPROCESSOR, "(GatherPipeBursted): %lu cycle for nothing :[ ", ct);} #ifdef _WIN32 diff --git a/Source/Core/Core/Src/HW/DSP.cpp b/Source/Core/Core/Src/HW/DSP.cpp index 7994674750..344c04ba00 100644 --- a/Source/Core/Core/Src/HW/DSP.cpp +++ b/Source/Core/Core/Src/HW/DSP.cpp @@ -218,7 +218,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) if ((_iAddress & 0x6C00) != 0x6c00) { if (_iAddress != 0xCC005004) { - LOG(DSPINTERFACE + 300, "DSPInterface(r16) 0x%08x", _iAddress); + LOG(DSPINTERFACE, "DSPInterface(r16) 0x%08x", _iAddress); } switch (_iAddress & 0xFFFF) @@ -303,7 +303,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) void Write16(const u16 _Value, const u32 _Address) { - LOG(DSPINTERFACE + 300, "DSPInterface(w16) 0x%04x 0x%08x", _Value, _Address); + LOG(DSPINTERFACE, "DSPInterface(w16) 0x%04x 0x%08x", _Value, _Address); switch(_Address & 0xFFFF) { @@ -559,13 +559,13 @@ void Update_ARAM_DMA() return; g_arDMA.CntValid[0] = g_arDMA.CntValid[1] = false; - LOG(DSPINTERFACE + 100,"ARAM DMA triggered"); + LOG(DSPINTERFACE,"ARAM DMA triggered"); //TODO: speedup if (g_arDMA.Cnt.dir) { //read from ARAM - LOG(DSPINTERFACE + 100,"ARAM DMA read %08x bytes from %08x to Mem: %08x",g_arDMA.Cnt.count, g_arDMA.ARAddr, g_arDMA.MMAddr); + LOG(DSPINTERFACE,"ARAM DMA read %08x bytes from %08x to Mem: %08x",g_arDMA.Cnt.count, g_arDMA.ARAddr, g_arDMA.MMAddr); u32 iMemAddress = g_arDMA.MMAddr; u32 iARAMAddress = g_arDMA.ARAddr; @@ -585,7 +585,7 @@ void Update_ARAM_DMA() u32 iARAMAddress = g_arDMA.ARAddr; //write to g_ARAM - LOG(DSPINTERFACE + 100,"g_ARAM DMA write %08x bytes from %08x to Aram: %08x",g_arDMA.Cnt.count, g_arDMA.MMAddr, g_arDMA.ARAddr); + LOG(DSPINTERFACE,"g_ARAM DMA write %08x bytes from %08x to Aram: %08x",g_arDMA.Cnt.count, g_arDMA.MMAddr, g_arDMA.ARAddr); for (u32 i = 0; i < g_arDMA.Cnt.count; i++) { if (iARAMAddress < ARAM_SIZE) diff --git a/Source/Core/Core/Src/HW/DVDInterface.cpp b/Source/Core/Core/Src/HW/DVDInterface.cpp index 4262a7d267..2d1ba8864c 100644 --- a/Source/Core/Core/Src/HW/DVDInterface.cpp +++ b/Source/Core/Core/Src/HW/DVDInterface.cpp @@ -279,7 +279,7 @@ bool DVDReadADPCM(u8* _pDestBuffer, u32 _iNumSamples) void Read32(u32& _uReturnValue, const u32 _iAddress) { - LOG(DVDINTERFACE + 300, "DVD(r): 0x%08x", _iAddress); + LOG(DVDINTERFACE, "DVD(r): 0x%08x", _iAddress); switch (_iAddress & 0xFFF) { @@ -308,7 +308,7 @@ void Read32(u32& _uReturnValue, const u32 _iAddress) void Write32(const u32 _iValue, const u32 _iAddress) { - LOG(DVDINTERFACE + 300, "DVD(w): 0x%08x @ 0x%08x", _iValue, _iAddress); + LOG(DVDINTERFACE, "DVD(w): 0x%08x @ 0x%08x", _iValue, _iAddress); switch (_iAddress & 0x3FF) { @@ -466,7 +466,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg) u32 iDVDOffset = dvdMem.Command[1] << 2; u32 iSrcLength = dvdMem.Command[2]; if (false) { iSrcLength++; } // avoid warning << wtf is this? - LOG(DVDINTERFACE + 200, "DVD: Read ISO: DVDOffset=%08x, DMABuffer=%08x, SrcLength=%08x, DMALength=%08x",iDVDOffset,dvdMem.DMAAddress.Address,iSrcLength,dvdMem.DMALength.Length); + LOG(DVDINTERFACE, "DVD: Read ISO: DVDOffset=%08x, DMABuffer=%08x, SrcLength=%08x, DMALength=%08x",iDVDOffset,dvdMem.DMAAddress.Address,iSrcLength,dvdMem.DMALength.Length); _dbg_assert_(DVDINTERFACE, iSrcLength == dvdMem.DMALength.Length); if (DVDRead(iDVDOffset, dvdMem.DMAAddress.Address, dvdMem.DMALength.Length) != true) diff --git a/Source/Core/Core/Src/HW/EXI_Channel.cpp b/Source/Core/Core/Src/HW/EXI_Channel.cpp index 227d533c99..2d8669235a 100644 --- a/Source/Core/Core/Src/HW/EXI_Channel.cpp +++ b/Source/Core/Core/Src/HW/EXI_Channel.cpp @@ -128,7 +128,7 @@ void CEXIChannel::Update() void CEXIChannel::Read32(u32& _uReturnValue, const u32 _iRegister) { - LOG(EXPANSIONINTERFACE + 300, "ExtensionInterface(R): channel: %i reg: %i", m_ChannelId, _iRegister); + LOG(EXPANSIONINTERFACE, "ExtensionInterface(R): channel: %i reg: %i", m_ChannelId, _iRegister); switch (_iRegister) { @@ -172,7 +172,7 @@ void CEXIChannel::Read32(u32& _uReturnValue, const u32 _iRegister) void CEXIChannel::Write32(const u32 _iValue, const u32 _iRegister) { - LOG(EXPANSIONINTERFACE + 200, "ExtensionInterface(W): 0x%08x channel: %i reg: %i", _iValue, m_ChannelId, _iRegister); + LOG(EXPANSIONINTERFACE, "ExtensionInterface(W): 0x%08x channel: %i reg: %i", _iValue, m_ChannelId, _iRegister); switch (_iRegister) { @@ -226,17 +226,17 @@ void CEXIChannel::Write32(const u32 _iValue, const u32 _iRegister) break; case EXI_DMAADDR: - LOG(EXPANSIONINTERFACE + 200, "EXI: Wrote DMABuf, chan %i", m_ChannelId); + LOG(EXPANSIONINTERFACE, "EXI: Wrote DMABuf, chan %i", m_ChannelId); m_DMAMemoryAddress = _iValue; break; case EXI_DMALENGTH: - LOG(EXPANSIONINTERFACE + 200, "EXI: Wrote DMASize, chan %i", m_ChannelId); + LOG(EXPANSIONINTERFACE, "EXI: Wrote DMASize, chan %i", m_ChannelId); m_DMALength = _iValue; break; case EXI_DMACONTROL: - LOG(EXPANSIONINTERFACE + 200, "EXI: Wrote DMAControl, chan %i", m_ChannelId); + LOG(EXPANSIONINTERFACE, "EXI: Wrote DMAControl, chan %i", m_ChannelId); m_Control.hex = _iValue; if (m_Control.TSTART) @@ -277,7 +277,7 @@ void CEXIChannel::Write32(const u32 _iValue, const u32 _iRegister) break; case EXI_IMMDATA: - LOG(EXPANSIONINTERFACE + 200, "EXI: Wrote IMMData, chan %i", m_ChannelId); + LOG(EXPANSIONINTERFACE, "EXI: Wrote IMMData, chan %i", m_ChannelId); m_ImmData = _iValue; break; } diff --git a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp index 773a2a7920..a5354c490b 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp @@ -188,7 +188,7 @@ void CEXIIPL::TransferByte(u8& _uByte) // debug only else if ((m_uAddress & 0x60000000) == 0) { - LOG(EXPANSIONINTERFACE + 200, "EXI IPL-DEV: IPL access"); + LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: IPL access"); } else if ((m_uAddress & 0x7FFFFF00) == 0x20000000) { @@ -200,7 +200,7 @@ void CEXIIPL::TransferByte(u8& _uByte) } else if ((m_uAddress & 0x7FFFFF00) == 0x20010000) { - LOG(EXPANSIONINTERFACE + 300, "EXI IPL-DEV: UART"); + LOG(EXPANSIONINTERFACE, "EXI IPL-DEV: UART"); } else { diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp index 0b40b7a2d8..bda0490221 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp @@ -252,12 +252,12 @@ bool CEXIMemoryCard::IsInterruptSet() void CEXIMemoryCard::TransferByte(u8 &byte) { - LOG(EXPANSIONINTERFACE + 300, "EXI MEMCARD: > %02x", byte); + LOG(EXPANSIONINTERFACE, "EXI MEMCARD: > %02x", byte); if (m_uPosition == 0) { command = byte; // first byte is command byte = 0xFF; // would be tristate, but we don't care. - LOG(EXPANSIONINTERFACE + 100, "EXI MEMCARD: command %02x", byte) + LOG(EXPANSIONINTERFACE, "EXI MEMCARD: command %02x", byte) if(command == cmdClearStatus) { @@ -382,5 +382,5 @@ void CEXIMemoryCard::TransferByte(u8 &byte) } } m_uPosition++; - LOG(EXPANSIONINTERFACE + 300, "EXI MEMCARD: < %02x", byte); + LOG(EXPANSIONINTERFACE, "EXI MEMCARD: < %02x", byte); } diff --git a/Source/Core/Core/Src/HW/PeripheralInterface.cpp b/Source/Core/Core/Src/HW/PeripheralInterface.cpp index 1582a16151..e48e495766 100644 --- a/Source/Core/Core/Src/HW/PeripheralInterface.cpp +++ b/Source/Core/Core/Src/HW/PeripheralInterface.cpp @@ -79,7 +79,7 @@ void CPeripheralInterface::Read32(u32& _uReturnValue, const u32 _iAddress) return; case PI_FIFO_WPTR: - LOG(PERIPHERALINTERFACE + 300,"read writepointer, value = %08x",Fifo_CPUWritePointer); + LOG(PERIPHERALINTERFACE,"read writepointer, value = %08x",Fifo_CPUWritePointer); _uReturnValue = Fifo_CPUWritePointer; //really writes in 32-byte chunks // Monk's gcube does some crazy align trickery here. @@ -206,12 +206,12 @@ void CPeripheralInterface::SetInterrupt(InterruptCause _causemask, bool _bSet) if (_bSet && !(m_InterruptCause & (u32)_causemask)) { - LOG(PERIPHERALINTERFACE + 200,"Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "set"); + LOG(PERIPHERALINTERFACE,"Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "set"); } if (!_bSet && (m_InterruptCause & (u32)_causemask)) { - LOG(PERIPHERALINTERFACE + 200,"Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "clear"); + LOG(PERIPHERALINTERFACE,"Setting Interrupt %s (%s)",Debug_GetInterruptName(_causemask), "clear"); } if (_bSet) diff --git a/Source/Core/Core/Src/HW/PixelEngine.cpp b/Source/Core/Core/Src/HW/PixelEngine.cpp index 8101dfb7f7..290e3a6f71 100644 --- a/Source/Core/Core/Src/HW/PixelEngine.cpp +++ b/Source/Core/Core/Src/HW/PixelEngine.cpp @@ -87,7 +87,7 @@ void Init() void Read16(u16& _uReturnValue, const u32 _iAddress) { - LOG(PIXELENGINE + 300, "(r16): 0x%08x", _iAddress); + LOG(PIXELENGINE, "(r16): 0x%08x", _iAddress); switch (_iAddress & 0xFFF) { @@ -109,12 +109,12 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) void Write32(const u32 _iValue, const u32 _iAddress) { - LOG(PIXELENGINE + 200, "(w32): 0x%08x @ 0x%08x",_iValue,_iAddress); + LOG(PIXELENGINE, "(w32): 0x%08x @ 0x%08x",_iValue,_iAddress); } void Write16(const u16 _iValue, const u32 _iAddress) { - LOG(PIXELENGINE + 300, "(w16): 0x%04x @ 0x%08x",_iValue,_iAddress); + LOG(PIXELENGINE, "(w16): 0x%04x @ 0x%08x",_iValue,_iAddress); switch(_iAddress & 0xFFF) { @@ -169,7 +169,7 @@ void SetToken_OnMainThread(u64 userdata, int cyclesLate) if (userdata >> 16) g_bSignalTokenInterrupt = true; g_token = (u16)(userdata & 0xFFFF); - LOG(PIXELENGINE + 100, "VIDEO Plugin wrote token: %i", g_token); + LOG(PIXELENGINE, "VIDEO Plugin wrote token: %i", g_token); UpdateInterrupts(); } @@ -193,7 +193,7 @@ void SetFinish() { CoreTiming::ScheduleEvent_Threadsafe( 0, et_SetFinishOnMainThread); - LOG(PIXELENGINE + 200, "VIDEO Set Finish"); + LOG(PIXELENGINE, "VIDEO Set Finish"); } } // end of namespace PixelEngine diff --git a/Source/Core/Core/Src/HW/SerialInterface.cpp b/Source/Core/Core/Src/HW/SerialInterface.cpp index 90127f5b03..ac33eb92fd 100644 --- a/Source/Core/Core/Src/HW/SerialInterface.cpp +++ b/Source/Core/Core/Src/HW/SerialInterface.cpp @@ -268,7 +268,7 @@ void Shutdown() void Read32(u32& _uReturnValue, const u32 _iAddress) { - LOG(SERIALINTERFACE + 300, "(r32): 0x%08x", _iAddress); + LOG(SERIALINTERFACE, "(r32): 0x%08x", _iAddress); // SIBuffer if ((_iAddress >= 0xCC006480 && _iAddress < 0xCC006500) || @@ -375,7 +375,7 @@ void Read32(u32& _uReturnValue, const u32 _iAddress) void Write32(const u32 _iValue, const u32 _iAddress) { - LOG(SERIALINTERFACE + 300, "(w32): 0x%08x 0x%08x", _iValue,_iAddress); + LOG(SERIALINTERFACE, "(w32): 0x%08x 0x%08x", _iValue,_iAddress); // SIBuffer if ((_iAddress >= 0xCC006480 && _iAddress < 0xCC006500) || @@ -546,7 +546,7 @@ void RunSIBuffer() int numOutput = #endif g_Channel[g_ComCSR.CHANNEL].m_pDevice->RunBuffer(g_SIBuffer, inLength); - LOG(SERIALINTERFACE + 200, "RunSIBuffer (intLen: %i outLen: %i) (processed: %i)", inLength, outLength, numOutput); + LOG(SERIALINTERFACE, "RunSIBuffer (intLen: %i outLen: %i) (processed: %i)", inLength, outLength, numOutput); // Transfer completed GenerateSIInterrupt(INT_TCINT); diff --git a/Source/Core/Core/Src/HW/VideoInterface.cpp b/Source/Core/Core/Src/HW/VideoInterface.cpp index 792dcf4b16..b7423aeccf 100644 --- a/Source/Core/Core/Src/HW/VideoInterface.cpp +++ b/Source/Core/Core/Src/HW/VideoInterface.cpp @@ -204,7 +204,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) return; case VI_CONTROL_REGISTER: - LOG(VIDEOINTERFACE + 300, "VideoInterface(r16): VI_CONTROL_REGISTER 0x%08x", m_VIDisplayControlRegister.Hex); + LOG(VIDEOINTERFACE, "VideoInterface(r16): VI_CONTROL_REGISTER 0x%08x", m_VIDisplayControlRegister.Hex); _uReturnValue = m_VIDisplayControlRegister.Hex; return; @@ -271,7 +271,7 @@ void Read16(u16& _uReturnValue, const u32 _iAddress) void Write16(const u16 _iValue, const u32 _iAddress) { - LOG(VIDEOINTERFACE + 300, "(w16): 0x%04x, 0x%08x",_iValue,_iAddress); + LOG(VIDEOINTERFACE, "(w16): 0x%04x, 0x%08x",_iValue,_iAddress); //Somewhere it sets screen width.. we need to communicate this to the gfx plugin... diff --git a/Source/Core/Core/Src/HW/WII_IOB.cpp b/Source/Core/Core/Src/HW/WII_IOB.cpp index b80fd3c3e8..0c96cf69e4 100644 --- a/Source/Core/Core/Src/HW/WII_IOB.cpp +++ b/Source/Core/Core/Src/HW/WII_IOB.cpp @@ -38,17 +38,17 @@ void HWCALL Read32(u32& _rReturnValue, const u32 _Address) { case 0xc0: // __VISendI2CData _rReturnValue = 0; - LOG(WII_IOB + 200, "IOP: Read32 from 0xc0 = 0x%08x (__VISendI2CData)", _rReturnValue); + LOG(WII_IOB, "IOP: Read32 from 0xc0 = 0x%08x (__VISendI2CData)", _rReturnValue); break; case 0xc4: // __VISendI2CData _rReturnValue = 0; - LOG(WII_IOB + 200, "IOP: Read32 from 0xc4 = 0x%08x (__VISendI2CData)", _rReturnValue); + LOG(WII_IOB, "IOP: Read32 from 0xc4 = 0x%08x (__VISendI2CData)", _rReturnValue); break; case 0xc8: // __VISendI2CData _rReturnValue = 0; - LOG(WII_IOB + 200, "IOP: Read32 from 0xc8 = 0x%08x (__VISendI2CData)", _rReturnValue); + LOG(WII_IOB, "IOP: Read32 from 0xc8 = 0x%08x (__VISendI2CData)", _rReturnValue); break; case 0x180: // __AIClockInit @@ -92,15 +92,15 @@ void HWCALL Write32(const u32 _Value, const u32 _Address) switch(_Address & 0xFFFF) { case 0xc0: // __VISendI2CData - LOG(WII_IOB + 200, "IOP: Write32 to 0xc0 = 0x%08x (__VISendI2CData)", _Value); + LOG(WII_IOB, "IOP: Write32 to 0xc0 = 0x%08x (__VISendI2CData)", _Value); break; case 0xc4: // __VISendI2CData - LOG(WII_IOB + 200, "IOP: Write32 to 0xc4 = 0x%08x (__VISendI2CData)", _Value); + LOG(WII_IOB, "IOP: Write32 to 0xc4 = 0x%08x (__VISendI2CData)", _Value); break; case 0xc8: // __VISendI2CData - LOG(WII_IOB + 200, "IOP: Write32 to 0xc8 = 0x%08x (__VISendI2CData)", _Value); + LOG(WII_IOB, "IOP: Write32 to 0xc8 = 0x%08x (__VISendI2CData)", _Value); break; case 0x180: // __AIClockInit diff --git a/Source/Core/Core/Src/HW/WII_IPC.cpp b/Source/Core/Core/Src/HW/WII_IPC.cpp index bd87c4afc1..8e942b6907 100644 --- a/Source/Core/Core/Src/HW/WII_IPC.cpp +++ b/Source/Core/Core/Src/HW/WII_IPC.cpp @@ -129,7 +129,7 @@ void HWCALL Read32(u32& _rReturnValue, const u32 _Address) _rReturnValue = g_IPC_Control.Hex; - LOG(WII_IPC + 200, "IOP: Read32 from IPC_CONTROL_REGISTER(0x04) = 0x%08x", _rReturnValue); + LOG(WII_IPC, "IOP: Read32 from IPC_CONTROL_REGISTER(0x04) = 0x%08x", _rReturnValue); // CCPU::Break(); // if ((REASON_REG & 0x14) == 0x14) CALL IPCReplayHanlder @@ -139,7 +139,7 @@ void HWCALL Read32(u32& _rReturnValue, const u32 _Address) case IPC_REPLY_REGISTER: // looks a little bit like a callback function _rReturnValue = g_Reply; - LOG(WII_IPC + 200, "IOP: Write32 to IPC_REPLAY_REGISTER(0x08) = 0x%08x ", _rReturnValue); + LOG(WII_IPC, "IOP: Write32 to IPC_REPLAY_REGISTER(0x08) = 0x%08x ", _rReturnValue); break; case IPC_SENSOR_BAR_POWER_REGISTER: @@ -160,13 +160,13 @@ void HWCALL Write32(const u32 _Value, const u32 _Address) case IPC_COMMAND_REGISTER: // __ios_Ipc2 ... a value from __responses is loaded { g_Address = _Value; - LOG(WII_IPC + 100, "IOP: Write32 to IPC_ADDRESS_REGISTER(0x00) = 0x%08x", g_Address); + LOG(WII_IPC, "IOP: Write32 to IPC_ADDRESS_REGISTER(0x00) = 0x%08x", g_Address); } break; case IPC_CONTROL_REGISTER: { - LOG(WII_IPC + 100, "IOP: Write32 to IPC_CONTROL_REGISTER(0x04) = 0x%08x (old: 0x%08x)", _Value, g_IPC_Control.Hex); + LOG(WII_IPC, "IOP: Write32 to IPC_CONTROL_REGISTER(0x04) = 0x%08x (old: 0x%08x)", _Value, g_IPC_Control.Hex); UIPC_Control TempControl(_Value); _dbg_assert_msg_(WII_IPC, TempControl.pad == 0, "IOP: Write to UIPC_Control.pad", _Address); @@ -192,7 +192,7 @@ void HWCALL Write32(const u32 _Value, const u32 _Address) UIPC_Status NewStatus(_Value); if (NewStatus.INTERRUPT) g_IPC_Status.INTERRUPT = 0; // clear interrupt - LOG(WII_IPC + 100, "IOP: Write32 to IPC_STATUS_REGISTER(0x30) = 0x%08x", _Value); + LOG(WII_IPC, "IOP: Write32 to IPC_STATUS_REGISTER(0x30) = 0x%08x", _Value); } break; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index bd6ef5fa3e..5ffc54a858 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -355,7 +355,7 @@ void Update() // check if we have to execute an acknowledged command if (!m_ReplyQueue.empty()) { - LOG(WII_IPC_HLE + 100, "-- Generate Reply %s (0x%08x)", m_ReplyQueue.front().second.c_str(), m_ReplyQueue.front().first); + LOG(WII_IPC_HLE, "-- Generate Reply %s (0x%08x)", m_ReplyQueue.front().second.c_str(), m_ReplyQueue.front().first); WII_IPCInterface::GenerateReply(m_ReplyQueue.front().first); m_ReplyQueue.pop(); return; @@ -368,7 +368,7 @@ void Update() u32 _Address = m_Ack.front(); m_Ack.pop(); ExecuteCommand(_Address); - LOG(WII_IPC_HLE + 100, "-- Generate Ack (0x%08x)", _Address); + LOG(WII_IPC_HLE, "-- Generate Ack (0x%08x)", _Address); WII_IPCInterface::GenerateAck(_Address); } } diff --git a/Source/Core/Core/Src/LogManager.cpp b/Source/Core/Core/Src/LogManager.cpp index 0fd149f542..0e06e0c376 100644 --- a/Source/Core/Core/Src/LogManager.cpp +++ b/Source/Core/Core/Src/LogManager.cpp @@ -16,20 +16,18 @@ // http://code.google.com/p/dolphin-emu/ #include -#include // for the timestamps #include "Common.h" #include "StringUtil.h" #include "LogManager.h" #include "PowerPC/PowerPC.h" -#include "PowerPC/SymbolDB.h" // for g_symbolDB #include "Debugger/Debugger_SymbolMap.h" -LogManager::SMessage (*LogManager::m_Messages)[MAX_MESSAGES]; -int LogManager::m_nextMessages[LogManager::VERBOSITY_LEVELS + 1]; +LogManager::SMessage *LogManager::m_Messages; +int LogManager::m_nextMessages = 0; -CDebugger_Log* LogManager::m_Log[LogTypes::NUMBER_OF_LOGS + (LogManager::VERBOSITY_LEVELS * 100)]; +CDebugger_Log* LogManager::m_Log[LogTypes::NUMBER_OF_LOGS]; int LogManager::m_activeLog = LogTypes::MASTER_LOG; bool LogManager::m_bDirty = true; bool LogManager::m_bInitialized = false; @@ -37,6 +35,9 @@ bool LogManager::m_bInitialized = false; void __Log(int log, const char *format, ...) { + if (!LogManager::IsLogEnabled((LogTypes::LOG_TYPE)log)) + return; + char* temp = (char*)alloca(strlen(format)+512); va_list args; va_start(args, format); @@ -45,16 +46,15 @@ void __Log(int log, const char *format, ...) LogManager::Log((LogTypes::LOG_TYPE)log, temp); } -CDebugger_Log::CDebugger_Log(const char* _szShortName, const char* _szName, int a) : - m_bLogToFile(true), // write to file or not - m_bShowInLog(false), - m_bEnable(false), +CDebugger_Log::CDebugger_Log(const char* _szShortName, const char* _szName) : + m_bLogToFile(true), + m_bShowInLog(true), + m_bEnable(true), m_pFile(NULL) { strcpy((char*)m_szName, _szName); - strcpy((char*)m_szShortName_, _szShortName); - sprintf((char*)m_szShortName, "%s%i", _szShortName, a); - sprintf((char*)m_szFilename, "Logs/%s%i.txt", _szName, a); + strcpy((char*)m_szShortName, _szShortName); + sprintf((char*)m_szFilename, "Logs/%s.txt", _szName); unlink(m_szFilename); } @@ -68,10 +68,6 @@ CDebugger_Log::~CDebugger_Log(void) } } -// we may need to declare these -CDebugger_LogSettings::CDebugger_LogSettings() {} -CDebugger_LogSettings::~CDebugger_LogSettings(void) {} - void CDebugger_Log::Init() { m_pFile = fopen(m_szFilename, "wtb"); @@ -89,49 +85,40 @@ void CDebugger_Log::Shutdown() void LogManager::Init() { - m_Messages = new SMessage[LogManager::VERBOSITY_LEVELS + 1][MAX_MESSAGES]; + m_Messages = new SMessage[MAX_MESSAGES]; m_bDirty = true; // create Logs - for(int i = 0; i <= LogManager::VERBOSITY_LEVELS; i++) - { - m_Log[LogTypes::MASTER_LOG + i*100] = new CDebugger_Log("*", "Master Log", i); - m_Log[LogTypes::BOOT + i*100] = new CDebugger_Log("BOOT", "Boot", i); - m_Log[LogTypes::PIXELENGINE + i*100] = new CDebugger_Log("PE", "PixelEngine", i); - m_Log[LogTypes::COMMANDPROCESSOR + i*100] = new CDebugger_Log("CP", "CommandProc", i); - m_Log[LogTypes::VIDEOINTERFACE + i*100] = new CDebugger_Log("VI", "VideoInt", i); - m_Log[LogTypes::SERIALINTERFACE + i*100] = new CDebugger_Log("SI", "SerialInt", i); - m_Log[LogTypes::PERIPHERALINTERFACE + i*100]= new CDebugger_Log("PI", "PeripheralInt", i); - m_Log[LogTypes::MEMMAP + i*100] = new CDebugger_Log("MI", "MI & memmap", i); - m_Log[LogTypes::STREAMINGINTERFACE + i*100] = new CDebugger_Log("Stream", "StreamingInt", i); - m_Log[LogTypes::DSPINTERFACE + i*100] = new CDebugger_Log("DSP", "DSPInterface", i); - m_Log[LogTypes::DVDINTERFACE + i*100] = new CDebugger_Log("DVD", "DVDInterface", i); - m_Log[LogTypes::GPFIFO + i*100] = new CDebugger_Log("GP", "GPFifo", i); - m_Log[LogTypes::EXPANSIONINTERFACE + i*100] = new CDebugger_Log("EXI", "ExpansionInt", i); - m_Log[LogTypes::AUDIO_INTERFACE + i*100] = new CDebugger_Log("AI", "AudioInt", i); - m_Log[LogTypes::GEKKO + i*100] = new CDebugger_Log("GEKKO", "IBM CPU", i); - m_Log[LogTypes::HLE + i*100] = new CDebugger_Log("HLE", "HLE", i); - m_Log[LogTypes::DSPHLE + i*100] = new CDebugger_Log("DSPHLE", "DSP HLE", i); - m_Log[LogTypes::VIDEO + i*100] = new CDebugger_Log("Video", "Video Plugin", i); - m_Log[LogTypes::AUDIO + i*100] = new CDebugger_Log("Audio", "Audio Plugin", i); - m_Log[LogTypes::DYNA_REC + i*100] = new CDebugger_Log("DYNA", "Dynamic Recompiler", i); - m_Log[LogTypes::CONSOLE + i*100] = new CDebugger_Log("CONSOLE", "Dolphin Console", i); - m_Log[LogTypes::OSREPORT + i*100] = new CDebugger_Log("OSREPORT", "OSReport", i); - m_Log[LogTypes::WII_IOB + i*100] = new CDebugger_Log("WII_IOB", "WII IO Bridge", i); - m_Log[LogTypes::WII_IPC + i*100] = new CDebugger_Log("WII_IPC", "WII IPC", i); - m_Log[LogTypes::WII_IPC_HLE + i*100] = new CDebugger_Log("WII_IPC_HLE", "WII IPC HLE", i); - m_Log[LogTypes::WIIMOTE + i*100] = new CDebugger_Log("WIIMOTE", "WIIMOTE", i); + m_Log[LogTypes::MASTER_LOG] = new CDebugger_Log("*", "Master Log"); + m_Log[LogTypes::BOOT] = new CDebugger_Log("BOOT", "Boot"); + m_Log[LogTypes::PIXELENGINE] = new CDebugger_Log("PE", "PixelEngine"); + m_Log[LogTypes::COMMANDPROCESSOR] = new CDebugger_Log("CP", "CommandProc"); + m_Log[LogTypes::VIDEOINTERFACE] = new CDebugger_Log("VI", "VideoInt"); + m_Log[LogTypes::SERIALINTERFACE] = new CDebugger_Log("SI", "SerialInt"); + m_Log[LogTypes::PERIPHERALINTERFACE]= new CDebugger_Log("PI", "PeripheralInt"); + m_Log[LogTypes::MEMMAP] = new CDebugger_Log("MI", "MI & memmap"); + m_Log[LogTypes::STREAMINGINTERFACE] = new CDebugger_Log("Stream", "StreamingInt"); + m_Log[LogTypes::DSPINTERFACE] = new CDebugger_Log("DSP", "DSPInterface"); + m_Log[LogTypes::DVDINTERFACE] = new CDebugger_Log("DVD", "DVDInterface"); + m_Log[LogTypes::GPFIFO] = new CDebugger_Log("GP", "GPFifo"); + m_Log[LogTypes::EXPANSIONINTERFACE] = new CDebugger_Log("EXI", "ExpansionInt."); + m_Log[LogTypes::AUDIO_INTERFACE] = new CDebugger_Log("AI", "AudioInt."); + m_Log[LogTypes::GEKKO] = new CDebugger_Log("GEKKO", "IBM CPU"); + m_Log[LogTypes::HLE] = new CDebugger_Log("HLE", "HLE"); + m_Log[LogTypes::DSPHLE] = new CDebugger_Log("DSPHLE", "DSP HLE"); + m_Log[LogTypes::VIDEO] = new CDebugger_Log("Video", "Video Plugin"); + m_Log[LogTypes::AUDIO] = new CDebugger_Log("Audio", "Audio Plugin"); + m_Log[LogTypes::DYNA_REC] = new CDebugger_Log("DYNA", "Dynamic Recompiler"); + m_Log[LogTypes::CONSOLE] = new CDebugger_Log("CONSOLE", "Dolphin Console"); + m_Log[LogTypes::OSREPORT] = new CDebugger_Log("OSREPORT", "OSReport"); + m_Log[LogTypes::WII_IOB] = new CDebugger_Log("WII_IOB", "WII IO Bridge"); + m_Log[LogTypes::WII_IPC] = new CDebugger_Log("WII_IPC", "WII IPC"); + m_Log[LogTypes::WII_IPC_HLE] = new CDebugger_Log("WII_IPC_HLE", "WII IPC HLE"); + m_Log[LogTypes::WIIMOTE] = new CDebugger_Log("WIIMOTE", "WIIMOTE"); - m_nextMessages[i] = 0; // initiate to zero - } - - // create the files for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) { - for (int j = 0; j <= LogManager::VERBOSITY_LEVELS; j++) - { - m_Log[j*100 + i]->Init(); - } + m_Log[i]->Init(); } m_bInitialized = true; } @@ -139,21 +126,15 @@ void LogManager::Init() void LogManager::Clear() { - for (int v = 0; v <= LogManager::VERBOSITY_LEVELS; v++) + for (int i = 0;i < MAX_MESSAGES;i++) { - for (int i = 0; i < MAX_MESSAGES; i++) - { - strcpy(m_Messages[v][i].m_szMessage,""); - m_Messages[v][i].m_dwMsgLen = 0; - m_Messages[v][i].m_bInUse = false; - } - m_nextMessages[v] = 0; + strcpy(m_Messages[i].m_szMessage,""); + m_Messages[i].m_dwMsgLen = 0; + m_Messages[i].m_bInUse = false; } + m_nextMessages = 0; } -// __________________________________________________________________________________________________ -// Shutdown -// void LogManager::Shutdown() { m_bInitialized = false; @@ -172,117 +153,68 @@ void LogManager::Shutdown() delete [] m_Messages; } +bool LogManager::IsLogEnabled(LogTypes::LOG_TYPE _type) +{ + if (_type >= LogTypes::NUMBER_OF_LOGS) + { + PanicAlert("Try to access unknown log (%i)", _type); + return false; + } + + if (m_Log[_type] == NULL || !m_Log[_type]->m_bEnable) + return false; + + return true; +} -// ========================================================================================== -// The function that finally writes the log. -// --------------- -u32 lastPC; -std::string lastSymbol; void LogManager::Log(LogTypes::LOG_TYPE _type, const char *_fmt, ...) { - if (m_LogSettings == NULL) + if (m_Log[_type] == NULL || !m_Log[_type]->m_bEnable) return; - // declarations - int v; // verbosity level - int type; // the log type, CONSOLE etc. - char cvv[20]; - std::string svv; - - // get the current verbosity level and type - sprintf(cvv, "%03i", (int)_type); - svv = cvv; - v = atoi(svv.substr(0, 1).c_str()); - type = atoi(svv.substr(1, 2).c_str()); - - // security checks - if (m_Log[_type] == NULL || !m_Log[_type]->m_bEnable || PC == 0 - || _type > (LogTypes::NUMBER_OF_LOGS + LogManager::VERBOSITY_LEVELS * 100) - || _type < 0) - return; - - // prepare message char Msg[512]; va_list ap; va_start(ap, _fmt); vsprintf(Msg, _fmt, ap); va_end(ap); + + SMessage& Message = m_Messages[m_nextMessages]; static u32 count = 0; - wxDateTime datetime = wxDateTime::UNow(); // get timestamp char* Msg2 = (char*)alloca(strlen(_fmt)+512); - // Here's the old symbol request - //Debugger::FindSymbol(PC); - // const Debugger::Symbol& symbol = Debugger::GetSymbol(Index); - //symbol.GetName().c_str(), - - // Warning: Getting the function name this often is very demanding on the CPU. - // I have limited it to the two lowest verbosity levels because of that. I've also - // added a simple caching function so that we don't search again if we get the same - // question again. - std::string symbol; - - if ((v == 0 || v == 1) && lastPC != PC && LogManager::m_LogSettings->bResolve) - { - symbol = g_symbolDB.GetDescription(PC); - lastSymbol = symbol; - lastPC = PC; - } - else if(lastPC == PC && LogManager::m_LogSettings->bResolve) - { - symbol = lastSymbol; + int Index = 0; //Debugger::FindSymbol(PC); + const char *eol = "\n"; + if (Index > 0) + { + // const Debugger::Symbol& symbol = Debugger::GetSymbol(Index); + sprintf(Msg2, "%i: %x %s (%s, %08x ) : %s%s", + ++count, + PowerPC::ppcState.DebugCount, + m_Log[_type]->m_szShortName, + "", //symbol.GetName().c_str(), + PC, + Msg, eol); } else { - symbol = "---"; + sprintf(Msg2, "%i: %x %s ( %08x ) : %s%s", ++count, PowerPC::ppcState.DebugCount, m_Log[_type]->m_szShortName, PC, Msg, eol); } - int Index = 1; - const char *eol = "\n"; - if (Index > 0) - { - sprintf(Msg2, "%i %02i:%02i:%03i: %x %s (%s, %08x) : %s%s", - ++count, - datetime.GetMinute(), datetime.GetSecond(), datetime.GetMillisecond(), - PowerPC::ppcState.DebugCount, - m_Log[_type]->m_szShortName_, // (CONSOLE etc) - symbol.c_str(), PC, // current PC location (name, address) - Msg, eol); - } + Message.Set(_type, Msg2); - // ========================================================================================== - // Level 0 verbosity logs will be written to all verbosity levels. Given that logging is enabled - // for that level. Level 1 verbosity will only be written to level 1, 2, 3 and so on. - // --------------- - int id; - for (int i = LogManager::VERBOSITY_LEVELS; i >= v ; i--) - { - // prepare the right id - id = i*100 + type; + if (m_Log[_type]->m_pFile && m_Log[_type]->m_bLogToFile) + fprintf(m_Log[_type]->m_pFile, "%s", Msg2); + if (m_Log[LogTypes::MASTER_LOG] && m_Log[LogTypes::MASTER_LOG]->m_pFile && m_Log[_type]->m_bShowInLog) + fprintf(m_Log[LogTypes::MASTER_LOG]->m_pFile, "%s", Msg2); - // write to memory - m_Messages[i][m_nextMessages[i]].Set((LogTypes::LOG_TYPE)id, Msg2); + printf("%s", Msg2); - // ---------------------------------------------------------------------------------------- - // write to file - // --------------- - if (m_Log[id]->m_pFile && m_Log[id]->m_bLogToFile) - fprintf(m_Log[id]->m_pFile, "%s", Msg2); - if (m_Log[i*100 + LogTypes::MASTER_LOG] && m_Log[i*100 + LogTypes::MASTER_LOG]->m_pFile - && LogManager::m_LogSettings->bWriteMaster) - fprintf(m_Log[i*100 + LogTypes::MASTER_LOG]->m_pFile, "%s", Msg2); - - printf("%s", Msg2); // write to console screen - - // this limits the memory space used for the memory logs to MAX_MESSAGES rows - m_nextMessages[i]++; - if (m_nextMessages[i] >= MAX_MESSAGES) - m_nextMessages[i] = 0; - // --------------- - } - m_bDirty = true; // tell LogWindow that the log has been updated + m_nextMessages++; + if (m_nextMessages >= MAX_MESSAGES) + m_nextMessages = 0; + m_bDirty = true; } bool IsLoggingActivated() diff --git a/Source/Core/Core/Src/LogManager.h b/Source/Core/Core/Src/LogManager.h index 1fbe2bdc57..9d117dfeab 100644 --- a/Source/Core/Core/Src/LogManager.h +++ b/Source/Core/Core/Src/LogManager.h @@ -30,7 +30,6 @@ struct CDebugger_Log { char m_szName[128]; char m_szShortName[32]; - char m_szShortName_[32]; // save the unadjusted originals here char m_szFilename[256]; bool m_bLogToFile; bool m_bShowInLog; @@ -41,26 +40,12 @@ struct CDebugger_Log void Shutdown(); // constructor - CDebugger_Log(const char* _szShortName, const char* _szName, int a); + CDebugger_Log(const char* _szShortName, const char* _szName); // destructor ~CDebugger_Log(); }; -// make a variable that can be accessed from both LogManager.cpp and LogWindow.cpp -struct CDebugger_LogSettings -{ - int m_iVerbosity; // verbosity level 0 - 2 - bool bResolve; - bool bWriteMaster; - - // constructor - CDebugger_LogSettings(); - - // destructor - ~CDebugger_LogSettings(); -}; - class LogManager { #define MAX_MESSAGES 8000 // the old value was to large @@ -95,30 +80,26 @@ public: m_szMessage[m_dwMsgLen] = 0; m_type = _type; - m_bInUse = true; // turn on this message line + m_bInUse = true; } // static void Log(LogTypes::LOG_TYPE _type, const char *_fmt, ...); }; private: - enum LOG_SETTINGS - { - VERBOSITY_LEVELS = 3 - }; - friend class CDebugger_LogWindow; friend class CLogWindow; - static SMessage (*m_Messages)[MAX_MESSAGES]; - static int m_nextMessages[VERBOSITY_LEVELS + 1]; + static SMessage *m_Messages; + static int m_nextMessages; static int m_activeLog; static bool m_bDirty; static bool m_bInitialized; - static CDebugger_LogSettings* m_LogSettings; - static CDebugger_Log* m_Log[LogTypes::NUMBER_OF_LOGS + (VERBOSITY_LEVELS * 100)]; // make 326 of them + static CDebugger_Log* m_Log[LogTypes::NUMBER_OF_LOGS]; public: static void Init(); static void Clear(void); static void Shutdown(); + + static bool IsLogEnabled(LogTypes::LOG_TYPE _type); static void Log(LogTypes::LOG_TYPE _type, const char *_fmt, ...); }; diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index 2a94d3a427..6619cb3cd0 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -55,8 +55,8 @@ namespace Jit64 void lbzx(UGeckoInstruction inst) { #ifdef JIT_OFF_OPTIONS - if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) - {Default(inst); return;} // turn off from debugger + //if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) + // {Default(inst); return;} // turn off from debugger #endif INSTRUCTION_START; @@ -80,8 +80,8 @@ namespace Jit64 void lXz(UGeckoInstruction inst) { #ifdef JIT_OFF_OPTIONS - if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) - {Default(inst); return;} // turn off from debugger + //if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) + // {Default(inst); return;} // turn off from debugger #endif INSTRUCTION_START; @@ -167,8 +167,8 @@ namespace Jit64 void lha(UGeckoInstruction inst) { #ifdef JIT_OFF_OPTIONS - if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) - {Default(inst); return;} // turn off from debugger + //if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) + // {Default(inst); return;} // turn off from debugger #endif INSTRUCTION_START; @@ -191,8 +191,8 @@ namespace Jit64 void dcbz(UGeckoInstruction inst) { #ifdef JIT_OFF_OPTIONS - if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) - {Default(inst); return;} // turn off from debugger + //if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) + // {Default(inst); return;} // turn off from debugger #endif INSTRUCTION_START; @@ -214,8 +214,8 @@ namespace Jit64 void stX(UGeckoInstruction inst) { #ifdef JIT_OFF_OPTIONS - if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) - {Default(inst); return;} // turn off from debugger + //if(Core::g_CoreStartupParameter.bJITOff || Core::g_CoreStartupParameter.bJITLoadStoreOff) + // {Default(inst); return;} // turn off from debugger #endif INSTRUCTION_START; diff --git a/Source/Core/Core/Src/PowerPC/PowerPC.cpp b/Source/Core/Core/Src/PowerPC/PowerPC.cpp index 6bbffcfb22..62a7eae02b 100644 --- a/Source/Core/Core/Src/PowerPC/PowerPC.cpp +++ b/Source/Core/Core/Src/PowerPC/PowerPC.cpp @@ -201,7 +201,7 @@ void CheckExceptions() SRR1 = MSR & 0x0780FF77; NPC = 0x80000800; - LOG(GEKKO + 100, "EXCEPTION_FPU_UNAVAILABLE"); + LOG(GEKKO, "EXCEPTION_FPU_UNAVAILABLE"); ppcState.Exceptions &= ~EXCEPTION_FPU_UNAVAILABLE; SRR1 |= 0x02; //recoverable } @@ -211,7 +211,7 @@ void CheckExceptions() SRR1 = MSR & 0x0780FF77; NPC = 0x80000C00; - LOG(GEKKO + 100, "EXCEPTION_SYSCALL (PC=%08x)",PC); + LOG(GEKKO, "EXCEPTION_SYSCALL (PC=%08x)",PC); ppcState.Exceptions &= ~EXCEPTION_SYSCALL; SRR1 |= 0x02; //recoverable } @@ -221,7 +221,7 @@ void CheckExceptions() SRR1 = MSR & 0x0780FF77; NPC = 0x80000300; - LOG(GEKKO + 100, "EXCEPTION_DSI"); + LOG(GEKKO, "EXCEPTION_DSI"); ppcState.Exceptions &= ~EXCEPTION_DSI; //SRR1 |= 0x02; //make recoverable ? } @@ -259,7 +259,7 @@ void CheckExceptions() NPC = 0x80000500; SRR1 = (MSR & 0x0780FF77); - LOG(GEKKO + 100, "EXCEPTION_EXTERNAL_INT"); + LOG(GEKKO, "EXCEPTION_EXTERNAL_INT"); SRR1 |= 0x02; //set it to recoverable _dbg_assert_msg_(GEKKO, (SRR1 & 0x02) != 0, "GEKKO", "EXTERNAL_INT unrecoverable???"); // unrecoverable exception !?! @@ -272,7 +272,7 @@ void CheckExceptions() ppcState.Exceptions &= ~EXCEPTION_DECREMENTER; - LOG(GEKKO + 100, "EXCEPTION_DECREMENTER"); + LOG(GEKKO, "EXCEPTION_DECREMENTER"); SRR1 |= 0x02; //make recoverable } else diff --git a/Source/Core/Core/Src/PowerPC/SignatureDB.cpp b/Source/Core/Core/Src/PowerPC/SignatureDB.cpp index 31d2323fd5..5c955f8632 100644 --- a/Source/Core/Core/Src/PowerPC/SignatureDB.cpp +++ b/Source/Core/Core/Src/PowerPC/SignatureDB.cpp @@ -123,7 +123,7 @@ void SignatureDB::Apply(SymbolDB *symbol_db) if (iter->second.size == (unsigned int)function->size) { function->name = iter->second.name; - LOG(HLE + 100, "Found %s at %08x (size: %08x)!", iter->second.name.c_str(), function->address, function->size); + LOG(HLE, "Found %s at %08x (size: %08x)!", iter->second.name.c_str(), function->address, function->size); } else { diff --git a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp index 7b9271ebef..64f12ba3f6 100644 --- a/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp +++ b/Source/Core/DebuggerWX/Src/BreakpointWindow.cpp @@ -299,7 +299,7 @@ CBreakPointWindow::OnAddMemoryCheckMany(wxCommandEvent& event) bool doCommon = false; // ------------------------------------------------------------------------------------------ - // Decide if we have a range or just one address, and if we should break or not + // Decide if we have a range or just one address // -------------- if ( pieces.size() == 1 @@ -311,7 +311,6 @@ CBreakPointWindow::OnAddMemoryCheckMany(wxCommandEvent& event) MemCheck.StartAddress = sAddress; MemCheck.EndAddress = sAddress; doCommon = true; - MemCheck.Break = false; } else if( pieces.size() == 2 @@ -323,19 +322,6 @@ CBreakPointWindow::OnAddMemoryCheckMany(wxCommandEvent& event) MemCheck.StartAddress = sAddress; MemCheck.EndAddress = eAddress; doCommon = true; - MemCheck.Break = false; - } - else if( - pieces.size() == 3 - && AsciiToHex(pieces[0].c_str(), sAddress) && AsciiToHex(pieces[1].c_str(), eAddress) - && pieces[0].size() == 8 && pieces[1].size() == 8 && pieces[2].size() == 1 - ) - { - // address range - MemCheck.StartAddress = sAddress; - MemCheck.EndAddress = eAddress; - doCommon = true; - MemCheck.Break = true; } if(doCommon) @@ -344,7 +330,7 @@ CBreakPointWindow::OnAddMemoryCheckMany(wxCommandEvent& event) MemCheck.OnRead = true; MemCheck.OnWrite = true; MemCheck.Log = true; - //MemCheck.Break = false; // this is also what sets Active "on" in the breakpoint window + MemCheck.Break = false; // this is also what sets Active "on" in the breakpoint window // so don't think it's off because we are only writing this to the log CBreakPoints::AddMemoryCheck(MemCheck); } diff --git a/Source/Core/DebuggerWX/Src/Debugger.h b/Source/Core/DebuggerWX/Src/Debugger.h index dcc71e40af..62b10b3556 100644 --- a/Source/Core/DebuggerWX/Src/Debugger.h +++ b/Source/Core/DebuggerWX/Src/Debugger.h @@ -24,9 +24,7 @@ enum IDM_UPDATELOG, IDM_CLEARLOG, IDM_LOGCHECKS, - IDM_OPTIONS, IDM_ENABLEALL, - IDM_RADIO0, IDM_SUBMITCMD = 300, }; diff --git a/Source/Core/DebuggerWX/Src/LogWindow.cpp b/Source/Core/DebuggerWX/Src/LogWindow.cpp index 9812c21240..7e23dbf19b 100644 --- a/Source/Core/DebuggerWX/Src/LogWindow.cpp +++ b/Source/Core/DebuggerWX/Src/LogWindow.cpp @@ -23,22 +23,16 @@ #include #include -#include "Core.h" // for Core::GetState() #include "LogWindow.h" #include "Console.h" #include "IniFile.h" -// declare this now to be able to use it in Load() -CDebugger_LogSettings* LogManager::m_LogSettings; - BEGIN_EVENT_TABLE(CLogWindow, wxDialog) EVT_BUTTON(IDM_SUBMITCMD, CLogWindow::OnSubmit) EVT_BUTTON(IDM_UPDATELOG, CLogWindow::OnUpdateLog) EVT_BUTTON(IDM_CLEARLOG, CLogWindow::OnClear) EVT_BUTTON(IDM_ENABLEALL, CLogWindow::OnEnableAll) - EVT_CHECKLISTBOX(IDM_OPTIONS, CLogWindow::OnOptionsCheck) EVT_CHECKLISTBOX(IDM_LOGCHECKS, CLogWindow::OnLogCheck) - EVT_RADIOBOX(IDM_RADIO0, CLogWindow::OnRadioChange) END_EVENT_TABLE() @@ -46,53 +40,19 @@ CLogWindow::CLogWindow(wxWindow* parent) : wxDialog(parent, wxID_ANY, _T("Log/Console"), wxPoint(100, 700), wxSize(800, 270), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { - wxBoxSizer* sizerTop = new wxBoxSizer(wxHORIZONTAL), // buttons - * sizerUber = new wxBoxSizer(wxHORIZONTAL), // whole plane - * sizerBig = new wxBoxSizer(wxVERTICAL), // RIGHT sizer - * sizerBottom = new wxBoxSizer(wxHORIZONTAL), // submit row - * sizerLeft = new wxBoxSizer(wxVERTICAL); // LEFT sizer + wxBoxSizer* sizerTop = new wxBoxSizer(wxHORIZONTAL), + * sizerUber = new wxBoxSizer(wxHORIZONTAL), + * sizerBig = new wxBoxSizer(wxVERTICAL), + * sizerBottom = new wxBoxSizer(wxHORIZONTAL); - // left checkboxes and radio boxes ----------------------------------- - int m_radioBoxNChoices[1]; - wxString m_radioBoxChoices0[] = { wxT("0"), wxT("1"), wxT("2"), wxT("3") }; - m_radioBoxNChoices[0] = sizeof( m_radioBoxChoices0 ) / sizeof( wxString ); - m_RadioBox[0] = new wxRadioBox( this, IDM_RADIO0, wxT("Verbosity"), - wxDefaultPosition, wxDefaultSize, m_radioBoxNChoices[0], m_radioBoxChoices0, 1, wxRA_SPECIFY_ROWS); - - wxStaticBoxSizer * m_optionsSizer = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Settings")); - m_options = new wxCheckListBox(this, IDM_OPTIONS, wxDefaultPosition, wxDefaultSize, - 0, NULL, wxNO_BORDER); - m_options->Append(wxT("Resolve symbols")); - m_options->Append(wxT("Write master")); - m_optionsSizer->Add(m_options, 0, 0, 0); - - // I could not find any transparency setting and it would not automatically space correctly - m_options->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - m_options->SetMinSize(wxSize(m_options->GetSize().GetWidth() - 40, - m_options->GetCount() * 15)); - #ifdef _WIN32 - for (int i = 0; i < m_options->GetCount(); ++i) - m_options->GetItem(i)->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - #endif - - m_checks = new wxCheckListBox(this, IDM_LOGCHECKS, wxDefaultPosition, wxSize(120, 280)); - - // finally add it to the sizer - sizerLeft->Add(m_RadioBox[0], 0, wxGROW); - sizerLeft->Add(m_optionsSizer, 0, wxGROW); - sizerLeft->Add(m_checks, 1, wxGROW); - - - // right windows ----------------------------------------------------- - m_log = new wxTextCtrl(this, IDM_LOG, _T(""), wxDefaultPosition, wxSize(600, 120), - wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP); + m_log = new wxTextCtrl(this, IDM_LOG, _T(""), wxDefaultPosition, wxSize(600, 120), wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP); m_cmdline = new wxTextCtrl(this, wxID_ANY, _T(""), wxDefaultPosition); wxButton* btn = new wxButton(this, IDM_SUBMITCMD, _T("Submit")); sizerTop->Add(new wxButton(this, IDM_UPDATELOG, _T("Update"))); sizerTop->Add(new wxButton(this, IDM_CLEARLOG, _T("Clear"))); sizerTop->Add(new wxButton(this, IDM_ENABLEALL, _T("Enable all"))); - + m_checks = new wxCheckListBox(this, IDM_LOGCHECKS, wxDefaultPosition, wxSize(120, 280)); sizerBottom->Add(m_cmdline, 8, wxGROW | wxRIGHT, 5); sizerBottom->Add(btn, 1, wxGROW, 0); @@ -100,15 +60,12 @@ CLogWindow::CLogWindow(wxWindow* parent) sizerBig->Add(m_log, 1, wxGROW | wxSHRINK); sizerBig->Add(sizerBottom, 0, wxGROW); - sizerUber->Add(sizerLeft, 0, wxGROW); + sizerUber->Add(m_checks, 0, wxGROW); sizerUber->Add(sizerBig, 1, wxGROW); SetSizer(sizerUber); SetAffirmativeId(IDM_SUBMITCMD); - // declare this now to be able to use it in Load() - LogManager::m_LogSettings = new CDebugger_LogSettings; - //sizerTop->SetSizeHints(this); //sizerTop->Fit(this); UpdateChecks(); @@ -134,18 +91,6 @@ void CLogWindow::Load(IniFile& _IniFile) _IniFile.Get("LogWindow", "w", &w, GetSize().GetWidth()); _IniFile.Get("LogWindow", "h", &h, GetSize().GetHeight()); SetSize(x, y, w, h); - - // load verbosity setting - int v; - _IniFile.Get("LogWindow", "Verbosity", &v, m_RadioBox[0]->GetSelection()); - m_RadioBox[0]->SetSelection(v); - LogManager::m_LogSettings->m_iVerbosity = v; - - // load options - _IniFile.Get("LogWindow", "ResolveSymbols", &LogManager::m_LogSettings->bResolve, false); - _IniFile.Get("LogWindow", "WriteMaster", &LogManager::m_LogSettings->bWriteMaster, false); - m_options->Check(0, LogManager::m_LogSettings->bResolve); - m_options->Check(1, LogManager::m_LogSettings->bWriteMaster); } void CLogWindow::OnSubmit(wxCommandEvent& event) @@ -158,41 +103,56 @@ void CLogWindow::OnSubmit(wxCommandEvent& event) void CLogWindow::OnClear(wxCommandEvent& event) { - if (Core::GetState() != Core::CORE_UNINITIALIZED) // avoid crash - { - LogManager::Clear(); - LOG(MASTER_LOG, "(log cleared)."); - NotifyUpdate(); - } + LogManager::Clear(); + LOG(MASTER_LOG, "(log cleared)."); + NotifyUpdate(); } - -// ---------------------------------------------------------------------------------------- -// Enable or disable all boxes for the current verbosity level and save the changes. -// ------------- void CLogWindow::OnEnableAll(wxCommandEvent& event) { if (!LogManager::m_Log[0]) return; static bool enable = true; - int v = LogManager::m_LogSettings->m_iVerbosity; IniFile ini; - ini.Load("Debugger.ini"); + ini.Load("Dolphin.ini"); for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) { m_checks->Check(i, enable); - LogManager::m_Log[i + v*100]->m_bEnable = enable; - LogManager::m_Log[i + v*100]->m_bShowInLog = enable; - ini.Set("LogManager", LogManager::m_Log[i + v*100]->m_szShortName, enable); + LogManager::m_Log[i]->m_bEnable = enable; + LogManager::m_Log[i]->m_bShowInLog = enable; + ini.Set("LogManager", LogManager::m_Log[i]->m_szShortName, enable); } - ini.Save("Debugger.ini"); + ini.Save("Dolphin.ini"); enable = !enable; } -// ---------------------------------------------------------------------------------------- -// Append checkboxes and update checked groups. -// ------------- +void CLogWindow::OnLogCheck(wxCommandEvent& event) +{ + if (!LogManager::m_bInitialized) + { + return; + } + + IniFile ini; + ini.Load("Dolphin.ini"); + + for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) + { + bool Enabled = m_checks->IsChecked(i); + LogManager::m_Log[i]->m_bEnable = Enabled; + LogManager::m_Log[i]->m_bShowInLog = Enabled; + + ini.Set("LogManager", LogManager::m_Log[i]->m_szShortName, Enabled); + } + + ini.Save("Dolphin.ini"); + + m_bCheckDirty = true; + UpdateLog(); +} + + void CLogWindow::UpdateChecks() { if (!LogManager::m_bInitialized) @@ -200,11 +160,9 @@ void CLogWindow::UpdateChecks() return; } - // This is only run once to append checkboxes to the wxCheckListBox. if (m_checks->GetCount() == 0) { - // [F|RES] hide the window while we fill it... wxwidgets gets trouble if you don't do it - // (at least the win version) + // [F|RES] hide the window while we fill it... wxwidgets gets trouble if you don't do it (at least the win version) m_checks->Show(false); for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) @@ -215,114 +173,28 @@ void CLogWindow::UpdateChecks() m_checks->Show(true); } - // ---------------------------------------------------------------------------------------- - // Load the correct values and enable/disable the right groups - // ------------- - int v = LogManager::m_LogSettings->m_iVerbosity; IniFile ini; - ini.Load("Debugger.ini"); + ini.Load("Dolphin.ini"); for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) { - for (int j = 0; j <= LogManager::VERBOSITY_LEVELS; j++) - { - bool Enabled = false; - ini.Get("LogManager", LogManager::m_Log[i + j*100]->m_szShortName, &Enabled, false); - LogManager::m_Log[i + j*100]->m_bEnable = Enabled; - LogManager::m_Log[i + j*100]->m_bShowInLog = Enabled; - if(j == v) m_checks->Check(i, Enabled); - } + bool Enabled = false; + ini.Get("LogManager", LogManager::m_Log[i]->m_szShortName, &Enabled, false); + + m_checks->Check(i, Enabled); + + LogManager::m_Log[i]->m_bEnable = Enabled; + LogManager::m_Log[i]->m_bShowInLog = Enabled; } m_bCheckDirty = true; -} - - -// ---------------------------------------------------------------------------------------- -// When an option is changed -// --------------- -void CLogWindow::OnOptionsCheck(wxCommandEvent& event) -{ - IniFile ini; - ini.Load("Debugger.ini"); - LogManager::m_LogSettings->bResolve = m_options->IsChecked(0); - LogManager::m_LogSettings->bWriteMaster = m_options->IsChecked(1); - ini.Set("LogWindow", "ResolveSymbols", m_options->IsChecked(0)); - ini.Set("LogWindow", "WriteMaster", m_options->IsChecked(1)); - ini.Save("Debugger.ini"); - if (Core::GetState() != Core::CORE_UNINITIALIZED) UpdateLog(); -} - - -// ---------------------------------------------------------------------------------------- -// When a checkbox is changed -// --------------- -void CLogWindow::OnLogCheck(wxCommandEvent& event) -{ - if (!LogManager::m_bInitialized) - { - return; - } - - IniFile ini; - ini.Load("Debugger.ini"); - int v = LogManager::m_LogSettings->m_iVerbosity; - - for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) - { - // update groups to enabled or disabled - bool Enabled = m_checks->IsChecked(i); - LogManager::m_Log[i + 100*v]->m_bEnable = Enabled; - LogManager::m_Log[i + 100*v]->m_bShowInLog = Enabled; - - ini.Set("LogManager", LogManager::m_Log[i + 100*v]->m_szShortName, Enabled); - } - - ini.Save("Debugger.ini"); - - m_bCheckDirty = true; - if (Core::GetState() != Core::CORE_UNINITIALIZED) UpdateLog(); -} - - -// ---------------------------------------------------------------------------------------- -// When the verbosity level is changed -// ------------- -void CLogWindow::OnRadioChange(wxCommandEvent& event) -{ - // get selection - int v = m_RadioBox[0]->GetSelection(); - - // save it - LogManager::m_LogSettings->m_iVerbosity = v; - IniFile ini; - ini.Load("Debugger.ini"); - ini.Set("LogWindow", "Verbosity", v); - ini.Save("Debugger.ini"); - - // This check is because we allow this to be changed before a game has been loaded so - // that the boxes do not exist yet - if (Core::GetState() != Core::CORE_UNINITIALIZED) - { - for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) - { - // update groups to enabled or disabled - bool Enabled; - ini.Get("LogManager", LogManager::m_Log[i + 100*v]->m_szShortName, &Enabled, false); - LogManager::m_Log[i + 100*v]->m_bEnable = Enabled; - LogManager::m_Log[i + 100*v]->m_bShowInLog = Enabled; - m_checks->Check(i, Enabled); - } - - m_bCheckDirty = true; - UpdateLog(); - } + UpdateLog(); } void CLogWindow::OnUpdateLog(wxCommandEvent& event) { - if (Core::GetState() != Core::CORE_UNINITIALIZED) UpdateLog(); + NotifyUpdate(); } @@ -336,40 +208,32 @@ void CLogWindow::NotifyUpdate() void CLogWindow::UpdateLog() { static int last = -1; - int v = LogManager::m_LogSettings->m_iVerbosity; - int i = LogManager::m_nextMessages[v]; + int i = LogManager::m_nextMessages; - // check if the the log has been updated (ie if it's dirty) if ((last == i) && !m_bCheckDirty) { return; } + m_bCheckDirty = false; last = i; - - // ---------------------------------------------------------------------------------------- - // Prepare a selection of the memory log to show to screen - // --------------- + //bash together a log buffer really fast (no slow strcpy here, just memcpys) int count = 0; char* p = m_logBuffer; - // go through all rows while (count < MAX_MESSAGES) { count++; - const LogManager::SMessage& message = LogManager::m_Messages[v][i]; + const LogManager::SMessage& message = LogManager::m_Messages[i]; - if (message.m_bInUse) // check if the line has a value + if (message.m_bInUse) { int len = message.m_dwMsgLen; - // this is what we use, I'm not sure why we have this option if (LogManager::m_activeLog == LogTypes::MASTER_LOG) { - // only show checkboxed logs if (LogManager::m_Log[message.m_type]->m_bShowInLog) { - // memcpy is faster than strcpy memcpy(p, message.m_szMessage, len); p += len; } @@ -391,12 +255,10 @@ void CLogWindow::UpdateLog() i = 0; } } - // --------------- *p = 0; //end the string m_log->SetValue(wxString::FromAscii(m_logBuffer)); m_log->SetInsertionPoint(p - m_logBuffer - 1); - m_log->ShowPosition( m_log->GetLastPosition()); // show last line } diff --git a/Source/Core/DebuggerWX/Src/LogWindow.h b/Source/Core/DebuggerWX/Src/LogWindow.h index cd1ead4719..9e43624365 100644 --- a/Source/Core/DebuggerWX/Src/LogWindow.h +++ b/Source/Core/DebuggerWX/Src/LogWindow.h @@ -39,16 +39,12 @@ class CLogWindow char m_logBuffer[LogBufferSize]; wxTextCtrl* m_log, * m_cmdline; wxCheckListBox* m_checks; - wxCheckListBox* m_options; - wxRadioBox *m_RadioBox[1]; // radio boxes bool m_bCheckDirty; DECLARE_EVENT_TABLE() void OnSubmit(wxCommandEvent& event); void OnUpdateLog(wxCommandEvent& event); - void OnOptionsCheck(wxCommandEvent& event); void OnLogCheck(wxCommandEvent& event); - void OnRadioChange(wxCommandEvent& event); // verbosity buttons void OnClear(wxCommandEvent& event); void OnEnableAll(wxCommandEvent& event); diff --git a/Source/Dolphin.sln b/Source/Dolphin.sln index d1bddba3f2..612d104b53 100644 --- a/Source/Dolphin.sln +++ b/Source/Dolphin.sln @@ -2,8 +2,6 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Core", "Core\Core\Core.vcproj", "{F0B874CB-4476-4199-9315-8343D05AE684}" ProjectSection(ProjectDependencies) = postProject - {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} = {48AD7E0A-25B1-4974-A1E3-03F8C438D34F} - {0318BA30-EF48-441A-9E10-DC85EFAE39F0} = {0318BA30-EF48-441A-9E10-DC85EFAE39F0} {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} = {29C2ABC1-ADA5-42CD-A5FC-96022D52A510} {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} = {C573CAF7-EE6A-458E-8049-16C0BF34C2E9} {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} = {B7F1A9FB-BEA8-416E-9460-AE35A6A5165C} diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp index 29257677e1..bfefd908b6 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.cpp @@ -39,19 +39,21 @@ extern bool gOnlyLooping; // ======================================================================================= // Declare events BEGIN_EVENT_TABLE(CDebugger,wxDialog) - EVT_CLOSE(CDebugger::OnClose) // on close event - - EVT_BUTTON(ID_UPD,CDebugger::OnUpdate) // buttons - - EVT_CHECKBOX(IDC_CHECK0,CDebugger::SaveFile) // options + EVT_CLOSE(CDebugger::OnClose) + EVT_BUTTON(ID_UPD,CDebugger::OnUpdate) + EVT_CHECKBOX(IDC_CHECK0,CDebugger::SaveFile) EVT_CHECKBOX(IDC_CHECK2,CDebugger::ShowHideConsole) - EVT_CHECKBOX(IDC_CHECK3,CDebugger::OnlyLooping) - EVT_RADIOBOX(IDC_RADIO1,CDebugger::ChangeFrequency) // update frequency + EVT_CHECKBOX(IDC_CHECK3,CDebugger::SSBM) + EVT_CHECKBOX(IDC_CHECK4,CDebugger::SSBMremedy1) + EVT_CHECKBOX(IDC_CHECK5,CDebugger::SSBMremedy2) + EVT_CHECKBOX(IDC_CHECK8,CDebugger::Sequenced) + EVT_CHECKBOX(IDC_CHECK9,CDebugger::Volume) + EVT_CHECKBOX(IDC_CHECK6,CDebugger::Reset) + EVT_CHECKBOX(IDC_CHECK7,CDebugger::OnlyLooping) - EVT_RADIOBOX(IDC_RADIO2,CDebugger::ChangePreset) // presets - - EVT_CHECKLISTBOX(IDC_CHECKLIST1, CDebugger::OnSettingsCheck) // settings + EVT_RADIOBOX(IDC_RADIO1,CDebugger::ChangeFrequency) + EVT_RADIOBOX(IDC_RADIO2,CDebugger::ChangePreset) END_EVENT_TABLE() // ======================================================================================= @@ -138,17 +140,19 @@ SetTitle(wxT("Sound Debugging")); wxStaticBoxSizer* sLeft; // checkboxes and labels ----------------------------------------------------- - wxStaticBoxSizer * m_checkSizer = new wxStaticBoxSizer (wxVERTICAL, this, wxT("Options")); + m_Label[0] = new wxStaticBox(this, IDG_LABEL1, wxT("Options"), + wxDefaultPosition, wxDefaultSize, 0); + wxStaticBoxSizer * m_checkSizer = new wxStaticBoxSizer (m_Label[0], wxVERTICAL); // checkboxes - m_Check[0] = new wxCheckBox(this, IDC_CHECK1, wxT("Save to file"), + m_Check[0] = new wxCheckBox(this, IDC_CHECK0, wxT("Save to file"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - m_Check[1] = new wxCheckBox(this, IDC_CHECK2, wxT("Show updated"), + m_Check[1] = new wxCheckBox(this, IDC_CHECK1, wxT("Show updated"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_Check[1]->Enable(false); - m_Check[7] = new wxCheckBox(this, IDC_CHECK3, wxT("Only looping"), + m_Check[7] = new wxCheckBox(this, IDC_CHECK7, wxT("Only looping"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); - m_Check[2] = new wxCheckBox(this, IDC_CHECK4, wxT("Show console"), + m_Check[2] = new wxCheckBox(this, IDC_CHECK2, wxT("Show console"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); m_checkSizer->Add(m_Check[0], 0, 0, 5); @@ -158,35 +162,39 @@ SetTitle(wxT("Sound Debugging")); // ------------------------ // settings checkboxes ----------------------------------------------------- - wxStaticBoxSizer * m_checkSizer2 = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Settings")); - m_settings = new wxCheckListBox(this, IDC_CHECKLIST1, wxDefaultPosition, wxDefaultSize, - 0, NULL, wxNO_BORDER); - - m_settings->Append(wxT("SSBM fix")); - m_settings->Append(wxT("SSBM remedy 1")); - m_settings->Append(wxT("SSBM remedy 2")); - m_settings->Append(wxT("Sequenced")); - m_settings->Append(wxT("Volume delta")); - m_settings->Append(wxT("Reset all")); - - m_settings->Check(0, gSSBM); - m_settings->Check(1, gSSBMremedy1); - m_settings->Check(2, gSSBMremedy2); - m_settings->Check(3, gSequenced); - m_settings->Check(4, gVolume); - m_settings->Check(5, gReset); + m_Label[1] = new wxStaticBox(this, IDG_LABEL2, wxT("Settings"), + wxDefaultPosition, wxDefaultSize, 0); + wxStaticBoxSizer * m_checkSizer2 = new wxStaticBoxSizer (m_Label[1], wxVERTICAL); - // because the wxCheckListBox is a little underdeveloped we have to help it with this - // to bad there's no windows xp styles for the checkboxes - m_settings->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - m_settings->SetMinSize(wxSize(m_settings->GetSize().GetWidth() - 40, - m_settings->GetCount() * 15)); - for (int i = 0; i < m_settings->GetCount(); ++i) - m_settings->GetItem(i)->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - - m_checkSizer2->Add(m_settings, 0, 0, 0); + // checkboxes + m_Check[3] = new wxCheckBox(this, IDC_CHECK3, wxT("SSBM fix"), + wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[3]->SetValue(gSSBM); + m_Check[4] = new wxCheckBox(this, IDC_CHECK4, wxT("SSBM remedy 1"), + wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[4]->SetValue(gSSBMremedy1); + m_Check[5] = new wxCheckBox(this, IDC_CHECK5, wxT("SSBM remedy 2"), + wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[5]->SetValue(gSSBMremedy2); + m_Check[8] = new wxCheckBox(this, IDC_CHECK8, wxT("Sequenced"), + wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[8]->SetValue(gSequenced); + m_Check[9] = new wxCheckBox(this, IDC_CHECK9, wxT("Volume delta"), + wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[9]->SetValue(gVolume); + m_Check[6] = new wxCheckBox(this, IDC_CHECK6, wxT("Reset all"), + wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator); + m_Check[6]->SetValue(gReset); + + m_checkSizer2->Add(m_Check[3], 0, 0, 5); + m_checkSizer2->Add(m_Check[4], 0, 0, 5); + m_checkSizer2->Add(m_Check[5], 0, 0, 5); + m_checkSizer2->Add(m_Check[8], 0, 0, 5); + m_checkSizer2->Add(m_Check[9], 0, 0, 5); + m_checkSizer2->Add(m_Check[6], 0, 0, 5); // ------------------------ + // radio boxes ----------------------------------------------------- int m_radioBoxNChoices[2]; @@ -224,27 +232,32 @@ SetTitle(wxT("Sound Debugging")); sButtons2->AddStretchSpacer(1); sButtons2->Add(m_RadioBox[2], 0, 0, 5); sButtons2->AddStretchSpacer(1); - sButtons2->Add(m_checkSizer2, 0, 0, 5); + sButtons2->Add(m_checkSizer2, 0, 2, 5); sButtons2->AddStretchSpacer(1); // left buttons wxBoxSizer* sButtons; sButtons = new wxBoxSizer(wxVERTICAL); - sButtons->AddSpacer(5); // to set a minimum margin + sButtons->AddStretchSpacer(1); sButtons->Add(m_Upd, 0, 0, 5); sButtons->Add(m_SelC, 0, 0, 5); sButtons->Add(m_Presets, 0, 0, 5); sButtons->AddStretchSpacer(1); - sButtons->Add(m_checkSizer, 0, 0, 5); + + sButtons->Add(m_checkSizer, 0, 2, 5); + sButtons->AddStretchSpacer(1); + sButtons->Add(m_RadioBox[0], 0, 0, 5); + sButtons->AddStretchSpacer(1); + sButtons->Add(m_RadioBox[1], 0, 0, 5); - sButtons->AddSpacer(5); + sButtons->AddStretchSpacer(1); // blocks view sLeft = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Current Status")); @@ -253,9 +266,9 @@ SetTitle(wxT("Sound Debugging")); // add all stuff to the main container sMain = new wxBoxSizer(wxHORIZONTAL); - sMain->Add(sLeft, 1, wxEXPAND | wxALL, 5); // margin = 5 - sMain->Add(sButtons, 0, wxALL, 0); - sMain->Add(sButtons2, 0, wxALL, 5); // margin = 5 + sMain->Add(sLeft, 1, wxEXPAND|wxALL, 5); + sMain->Add(sButtons, 0, wxEXPAND, 0); + sMain->Add(sButtons2, 0, wxEXPAND, 0); this->SetSizer(sMain); sMain->SetSizeHints(this); @@ -287,14 +300,48 @@ void CDebugger::OnUpdate(wxCommandEvent& /*event*/) // ======================================================================================= // Settings // -------------- -void CDebugger::OnSettingsCheck(wxCommandEvent& event) +void CDebugger::SSBM(wxCommandEvent& event) { - gSSBM = m_settings->IsChecked(0); - gSSBMremedy1 = m_settings->IsChecked(1); - gSSBMremedy2 = m_settings->IsChecked(2); - gSequenced = m_settings->IsChecked(3); - gVolume = m_settings->IsChecked(4); - gReset = m_settings->IsChecked(5); + if(m_Check[3]->IsChecked() == 1) + {gSSBM = true;} + else + {gSSBM = false;} +} + +void CDebugger::SSBMremedy1(wxCommandEvent& event) +{ + if(m_Check[4]->IsChecked() == 1) + {gSSBMremedy1 = true;} + else + {gSSBMremedy1 = false;} +} +void CDebugger::SSBMremedy2(wxCommandEvent& event) +{ + if(m_Check[5]->IsChecked() == 1) + {gSSBMremedy2 = true;} + else + {gSSBMremedy2 = false;} +} +void CDebugger::Sequenced(wxCommandEvent& event) +{ + if(m_Check[8]->IsChecked() == 1) + {gSequenced = true;} + else + {gSequenced = false;} +} +void CDebugger::Volume(wxCommandEvent& event) +{ + if(m_Check[9]->IsChecked() == 1) + {gVolume = true;} + else + {gVolume = false;} +} +void CDebugger::Reset(wxCommandEvent& event) +{ + if(m_Check[6]->IsChecked() == 1) + {gReset = true;} + else + {gReset = false;} } // ======================================================================================= diff --git a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h index 27aab897b4..0d99a9a91e 100644 --- a/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h +++ b/Source/Plugins/Plugin_DSP_HLE/Src/Debugger/Debugger.h @@ -69,20 +69,25 @@ class CDebugger : public wxDialog void NotifyUpdate(); void OnUpdate(wxCommandEvent& event); - void SaveFile(wxCommandEvent& event); // options + void SaveFile(wxCommandEvent& event); void ShowHideConsole(wxCommandEvent& event); void DoShowHideConsole(); - void OnlyLooping(wxCommandEvent& event); - - - void ChangeFrequency(wxCommandEvent& event); // update frequency + void ChangeFrequency(wxCommandEvent& event); void DoChangeFrequency(); void ChangePreset(wxCommandEvent& event); void DoChangePreset(); - void OnSettingsCheck(wxCommandEvent& event); // settings + void SSBM(wxCommandEvent& event); + void SSBMremedy1(wxCommandEvent& event); + void SSBMremedy2(wxCommandEvent& event); + void BSDON(wxCommandEvent& event); + void Sequenced(wxCommandEvent& event); + void Volume(wxCommandEvent& event); + void Reset(wxCommandEvent& event); + void OnlyLooping(wxCommandEvent& event); - CPBView* m_GPRListView; + CPBView* m_GPRListView; + private: @@ -90,7 +95,7 @@ class CDebugger : public wxDialog wxCheckBox *m_Check[9]; wxRadioButton *m_Radio[5]; wxRadioBox *m_RadioBox[3]; - wxCheckListBox * m_settings; + wxStaticBox *m_Label[1]; wxPanel *m_Controller; // WARNING: Make sure these are not also elsewhere, for example in resource.h. @@ -101,7 +106,11 @@ class CDebugger : public wxDialog IDC_CHECK2, IDC_CHECK3, IDC_CHECK4, - IDC_CHECKLIST1, + IDC_CHECK5, + IDC_CHECK6, + IDC_CHECK7, + IDC_CHECK8, + IDC_CHECK9, IDC_RADIO0, IDC_RADIO1, IDC_RADIO2,