From aa7fe1edee2511f7a28c30b3b0084c8d9cca035c Mon Sep 17 00:00:00 2001 From: hrydgard Date: Fri, 20 Mar 2009 20:52:37 +0000 Subject: [PATCH] Fix DEBUG logging (didn't work!). Shuffle around the log levels to make more sense (now NOTICE is the top one and always on), the rest is ERROR, WARNING, INFO, DEBUG. Fix the log levels of a lot of stuff. Use macros instead of numbers for various log level checks. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2700 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Common/Src/ConsoleListener.cpp | 4 +-- Source/Core/Common/Src/Log.h | 30 +++++++++---------- Source/Core/Common/Src/LogManager.cpp | 7 +++++ Source/Core/Common/Src/LogManager.h | 11 ++----- Source/Core/Core/Src/Console.cpp | 4 +-- .../Core/Src/Debugger/Debugger_SymbolMap.cpp | 10 +++---- .../Core/Src/Debugger/Debugger_SymbolMap.h | 2 +- Source/Core/Core/Src/HLE/HLE_OS.cpp | 8 ++--- Source/Core/Core/Src/HW/CommandProcessor.cpp | 9 ++++-- Source/Core/Core/Src/HW/DVDInterface.cpp | 8 ++--- Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp | 2 +- .../Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp | 12 ++++++-- Source/Core/Core/Src/HW/Memmap.cpp | 2 +- Source/Core/Core/Src/HW/MemmapFunctions.cpp | 6 ++-- Source/Core/Core/Src/HW/SI.cpp | 4 +-- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 8 +++-- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device.h | 6 ++-- .../Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp | 2 +- .../Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 22 +++++++------- Source/Core/DolphinWX/Src/LogWindow.cpp | 20 ++++++------- .../Plugin_VideoOGL/Src/TextureMngr.cpp | 1 + .../Plugin_Wiimote/Plugin_Wiimote.vcproj | 4 +-- .../Plugin_nJoy_SDL/Plugin_nJoy_SDL.vcproj | 4 +-- 23 files changed, 100 insertions(+), 86 deletions(-) diff --git a/Source/Core/Common/Src/ConsoleListener.cpp b/Source/Core/Common/Src/ConsoleListener.cpp index 1e87cb7711..da2bee8c15 100644 --- a/Source/Core/Common/Src/ConsoleListener.cpp +++ b/Source/Core/Common/Src/ConsoleListener.cpp @@ -48,7 +48,7 @@ void ConsoleListener::Open(int width, int height, char *title) SetConsoleTitle(title); // Set the total letter space - COORD co = {width, height}; + COORD co = {width, 3000}; // Big scrollback. SetConsoleScreenBufferSize(m_hStdOut, co); /* Set the window size in number of letters. The height is hard coded here @@ -102,7 +102,7 @@ void ConsoleListener::Log(LogTypes::LOG_LEVELS level, const char *text) break; case INFO_LEVEL: // cyan - color = FOREGROUND_GREEN | FOREGROUND_BLUE; + color = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break; case DEBUG_LEVEL: // light gray diff --git a/Source/Core/Common/Src/Log.h b/Source/Core/Common/Src/Log.h index ed7fa540df..94d03a4361 100644 --- a/Source/Core/Common/Src/Log.h +++ b/Source/Core/Common/Src/Log.h @@ -18,9 +18,9 @@ #ifndef _LOG_H #define _LOG_H -#define ERROR_LEVEL 1 // Critical errors -#define WARNING_LEVEL 2 // Something is suspicious. -#define NOTICE_LEVEL 3 // Important information +#define NOTICE_LEVEL 1 // VERY important information that is NOT errors. Like startup and OSReports. +#define ERROR_LEVEL 2 // Critical errors +#define WARNING_LEVEL 3 // Something is suspicious. #define INFO_LEVEL 4 // General information. #define DEBUG_LEVEL 5 // Detailed debugging - might make things slow. @@ -70,9 +70,9 @@ enum LOG_TYPE { // FIXME: should this be removed? enum LOG_LEVELS { + LNOTICE = NOTICE_LEVEL, LERROR = ERROR_LEVEL, LWARNING = WARNING_LEVEL, - LNOTICE = NOTICE_LEVEL, LINFO = INFO_LEVEL, LDEBUG = DEBUG_LEVEL, }; @@ -85,10 +85,10 @@ enum LOG_LEVELS { - Debug_run() - run only in debug time */ #if defined LOGGING || defined _DEBUG || defined DEBUGFAST -#define LOGLEVEL DEBUG_LEVEL +#define MAX_LOGLEVEL DEBUG_LEVEL #else -#ifndef LOGLEVEL -#define LOGLEVEL NOTICE_LEVEL +#ifndef MAX_LOGLEVEL +#define MAX_LOGLEVEL WARNING_LEVEL #endif // loglevel #endif // logging @@ -102,33 +102,33 @@ enum LOG_LEVELS { #include "LogManager.h" // Let the compiler optimize this out -#define GENERIC_LOG(t, v, ...) {if (v <= LOGLEVEL) LogManager::GetInstance()->Log(v, t, __VA_ARGS__);} +#define GENERIC_LOG(t, v, ...) {if (v <= MAX_LOGLEVEL) {LogManager::GetInstance()->Log(v, t, __VA_ARGS__);}} -#if LOGLEVEL >= ERROR_LEVEL +#if MAX_LOGLEVEL >= ERROR_LEVEL #undef ERROR_LOG #define ERROR_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LERROR, __VA_ARGS__)} #endif // loglevel ERROR+ -#if LOGLEVEL >= WARNING_LEVEL +#if MAX_LOGLEVEL >= WARNING_LEVEL #undef WARN_LOG #define WARN_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LWARNING, __VA_ARGS__)} #endif // loglevel WARNING+ -#if LOGLEVEL >= NOTICE_LEVEL +#if MAX_LOGLEVEL >= NOTICE_LEVEL #undef NOTICE_LOG #define NOTICE_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LNOTICE, __VA_ARGS__)} #endif // loglevel NOTICE+ -#if LOGLEVEL >= INFO_LEVEL +#if MAX_LOGLEVEL >= INFO_LEVEL #undef INFO_LOG #define INFO_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LINFO, __VA_ARGS__)} #endif // loglevel INFO+ -#if LOGLEVEL >= DEBUG_LEVEL +#if MAX_LOGLEVEL >= DEBUG_LEVEL #undef DEBUG_LOG #define DEBUG_LOG(t,...) {GENERIC_LOG(LogTypes::t, LogTypes::LDEBUG, __VA_ARGS__)} #endif // loglevel DEBUG+ -#if LOGLEVEL >= DEBUG_LEVEL +#if MAX_LOGLEVEL >= DEBUG_LEVEL #define _dbg_assert_(_t_, _a_) \ if (!(_a_)) {\ ERROR_LOG(_t_, "Error...\n\n Line: %d\n File: %s\n Time: %s\n\nIgnore and continue?", \ @@ -150,7 +150,7 @@ enum LOG_LEVELS { #define _dbg_assert_(_t_, _a_) ; #define _dbg_assert_msg_(_t_, _a_, _desc_, ...) ; #endif // dbg_assert -#endif // LOGLEVEL DEBUG +#endif // MAX_LOGLEVEL DEBUG #define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_) #ifdef _WIN32 diff --git a/Source/Core/Common/Src/LogManager.cpp b/Source/Core/Common/Src/LogManager.cpp index af102f0870..0da4e72452 100644 --- a/Source/Core/Common/Src/LogManager.cpp +++ b/Source/Core/Common/Src/LogManager.cpp @@ -97,6 +97,13 @@ void LogManager::removeListener(LogTypes::LOG_TYPE type, LogListener *listener) logMutex->Leave(); } +LogContainer::LogContainer(const char* shortName, const char* fullName, bool enable) + : m_enable(enable) { + strncpy(m_fullName, fullName, 128); + strncpy(m_shortName, shortName, 32); + m_level = LogTypes::LWARNING; +} + // LogContainer void LogContainer::addListener(LogListener *listener) { bool exists = false; diff --git a/Source/Core/Common/Src/LogManager.h b/Source/Core/Common/Src/LogManager.h index 26e8bc88ff..a66aa37957 100644 --- a/Source/Core/Common/Src/LogManager.h +++ b/Source/Core/Common/Src/LogManager.h @@ -90,12 +90,7 @@ private: class LogContainer { public: - LogContainer(const char* shortName, const char* fullName, - bool enable = false) : m_enable(enable) { - strncpy(m_fullName, fullName, 128); - strncpy(m_shortName, shortName, 32); - m_level = LogTypes::LWARNING; - } + LogContainer(const char* shortName, const char* fullName, bool enable = false); const char *getShortName() const { return m_shortName; } const char *getFullName() const { return m_fullName; } @@ -111,7 +106,7 @@ public: m_enable = enable; } - LogTypes::LOG_LEVELS getLevel() { + LogTypes::LOG_LEVELS getLevel() const { return m_level; } @@ -138,7 +133,7 @@ private: static LogManager *m_logManager; // Singleton. Ugh. public: - static u32 GetMaxLevel() { return LOGLEVEL; } + static u32 GetMaxLevel() { return MAX_LOGLEVEL; } void Log(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type, const char *fmt, ...); diff --git a/Source/Core/Core/Src/Console.cpp b/Source/Core/Core/Src/Console.cpp index 14d6a1ad3b..297b74261c 100644 --- a/Source/Core/Core/Src/Console.cpp +++ b/Source/Core/Core/Src/Console.cpp @@ -53,11 +53,11 @@ void Console_Submit(const char *cmd) if (addr) { -#if LOGLEVEL >= INFO_LEVEL +#if MAX_LOGLEVEL >= INFO_LEVEL u32 EA = -#endif Memory::CheckDTLB(addr, Memory::FLAG_NO_EXCEPTION); INFO_LOG(CONSOLE, "EA 0x%08x to 0x%08x", addr, EA); +#endif } else { diff --git a/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp b/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp index f97dfdc5d6..d98474de2f 100644 --- a/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp +++ b/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.cpp @@ -106,20 +106,20 @@ void PrintCallstack() } } -void PrintCallstack(LogTypes::LOG_TYPE type) +void PrintCallstack(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level) { u32 addr = Memory::ReadUnchecked_U32(PowerPC::ppcState.gpr[1]); // SP - GENERIC_LOG(type, LogTypes::LWARNING, "== STACK TRACE - SP = %08x ==", + GENERIC_LOG(type, level, "== STACK TRACE - SP = %08x ==", PowerPC::ppcState.gpr[1]); if (LR == 0) { - GENERIC_LOG(type, LogTypes::LWARNING, " LR = 0 - this is bad"); + GENERIC_LOG(type, level, " LR = 0 - this is bad"); } int count = 1; if (g_symbolDB.GetDescription(PowerPC::ppcState.pc) != g_symbolDB.GetDescription(LR)) { - GENERIC_LOG(type, LogTypes::LINFO, " * %s [ LR = %08x ]", + GENERIC_LOG(type, level, " * %s [ LR = %08x ]", g_symbolDB.GetDescription(LR), LR); count++; } @@ -131,7 +131,7 @@ void PrintCallstack(LogTypes::LOG_TYPE type) const char *str = g_symbolDB.GetDescription(func); if (!str || strlen(str) == 0 || !strcmp(str, "Invalid")) str = "(unknown)"; - GENERIC_LOG(type, LogTypes::LINFO, " * %s [ addr = %08x ]", str, func); + GENERIC_LOG(type, level, " * %s [ addr = %08x ]", str, func); addr = Memory::ReadUnchecked_U32(addr); } } diff --git a/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.h b/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.h index d5a8cf267d..80b8b0bed3 100644 --- a/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.h +++ b/Source/Core/Core/Src/Debugger/Debugger_SymbolMap.h @@ -34,7 +34,7 @@ struct CallstackEntry bool GetCallstack(std::vector &output); void PrintCallstack(); -void PrintCallstack(LogTypes::LOG_TYPE _Log); +void PrintCallstack(LogTypes::LOG_TYPE type, LogTypes::LOG_LEVELS level); void PrintDataBuffer(LogTypes::LOG_TYPE _Log, u8* _pData, size_t _Size, const char* _title); } // end of namespace Debugger diff --git a/Source/Core/Core/Src/HLE/HLE_OS.cpp b/Source/Core/Core/Src/HLE/HLE_OS.cpp index c1f84d261b..ed337c886a 100644 --- a/Source/Core/Core/Src/HLE/HLE_OS.cpp +++ b/Source/Core/Core/Src/HLE/HLE_OS.cpp @@ -35,7 +35,7 @@ void HLE_OSPanic() GetStringVA(Error); PanicAlert("OSPanic: %s", Error.c_str()); - ERROR_LOG(OSREPORT,"(PC=%08x), OSPanic: %s", LR, Error.c_str()); + ERROR_LOG(OSREPORT, "(PC=%08x), OSPanic: %s", LR, Error.c_str()); NPC = LR; } @@ -50,7 +50,7 @@ void HLE_OSReport() PC = LR; // PanicAlert("(PC=%08x) OSReport: %s", LR, ReportMessage.c_str()); - ERROR_LOG(OSREPORT,"(PC=%08x) OSReport: %s", LR, ReportMessage.c_str()); + NOTICE_LOG(OSREPORT, "(PC=%08x) OSReport: %s", LR, ReportMessage.c_str()); PC = hackPC; } @@ -65,7 +65,7 @@ void HLE_vprintf() PC = LR; // PanicAlert("(PC=%08x) VPrintf: %s", LR, ReportMessage.c_str()); - ERROR_LOG(OSREPORT,"(PC=%08x) VPrintf: %s", LR, ReportMessage.c_str()); + NOTICE_LOG(OSREPORT, "(PC=%08x) VPrintf: %s", LR, ReportMessage.c_str()); PC = hackPC; } @@ -80,7 +80,7 @@ void HLE_printf() PC = LR; // PanicAlert("(PC=%08x) Printf: %s ", LR, ReportMessage.c_str()); - ERROR_LOG(OSREPORT,"(PC=%08x) Printf: %s ", LR, ReportMessage.c_str()); + NOTICE_LOG(OSREPORT, "(PC=%08x) Printf: %s ", LR, ReportMessage.c_str()); PC = hackPC; } diff --git a/Source/Core/Core/Src/HW/CommandProcessor.cpp b/Source/Core/Core/Src/HW/CommandProcessor.cpp index 5ac5ad6aca..08e20293f6 100644 --- a/Source/Core/Core/Src/HW/CommandProcessor.cpp +++ b/Source/Core/Core/Src/HW/CommandProcessor.cpp @@ -589,7 +589,7 @@ void STACKALIGN GatherPipeBursted() Common::SyncInterlockedExchangeAdd((LONG*)&fifo.CPReadWriteDistance, GPFifo::GATHER_PIPE_SIZE); // High watermark overflow handling (hacked way) - u32 ct=0; + u32 ct = 0; if (fifo.CPReadWriteDistance > fifo.CPHiWatermark) { // we should raise an Ov interrupt for an accurate fifo emulation and let PPC deal with it. @@ -608,14 +608,17 @@ void STACKALIGN GatherPipeBursted() // - CPU can write to fifo // - disable Underflow interrupt - WARN_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark reached"); + INFO_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): CPHiWatermark reached"); // Wait for GPU to catch up while (!(fifo.bFF_BPEnable && fifo.bFF_Breakpoint) && fifo.CPReadWriteDistance > fifo.CPLoWatermark) { ct++; Common::SleepCurrentThread(1); } - if (ct) {WARN_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): %lu ms for nothing :[", ct);} + if (ct) { + // This is actually kind of fine. See big comment above. + DEBUG_LOG(COMMANDPROCESSOR, "(GatherPipeBursted): waited %lu ms. ", ct); + } /**/ } // check if we are in sync diff --git a/Source/Core/Core/Src/HW/DVDInterface.cpp b/Source/Core/Core/Src/HW/DVDInterface.cpp index d195e7d8a2..c303669b7a 100644 --- a/Source/Core/Core/Src/HW/DVDInterface.cpp +++ b/Source/Core/Core/Src/HW/DVDInterface.cpp @@ -447,7 +447,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg) //========================================================================================================= case 0x12: { -#if LOGLEVEL >= 3 +#if MAX_LOGLEVEL >= INFO_LEVEL u32 offset = dvdMem.Command[1]; // u32 sourcelength = dvdMem.Command[2]; #endif @@ -504,10 +504,10 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg) //========================================================================================================= case 0xAB: { -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL u32 offset = dvdMem.Command[1] << 2; #endif - DEBUG_LOG(DVDINTERFACE, "DVD: Trying to seek: offset=%08x", offset); + DEBUG_LOG(DVDINTERFACE, "DVD: Seek: offset=%08x (ignoring)", offset); } break; @@ -537,7 +537,7 @@ void ExecuteCommand(UDIDMAControlRegister& _DMAControlReg) // ugly hack to catch the disable command if (dvdMem.Command[1]!=0) { -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL u8 subCommand = (dvdMem.Command[0] & 0x00FF0000) >> 16; #endif diff --git a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp index 0995523169..55da7ca720 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceIPL.cpp @@ -184,7 +184,7 @@ void CEXIIPL::TransferByte(u8& _uByte) m_RTC[i] = pGCTime[i^3]; } -#if LOGLEVEL >= 3 +#if MAX_LOGLEVEL >= INFO_LEVEL if ((m_uAddress & 0xF0000000) == 0xb0000000) { diff --git a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp index c3f1631509..3ac9842226 100644 --- a/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp +++ b/Source/Core/Core/Src/HW/EXI_DeviceMemoryCard.cpp @@ -241,9 +241,17 @@ void CEXIMemoryCard::TransferByte(u8 &byte) { command = byte; // first byte is command byte = 0xFF; // would be tristate, but we don't care. - WARN_LOG(EXPANSIONINTERFACE, "EXI MEMCARD: command %02x", command) - if(command == cmdClearStatus) + switch (command) + { + case 0x52: + INFO_LOG(EXPANSIONINTERFACE, "EXI MEMCARD: command %02x at position 0. seems normal.", command); + break; + default: + WARN_LOG(EXPANSIONINTERFACE, "EXI MEMCARD: command %02x at position 0", command); + break; + } + if (command == cmdClearStatus) { status &= ~MC_STATUS_PROGRAMEERROR; status &= ~MC_STATUS_ERASEERROR; diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp index 6ae5f0c185..b77e21178c 100644 --- a/Source/Core/Core/Src/HW/Memmap.cpp +++ b/Source/Core/Core/Src/HW/Memmap.cpp @@ -65,7 +65,7 @@ namespace Memory // #define NOCHECK // Always disable memory checks if the Release build -#if LOGLEVEL < 4 +#if MAX_LOGLEVEL < 4 #define NOCHECK #endif diff --git a/Source/Core/Core/Src/HW/MemmapFunctions.cpp b/Source/Core/Core/Src/HW/MemmapFunctions.cpp index 1af3c55a36..16daf880bf 100644 --- a/Source/Core/Core/Src/HW/MemmapFunctions.cpp +++ b/Source/Core/Core/Src/HW/MemmapFunctions.cpp @@ -237,14 +237,12 @@ void WriteToHardware(u32 em_address, const T data, u32 effective_address, Memory // ---------------- u32 Read_Opcode(const u32 _Address) { -#if LOGLEVEL >= 4 if (_Address == 0x00000000) { // FIXME use assert? - PanicAlert("Program tried to read from [00000000]"); + PanicAlert("Program tried to read an opcode from [00000000]. It has crashed."); return 0x00000000; } -#endif u32 _var = 0; ReadFromHardware(_var, _Address, _Address, FLAG_OPCODE); @@ -283,7 +281,7 @@ u16 Read_U16(const u32 _Address) u32 Read_U32(const u32 _Address) { - /*#if LOGLEVEL >= 4 + /*#if MAX_LOGLEVEL >= 4 if (_Address == 0x00000000) { //PanicAlert("Program tried to read from [00000000]"); diff --git a/Source/Core/Core/Src/HW/SI.cpp b/Source/Core/Core/Src/HW/SI.cpp index 1cd951383f..36aca1ee49 100644 --- a/Source/Core/Core/Src/HW/SI.cpp +++ b/Source/Core/Core/Src/HW/SI.cpp @@ -593,12 +593,12 @@ void RunSIBuffer() else outLength++; -#if LOGLEVEL >= 3 +#if MAX_LOGLEVEL >= INFO_LEVEL int numOutput = #endif g_Channel[g_ComCSR.CHANNEL].m_pDevice->RunBuffer(g_SIBuffer, inLength); - INFO_LOG(SERIALINTERFACE, "RunSIBuffer (intLen: %i outLen: %i) (processed: %i)", inLength, outLength, numOutput); + INFO_LOG(SERIALINTERFACE, "RunSIBuffer (intLen: %i outLen: %i) (processed: %i)", inLength, outLength, numOutput); // Transfer completed GenerateSIInterrupt(INT_TCINT); 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 8e86dd9cb5..4e9190b522 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -236,9 +236,11 @@ IWII_IPC_HLE_Device* CreateDevice(u32 _DeviceID, const std::string& _rDeviceName 0x933e.... with the same .... as in the _CommandAddress. */ // ---------------- bool AckCommand(u32 _Address) -{ - Debugger::PrintCallstack(LogTypes::WII_IPC_HLE); - WARN_LOG(WII_IPC_HLE, "AckCommand: 0%08x (num: %i) PC=0x%08x", _Address, g_AckNumber, PC); +{ +#if MAX_LOG_LEVEL >= DEBUG_LEVEL + Debugger::PrintCallstack(LogTypes::WII_IPC_HLE, LogTypes::LDEBUG); +#endif + INFO_LOG(WII_IPC_HLE, "AckCommand: 0%08x (num: %i) PC=0x%08x", _Address, g_AckNumber, PC); std::list::iterator itr = g_Ack.begin(); while (itr != g_Ack.end()) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h index 0b9d6cc2e1..f59d3b4d64 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device.h @@ -155,7 +155,7 @@ protected: u32 BufferOffset = BufferVector; Memory::Write_U32(1, _CommandAddress + 0x4); - for (u32 i=0; i NOTICE_LEVEL + #if defined(MAX_LOGLEVEL) && MAX_LOGLEVEL >= INFO_LEVEL DumpCommands(OutBuffer, OutBufferSize, LogTypes::WII_IPC_HLE, LogTypes::LINFO); #endif } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp index 56f69bb12e..e74f7d2258 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_DI.cpp @@ -266,7 +266,7 @@ u32 CWII_IPC_HLE_Device_di::ExecuteCommand(u32 _BufferIn, u32 _BufferInSize, u32 case 0x86: { Memory::Memset(_BufferOut, 0, _BufferOutSize); - WARN_LOG(WII_IPC_DVD, "%s executes DVDLowClearCoverInterrupt (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize); + INFO_LOG(WII_IPC_DVD, "%s executes DVDLowClearCoverInterrupt (Buffer 0x%08x, 0x%x)", GetDeviceName().c_str(), _BufferOut, _BufferOutSize); } break; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index ce2b239961..ab09251f33 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -611,7 +611,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRequestConnection(CWII_IPC_HL AddEventToQueue(Event); // Log -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL static char LinkType[][128] = { { "HCI_LINK_SCO 0x00 - Voice"}, @@ -627,7 +627,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventRequestConnection(CWII_IPC_HL DEBUG_LOG(WII_IPC_WIIMOTE, " COD[0]: 0x%02x", pEventRequestConnection->uclass[0]); DEBUG_LOG(WII_IPC_WIIMOTE, " COD[1]: 0x%02x", pEventRequestConnection->uclass[1]); DEBUG_LOG(WII_IPC_WIIMOTE, " COD[2]: 0x%02x", pEventRequestConnection->uclass[2]); - DEBUG_LOG(WII_IPC_WIIMOTE, " LinkType: %s", LinkType[pEventRequestConnection->LinkType]); + // DEBUG_LOG(WII_IPC_WIIMOTE, " LinkType: %s", LinkType[pEventRequestConnection->LinkType]); return true; }; @@ -716,7 +716,7 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventConnectionComplete(bdaddr_t _ g_GlobalHandle = pConnectionComplete->Connection_Handle; -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL static char s_szLinkType[][128] = { { "HCI_LINK_SCO 0x00 - Voice"}, @@ -1410,7 +1410,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandHostBufferSize(u8* _Input) // ---------------- void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageTimeOut(u8* _Input) { -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL // command parameters hci_write_page_timeout_cp* pWritePageTimeOut = (hci_write_page_timeout_cp*)_Input; #endif @@ -1440,7 +1440,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input) hci_write_scan_enable_rp Reply; Reply.status = 0x00; -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL static char Scanning[][128] = { { "HCI_NO_SCAN_ENABLE"}, @@ -1461,7 +1461,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteScanEnable(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input) { -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= 4 // command parameters hci_write_inquiry_mode_cp* pInquiryMode = (hci_write_inquiry_mode_cp*)_Input; #endif @@ -1470,7 +1470,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input) hci_write_inquiry_mode_rp Reply; Reply.status = 0x00; -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL static char InquiryMode[][128] = { { "Standard Inquiry Result event format (default)" }, @@ -1487,7 +1487,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryMode(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageScanType(u8* _Input) { -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL // command parameters hci_write_page_scan_type_cp* pWritePageScanType = (hci_write_page_scan_type_cp*)_Input; #endif @@ -1496,7 +1496,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWritePageScanType(u8* _Input) hci_write_page_scan_type_rp Reply; Reply.status = 0x00; -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL static char PageScanType[][128] = { { "Mandatory: Standard Scan (default)" }, @@ -1553,7 +1553,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandInquiry(u8* _Input) void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteInquiryScanType(u8* _Input) { -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL // command parameters hci_write_inquiry_scan_type_cp* pSetEventFilter = (hci_write_inquiry_scan_type_cp*)_Input; #endif @@ -1657,7 +1657,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandAcceptCon(u8* _Input) // command parameters hci_accept_con_cp* pAcceptCon = (hci_accept_con_cp*)_Input; -#if LOGLEVEL >= 4 +#if MAX_LOGLEVEL >= DEBUG_LEVEL static char s_szRole[][128] = { { "Master (0x00)"}, diff --git a/Source/Core/DolphinWX/Src/LogWindow.cpp b/Source/Core/DolphinWX/Src/LogWindow.cpp index c6e007f5a5..b20405acd4 100644 --- a/Source/Core/DolphinWX/Src/LogWindow.cpp +++ b/Source/Core/DolphinWX/Src/LogWindow.cpp @@ -68,7 +68,7 @@ void CLogWindow::CreateGUIControls() wxStaticBoxSizer* sbLeftOptions = new wxStaticBoxSizer(wxVERTICAL, this, wxT("Options")); wxArrayString wxLevels; - for (int i = 0; i < LOGLEVEL; ++i) + for (int i = 1; i <= MAX_LOGLEVEL; ++i) wxLevels.Add(wxString::Format(wxT("%i"), i)); m_verbosity = new wxRadioBox(this, IDM_VERBOSITY, wxT("Verbosity"), wxDefaultPosition, wxDefaultSize, wxLevels, 0, wxRA_SPECIFY_COLS, wxDefaultValidator); sbLeftOptions->Add(m_verbosity); @@ -142,7 +142,7 @@ void CLogWindow::SaveSettings() ini.Set("LogWindow", "y", GetPosition().y); ini.Set("LogWindow", "w", GetSize().GetWidth()); ini.Set("LogWindow", "h", GetSize().GetHeight()); - ini.Set("Options", "Verbosity", m_verbosity->GetSelection()); + ini.Set("Options", "Verbosity", m_verbosity->GetSelection() + 1); ini.Set("Options", "WriteToFile", m_writeFile); ini.Set("Options", "WriteToConsole", m_writeConsole); for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i) @@ -161,7 +161,7 @@ void CLogWindow::LoadSettings() ini.Get("LogWindow", "h", &h, GetSize().GetHeight()); SetSize(x, y, w, h); ini.Get("Options", "Verbosity", &verbosity, 0); - m_verbosity->SetSelection(verbosity); + m_verbosity->SetSelection(verbosity - 1); ini.Get("Options", "WriteToFile", &m_writeFile, true); m_writeFileCB->SetValue(m_writeFile); ini.Get("Options", "WriteToConsole", &m_writeConsole, true); @@ -185,6 +185,7 @@ void CLogWindow::LoadSettings() m_logManager->addListener((LogTypes::LOG_TYPE)i, m_console); else m_logManager->removeListener((LogTypes::LOG_TYPE)i, m_console); + m_logManager->setLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)(verbosity)); } UpdateChecks(); } @@ -270,13 +271,12 @@ void CLogWindow::OnOptionsCheck(wxCommandEvent& event) { case IDM_VERBOSITY: { - // get selection - int v = m_verbosity->GetSelection(); - - for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) - { - m_logManager->setLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)v); - } + // get selection + int v = m_verbosity->GetSelection() + 1; + for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++) + { + m_logManager->setLogLevel((LogTypes::LOG_TYPE)i, (LogTypes::LOG_LEVELS)v); + } } break; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index f0cb5c9a12..c172cada94 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -480,6 +480,7 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool { glBindTexture(GL_TEXTURE_RECTANGLE_ARB, entry.texture); // for some reason mario sunshine errors here... + // Beyond Good and Evil does too, occasionally. GLenum err = GL_NO_ERROR; GL_REPORT_ERROR(); if (err == GL_NO_ERROR) diff --git a/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj b/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj index 88959ec492..4097da2809 100644 --- a/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj +++ b/Source/Plugins/Plugin_Wiimote/Plugin_Wiimote.vcproj @@ -377,7 +377,7 @@