Added extension option to Wiimote settings. It doesn't work currently. Renamed a file. Added log manager option to only show logs unique to that verbosity level.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1197 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2008-11-17 19:38:50 +00:00
parent d463c3b6f4
commit 816b979128
16 changed files with 123 additions and 59 deletions

View File

@ -815,8 +815,8 @@ bool CWII_IPC_HLE_Device_usb_oh1_57e_305::SendEventAuthenticationCompleted(u16 _
AddEventToQueue(Event);
// Log
LOG(WII_IPC_WIIMOTE, "Event: SendEventAuthenticationCompleted");
LOG(WII_IPC_WIIMOTE, " Connection_Handle: 0x%04x", pEventAuthenticationCompleted->Connection_Handle);
LOGV(WII_IPC_WIIMOTE, 1, "Event: SendEventAuthenticationCompleted");
LOGV(WII_IPC_WIIMOTE, 1, " Connection_Handle: 0x%04x", pEventAuthenticationCompleted->Connection_Handle);
return true;
}

View File

@ -459,6 +459,7 @@ void CWII_IPC_HLE_WiiMote::CommandConnectionReq(u8 _Ident, u8* _pData, u32 _Size
void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Size)
{
LOGV(WII_IPC_WIIMOTE, 1, "=======================================================");
u32 Offset = 0;
SL2CAP_CommandConfigurationReq* pCommandConfigReq = (SL2CAP_CommandConfigurationReq*)_pData;
@ -467,10 +468,10 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
_dbg_assert_(WII_IPC_WIIMOTE, DoesChannelExist(pCommandConfigReq->dcid));
SChannel& rChannel = m_Channel[pCommandConfigReq->dcid];
LOG(WII_IPC_WIIMOTE, " CommandCofigurationReq");
LOG(WII_IPC_WIIMOTE, " Ident: 0x%02x", _Ident);
LOG(WII_IPC_WIIMOTE, " DCID: 0x%04x", pCommandConfigReq->dcid);
LOG(WII_IPC_WIIMOTE, " Flags: 0x%04x", pCommandConfigReq->flags);
LOGV(WII_IPC_WIIMOTE, 1, " CommandCofigurationReq");
LOGV(WII_IPC_WIIMOTE, 1, " Ident: 0x%02x", _Ident);
LOGV(WII_IPC_WIIMOTE, 1, " DCID: 0x%04x", pCommandConfigReq->dcid);
LOGV(WII_IPC_WIIMOTE, 1, " Flags: 0x%04x", pCommandConfigReq->flags);
Offset += sizeof(SL2CAP_CommandConfigurationReq);
@ -497,7 +498,7 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
_dbg_assert_(WII_IPC_WIIMOTE, pOptions->length == 2);
SL2CAP_OptionsMTU* pMTU = (SL2CAP_OptionsMTU*)&_pData[Offset];
rChannel.MTU = pMTU->MTU;
LOG(WII_IPC_WIIMOTE, " Config MTU: 0x%04x", pMTU->MTU);
LOGV(WII_IPC_WIIMOTE, 1, " Config MTU: 0x%04x", pMTU->MTU);
}
break;
@ -506,7 +507,7 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
_dbg_assert_(WII_IPC_WIIMOTE, pOptions->length == 2);
SL2CAP_OptionsFlushTimeOut* pFlushTimeOut = (SL2CAP_OptionsFlushTimeOut*)&_pData[Offset];
rChannel.FlushTimeOut = pFlushTimeOut->TimeOut;
LOG(WII_IPC_WIIMOTE, " Config FlushTimeOut: 0x%04x", pFlushTimeOut->TimeOut);
LOGV(WII_IPC_WIIMOTE, 1, " Config FlushTimeOut: 0x%04x", pFlushTimeOut->TimeOut);
}
break;
@ -523,6 +524,7 @@ void CWII_IPC_HLE_WiiMote::CommandCofigurationReq(u8 _Ident, u8* _pData, u32 _Si
}
SendCommandToACL(_Ident, L2CAP_CONF_RSP, RespLen, TempBuffer);
LOGV(WII_IPC_WIIMOTE, 1, "=======================================================");
}
void CWII_IPC_HLE_WiiMote::CommandConnectionResponse(u8 _Ident, u8* _pData, u32 _Size)

View File

@ -281,7 +281,7 @@ void LogManager::Log(LogTypes::LOG_TYPE _type, const char *_fmt, ...)
id = i*100 + type;
// write to memory
m_Messages[i][m_nextMessages[i]].Set((LogTypes::LOG_TYPE)id, Msg2);
m_Messages[i][m_nextMessages[i]].Set((LogTypes::LOG_TYPE)id, v, Msg2);
// ----------------------------------------------------------------------------------------
// write to file

View File

@ -52,7 +52,7 @@ struct CDebugger_LogSettings
{
int m_iVerbosity; // verbosity level 0 - 2
bool bResolve;
bool bWriteMaster;
bool bWriteMaster;
// constructor
CDebugger_LogSettings();
@ -72,6 +72,7 @@ public:
{
bool m_bInUse;
LogTypes::LOG_TYPE m_type;
int m_verbosity;
char m_szMessage[MAX_MSGLEN];
int m_dwMsgLen;
@ -81,7 +82,7 @@ public:
{}
// set
void Set(LogTypes::LOG_TYPE _type, char* _szMessage)
void Set(LogTypes::LOG_TYPE _type, int _verbosity, char* _szMessage)
{
strncpy(m_szMessage, _szMessage, MAX_MSGLEN-1);
m_szMessage[MAX_MSGLEN-1] = 0;
@ -95,6 +96,7 @@ public:
m_szMessage[m_dwMsgLen] = 0;
m_type = _type;
m_verbosity = _verbosity;
m_bInUse = true; // turn on this message line
}
//

View File

@ -64,6 +64,7 @@ CLogWindow::CLogWindow(wxWindow* parent)
0, NULL, wxNO_BORDER);
m_options->Append(wxT("Resolve symbols"));
m_options->Append(wxT("Write master"));
m_options->Append(wxT("Show unique"));
m_optionsSizer->Add(m_options, 0, 0, 0);
// I could not find any transparency setting and it would not automatically space correctly
@ -144,8 +145,10 @@ void CLogWindow::Load(IniFile& _IniFile)
// load options
_IniFile.Get("LogWindow", "ResolveSymbols", &LogManager::m_LogSettings->bResolve, false);
_IniFile.Get("LogWindow", "WriteMaster", &LogManager::m_LogSettings->bWriteMaster, false);
_IniFile.Get("LogWindow", "Show unique", &bOnlyUnique, false);
m_options->Check(0, LogManager::m_LogSettings->bResolve);
m_options->Check(1, LogManager::m_LogSettings->bWriteMaster);
m_options->Check(2, bOnlyUnique);
}
void CLogWindow::OnSubmit(wxCommandEvent& event)
@ -239,7 +242,7 @@ void CLogWindow::UpdateChecks()
// ----------------------------------------------------------------------------------------
// When an option is changed
// When an option is changed, save the change
// ---------------
void CLogWindow::OnOptionsCheck(wxCommandEvent& event)
{
@ -247,8 +250,10 @@ void CLogWindow::OnOptionsCheck(wxCommandEvent& event)
ini.Load(DEBUGGER_CONFIG_FILE);
LogManager::m_LogSettings->bResolve = m_options->IsChecked(0);
LogManager::m_LogSettings->bWriteMaster = m_options->IsChecked(1);
bOnlyUnique = m_options->IsChecked(2);
ini.Set("LogWindow", "ResolveSymbols", m_options->IsChecked(0));
ini.Set("LogWindow", "WriteMaster", m_options->IsChecked(1));
ini.Set("LogWindow", "OnlyUnique", m_options->IsChecked(2));
ini.Save(DEBUGGER_CONFIG_FILE);
if (Core::GetState() != Core::CORE_UNINITIALIZED) UpdateLog();
}
@ -369,9 +374,22 @@ void CLogWindow::UpdateLog()
// 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;
if(bOnlyUnique) /* don't show lower level messages that have fallen through
to this higher level */
{
if(message.m_verbosity == v)
{
// memcpy is faster than strcpy
memcpy(p, message.m_szMessage, len);
p += len;
}
}
else
{
// memcpy is faster than strcpy
memcpy(p, message.m_szMessage, len);
p += len;
}
}
}
else

View File

@ -42,6 +42,8 @@ class CLogWindow
wxCheckListBox* m_options;
wxRadioBox *m_RadioBox[1]; // radio boxes
bool m_bCheckDirty;
bool bOnlyUnique;
DECLARE_EVENT_TABLE()
void OnSubmit(wxCommandEvent& event);