From ba0b277597da133fc6aa8100c510fbd0f271eaf5 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Mon, 29 Sep 2008 18:14:46 +0000 Subject: [PATCH] Prevent LLE debugging window to start before boot. I don't know if the plugin can get the CPU state, if it can perhaps it's better to have that check in the plugin. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@730 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DebuggerWX/Src/CodeWindow.cpp | 55 ++++++++++++++++++----- 1 file changed, 43 insertions(+), 12 deletions(-) diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 066e031ba0..6850bd29f3 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -283,13 +283,25 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart if(IsLoggingActivated() && bSoundWindow) { - // no if() check here? - CPluginManager::GetInstance().OpenDebug( - GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() - ); - - + if(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.find("LLE") != -1) + // no match = -1, in that case this is ignored + { + if (Core::GetState() != Core::CORE_UNINITIALIZED) + { + // possible todo: add some kind of if here to? can it fail? + CPluginManager::GetInstance().OpenDebug( + GetHandle(), + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() + ); + } // don't have any else, just ignore it + } + else + { + CPluginManager::GetInstance().OpenDebug( + GetHandle(), + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() + ); + } } } @@ -836,11 +848,30 @@ void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event) if (IsLoggingActivated() && show) { - // TODO: add some kind of if? - CPluginManager::GetInstance().OpenDebug( - GetHandle(), - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() - ); + // we only need to prevent this with the LLE, therefore this check + if(SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.find("LLE") != -1) + // no match = -1, in that case this is ignored + { + if (Core::GetState() != Core::CORE_UNINITIALIZED) + { + // TODO: add some kind of if here to? + CPluginManager::GetInstance().OpenDebug( + GetHandle(), + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() + ); + } else { + event.Skip(); + wxMessageBox(_T("Please start the emulator before doing this.")); + } + } + else + { + CPluginManager::GetInstance().OpenDebug( + GetHandle(), + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() + ); + } + } else // hide {