summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJohn Peterson <jpeterson57@gmail.com>2008-09-29 03:19:23 +0000
committerJohn Peterson <jpeterson57@gmail.com>2008-09-29 03:19:23 +0000
commitf2a5fd1973108dac2dce5b02703c7ccce2ede452 (patch)
treedff580538f261914fd3cd40f7f9ad727df9c1d41 /Source/Core
parent6a5467691435c23a6582fb0530d5bcdb597fbd8b (diff)
Some changes to the debugger, added a DSP HLE debugging window. I moved the initialization of DLLdebugger from Core.cpp to the debugging window. (I hope this doesn't break the LLE debugger in any way, or does it have to be started right after LoadPlugin?). Also added a ShowOnStart saved setting to the debugger. And a MainWindow saved setting that set the position and size of the main window when it's started. I may have broken things in the debugger by allowing disabling of for example the Jit window. Please accept my apologies if that is the case.
There's an annoying problem with the DSP HLE wx window that blocks some input and places it in a queue. For example if you have loaded the window and press X on the main window, that action is blocked an placed in some kind of queue and not executed until you have closed the debugging window. This is also why the main Dolphin-Debugger window does not show up until you close the sound window. If someone find a fix to this I guess it could be convenient. There is another way to show the window, m_frame->Show() that is normally supposed to remove this kind of on-focus lock, but in a dll it seemingly breaks because it makes Dllmain call DLL_PROCESS_DETACH immediately after DLL_PROCESS_ATTACH so the window has to be killed or we crash. Also, otherwise unnecessarily I had to disable the new DSP HLE debug window in Release mode because I could not access the SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str() string that I need to start it (if I tried it crashed). Very annoying and strange. I could not access m_strDSPPlugin or m_strVideoPlugin either, but all other values in m_LocalCoreStartupParameter seemed to work fine. I'll have to leave it to someone else to figure out why. TODO: Later I'll add function to the debugging buttons, currently only update have a function. I'll add some option to show a custom console window (that actually worked better that the wx window to show the current parameters status, it had less flicker on frequent updates). I'll also add some custom log file saving option. Also, the reason I placed Logging.cpp in its own dir is because I plan to add more files to it. There were problems with some build modes, win32 with debugging crashed on booting a game, I don't know if it's my fault. And I could not build Debug win64 because of some wx linking problem. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@722 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Src/Plugin.cpp12
-rw-r--r--Source/Core/Common/Src/Plugin.h2
-rw-r--r--Source/Core/Core/Src/Core.cpp5
-rw-r--r--Source/Core/DebuggerWX/DebuggerWX.vcproj54
-rw-r--r--Source/Core/DebuggerWX/Src/CodeWindow.cpp200
-rw-r--r--Source/Core/DebuggerWX/Src/CodeWindow.h6
-rw-r--r--Source/Core/DolphinWX/Src/Main.cpp34
-rw-r--r--Source/Core/DolphinWX/Src/PluginManager.cpp9
-rw-r--r--Source/Core/DolphinWX/Src/PluginManager.h1
9 files changed, 273 insertions, 50 deletions
diff --git a/Source/Core/Common/Src/Plugin.cpp b/Source/Core/Common/Src/Plugin.cpp
index 3495c55842..a0b09e850d 100644
--- a/Source/Core/Common/Src/Plugin.cpp
+++ b/Source/Core/Common/Src/Plugin.cpp
@@ -24,6 +24,8 @@ DynamicLibrary CPlugin::m_hInstLib;
void(__cdecl * CPlugin::m_GetDllInfo) (PLUGIN_INFO * _PluginInfo) = 0;
void(__cdecl * CPlugin::m_DllAbout) (HWND _hParent) = 0;
void(__cdecl * CPlugin::m_DllConfig) (HWND _hParent) = 0;
+void(__cdecl * CPlugin::m_DllDebugger) (HWND _hParent) = 0; // phew, is this the last one? how many
+// of these can you have?
void
CPlugin::Release(void)
@@ -31,6 +33,7 @@ CPlugin::Release(void)
m_GetDllInfo = 0;
m_DllAbout = 0;
m_DllConfig = 0;
+ m_DllDebugger = 0;
m_hInstLib.Unload();
}
@@ -43,6 +46,7 @@ CPlugin::Load(const char* _szName)
m_GetDllInfo = (void (__cdecl*)(PLUGIN_INFO*))m_hInstLib.Get("GetDllInfo");
m_DllAbout = (void (__cdecl*)(HWND))m_hInstLib.Get("DllAbout");
m_DllConfig = (void (__cdecl*)(HWND))m_hInstLib.Get("DllConfig");
+ m_DllDebugger = (void (__cdecl*)(HWND))m_hInstLib.Get("DllDebugger");
return(true);
}
@@ -77,4 +81,12 @@ void CPlugin::About(HWND _hwnd)
m_DllAbout(_hwnd);
}
}
+
+void CPlugin::Debug(HWND _hwnd)
+{
+ if (m_DllDebugger != 0)
+ {
+ m_DllDebugger(_hwnd);
+ }
+}
} // end of namespace Common
diff --git a/Source/Core/Common/Src/Plugin.h b/Source/Core/Common/Src/Plugin.h
index 449b604abf..ef872bd194 100644
--- a/Source/Core/Common/Src/Plugin.h
+++ b/Source/Core/Common/Src/Plugin.h
@@ -35,6 +35,7 @@ class CPlugin
static void Config(HWND _hwnd);
static void About(HWND _hwnd);
+ static void Debug(HWND _hwnd);
private:
@@ -44,6 +45,7 @@ class CPlugin
static void (__cdecl * m_GetDllInfo)(PLUGIN_INFO* _PluginInfo);
static void (__cdecl * m_DllAbout)(HWND _hParent);
static void (__cdecl * m_DllConfig)(HWND _hParent);
+ static void (__cdecl * m_DllDebugger)(HWND _hParent);
};
} // end of namespace Common
diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp
index 5e6c003619..b107752693 100644
--- a/Source/Core/Core/Src/Core.cpp
+++ b/Source/Core/Core/Src/Core.cpp
@@ -139,11 +139,6 @@ bool Init(const SCoreStartupParameter _CoreParameter)
return false;
}
-#ifdef _WIN32
- if (PluginDSP::DllDebugger)
- PluginDSP::DllDebugger((HWND)_CoreParameter.hMainWindow);
-#endif
-
emuThreadGoing.Init();
g_pThread = new Common::Thread(EmuThread, (void*)&g_CoreStartupParameter);
diff --git a/Source/Core/DebuggerWX/DebuggerWX.vcproj b/Source/Core/DebuggerWX/DebuggerWX.vcproj
index 87bb1ffb45..ededbdbc10 100644
--- a/Source/Core/DebuggerWX/DebuggerWX.vcproj
+++ b/Source/Core/DebuggerWX/DebuggerWX.vcproj
@@ -86,7 +86,7 @@
/>
</Configuration>
<Configuration
- Name="Release|Win32"
+ Name="Debug|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
@@ -107,15 +107,17 @@
/>
<Tool
Name="VCMIDLTool"
+ TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
+ Optimization="0"
WholeProgramOptimization="false"
- AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
- RuntimeLibrary="0"
- BufferSecurityCheck="false"
- EnableEnhancedInstructionSet="2"
+ AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
@@ -151,7 +153,7 @@
/>
</Configuration>
<Configuration
- Name="DebugFast|Win32"
+ Name="Release|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
@@ -175,12 +177,9 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="0"
WholeProgramOptimization="false"
- AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
- PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
- MinimalRebuild="true"
- BasicRuntimeChecks="0"
+ AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
RuntimeLibrary="0"
BufferSecurityCheck="false"
EnableEnhancedInstructionSet="2"
@@ -219,7 +218,7 @@
/>
</Configuration>
<Configuration
- Name="Debug|x64"
+ Name="Release|x64"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
@@ -244,13 +243,11 @@
/>
<Tool
Name="VCCLCompilerTool"
- Optimization="0"
WholeProgramOptimization="false"
- AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WXMSW__"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="1"
+ AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
+ RuntimeLibrary="0"
+ BufferSecurityCheck="false"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
@@ -286,7 +283,7 @@
/>
</Configuration>
<Configuration
- Name="Release|x64"
+ Name="DebugFast|Win32"
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
ConfigurationType="4"
@@ -307,15 +304,18 @@
/>
<Tool
Name="VCMIDLTool"
- TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
+ Optimization="0"
WholeProgramOptimization="false"
- AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;__WXMSW__"
+ AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
+ PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="0"
RuntimeLibrary="0"
BufferSecurityCheck="false"
+ EnableEnhancedInstructionSet="2"
UsePrecompiledHeader="0"
WarningLevel="3"
WarnAsError="false"
@@ -378,7 +378,7 @@
Name="VCCLCompilerTool"
Optimization="0"
WholeProgramOptimization="false"
- AdditionalIncludeDirectories="..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;;..\Common\Src;..\..\..\Externals\Bochs_disasm"
+ AdditionalIncludeDirectories="..\..\PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc;..\Core\Src;..\Common\Src;..\..\..\Externals\Bochs_disasm"
PreprocessorDefinitions="WIN32;__WXMSW__;_WINDOWS;NOPCH;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@@ -509,7 +509,7 @@
/>
</FileConfiguration>
<FileConfiguration
- Name="DebugFast|Win32"
+ Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"
@@ -517,7 +517,7 @@
/>
</FileConfiguration>
<FileConfiguration
- Name="Debug|x64"
+ Name="Release|x64"
>
<Tool
Name="VCCLCompilerTool"
@@ -525,7 +525,7 @@
/>
</FileConfiguration>
<FileConfiguration
- Name="Release|x64"
+ Name="DebugFast|Win32"
>
<Tool
Name="VCCLCompilerTool"
diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp
index 918ecaf40f..3faaaa8f34 100644
--- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp
+++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp
@@ -55,6 +55,14 @@
#include "PowerPC/Jit64/Jit.h"
#include "PowerPC/Jit64/JitCache.h"
+#include "Plugins/Plugin_DSP.h" // new stuff, to let us open the DLLDebugger
+#include "../../DolphinWX/src/PluginManager.h"
+#include "../../DolphinWX/src/Config.h"
+
+// and here are the classes
+class CPluginInfo;
+class CPluginManager;
+
extern "C" {
#include "../resources/toolbar_play.c"
#include "../resources/toolbar_pause.c"
@@ -75,6 +83,8 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame)
EVT_MENU(IDM_REGISTERWINDOW, CCodeWindow::OnToggleRegisterWindow)
EVT_MENU(IDM_BREAKPOINTWINDOW, CCodeWindow::OnToggleBreakPointWindow)
EVT_MENU(IDM_MEMORYWINDOW, CCodeWindow::OnToggleMemoryWindow)
+ EVT_MENU(IDM_JITWINDOW, CCodeWindow::OnToggleJitWindow)
+ EVT_MENU(IDM_SOUNDWINDOW, CCodeWindow::OnToggleSoundWindow)
EVT_MENU(IDM_INTERPRETER, CCodeWindow::OnInterpreter)
@@ -110,11 +120,18 @@ inline wxBitmap _wxGetBitmapFromMemory(const unsigned char* data, int length)
return(wxBitmap(wxImage(is, wxBITMAP_TYPE_ANY, -1), -1));
}
+// =======================================================================================
+// WARNING: If you create a new dialog window you must add m_dialog(NULL) below otherwise
+// m_dialog = true and things will crash.
+// ----------------
CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, wxWindow* parent, wxWindowID id,
const wxString& title, const wxPoint& pos, const wxSize& size, long style)
: wxFrame(parent, id, title, pos, size, style)
, m_LogWindow(NULL)
, m_RegisterWindow(NULL)
+ , m_BreakpointWindow(NULL)
+ , m_MemoryWindow(NULL)
+ , m_JitWindow(NULL)
{
InitBitmaps();
@@ -138,7 +155,9 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter
if (m_LogWindow) m_LogWindow->Load(file);
if (m_RegisterWindow) m_RegisterWindow->Load(file);
if (m_MemoryWindow) m_MemoryWindow->Load(file);
+ if (m_JitWindow) m_JitWindow->Load(file);
}
+// ===============
CCodeWindow::~CCodeWindow()
@@ -151,6 +170,7 @@ CCodeWindow::~CCodeWindow()
if (m_LogWindow) m_LogWindow->Save(file);
if (m_RegisterWindow) m_RegisterWindow->Save(file);
if (m_MemoryWindow) m_MemoryWindow->Save(file);
+ if (m_JitWindow) m_JitWindow->Save(file);
file.Save("Debugger.ini");
}
@@ -175,11 +195,36 @@ void CCodeWindow::Save(IniFile &file) const
file.Set("Code", "h", GetSize().GetHeight());
}
-
+// =======================================================================================
+// I don't know when you're supposed to be able to use pRegister->Check(true) so I had
+// to set these here. It kept crashing if I placed it after m_LogWindow->Show() below.
+bool bLogWindow = true;
+bool bRegisterWindow = true;
+bool bBreakpointWindow = true;
+bool bMemoryWindow = true;
+bool bJitWindow = true;
+bool bSoundWindow = false;
+// -------------------
void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStartupParameter)
{
+ // =======================================================================================
+ // Decide what windows to use
+ // --------------
+ IniFile ini;
+ ini.Load("Debugger.ini");
+
+ ini.Get("ShowOnStart", "LogWindow", &bLogWindow, true);
+ ini.Get("ShowOnStart", "RegisterWindow", &bRegisterWindow, true);
+ ini.Get("ShowOnStart", "BreakpointWindow", &bBreakpointWindow, true);
+ ini.Get("ShowOnStart", "MemoryWindow", &bMemoryWindow, true);
+ ini.Get("ShowOnStart", "JitWindow", &bJitWindow, true);
+ ini.Get("ShowOnStart", "SoundWindow", &bSoundWindow, false);
+ // ===============
+
CreateMenu(_LocalCoreStartupParameter);
+ // =======================================================================================
+ // Configure the code window
wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL);
@@ -202,30 +247,59 @@ void CCodeWindow::CreateGUIControls(const SCoreStartupParameter& _LocalCoreStart
sizerBig->Fit(this);
sync_event.Init();
+ // =================
+
// additional dialogs
- if (IsLoggingActivated())
+ if (IsLoggingActivated() && bLogWindow)
{
m_LogWindow = new CLogWindow(this);
m_LogWindow->Show(true);
}
- m_RegisterWindow = new CRegisterWindow(this);
- m_RegisterWindow->Show(true);
+ if (bRegisterWindow)
+ {
+ m_RegisterWindow = new CRegisterWindow(this);
+ m_RegisterWindow->Show(true);
+ }
- m_BreakpointWindow = new CBreakPointWindow(this, this);
- m_BreakpointWindow->Show(true);
+ if(bBreakpointWindow)
+ {
+ m_BreakpointWindow = new CBreakPointWindow(this, this);
+ m_BreakpointWindow->Show(true);
+ }
+
+ if(bMemoryWindow)
+ {
+ m_MemoryWindow = new CMemoryWindow(this);
+ m_MemoryWindow->Show(true);
+ }
- m_MemoryWindow = new CMemoryWindow(this);
- m_MemoryWindow->Show(true);
+ if(bJitWindow)
+ {
+ m_JitWindow = new CJitWindow(this);
+ m_JitWindow->Show(true);
+ }
- m_JitWindow = new CJitWindow(this);
- m_JitWindow->Show(true);
+ if(IsLoggingActivated() && bSoundWindow)
+ {
+ // no if() check here?
+ CPluginManager::GetInstance().OpenDebug(
+ GetHandle(),
+ SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str()
+ );
+
+
+ }
}
void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParameter)
{
+
+ // =======================================================================================
+ // Windowses
+ // ---------------
wxMenuBar* pMenuBar = new wxMenuBar(wxMB_DOCKABLE);
{
@@ -245,19 +319,29 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
if (IsLoggingActivated())
{
wxMenuItem* pLogWindow = pDebugDialogs->Append(IDM_LOGWINDOW, _T("&LogManager"), wxEmptyString, wxITEM_CHECK);
- pLogWindow->Check(true);
+ pLogWindow->Check(bLogWindow);
}
wxMenuItem* pRegister = pDebugDialogs->Append(IDM_REGISTERWINDOW, _T("&Registers"), wxEmptyString, wxITEM_CHECK);
- pRegister->Check(true);
+ pRegister->Check(bRegisterWindow);
wxMenuItem* pBreakPoints = pDebugDialogs->Append(IDM_BREAKPOINTWINDOW, _T("&BreakPoints"), wxEmptyString, wxITEM_CHECK);
- pBreakPoints->Check(true);
+ pBreakPoints->Check(bBreakpointWindow);
wxMenuItem* pMemory = pDebugDialogs->Append(IDM_MEMORYWINDOW, _T("&Memory"), wxEmptyString, wxITEM_CHECK);
- pMemory->Check(true);
+ pMemory->Check(bMemoryWindow);
+
+ wxMenuItem* pJit = pDebugDialogs->Append(IDM_JITWINDOW, _T("&Jit"), wxEmptyString, wxITEM_CHECK);
+ pJit->Check(bJitWindow);
+
+ if (IsLoggingActivated()) {
+ wxMenuItem* pSound = pDebugDialogs->Append(IDM_SOUNDWINDOW, _T("&Sound"), wxEmptyString, wxITEM_CHECK);
+ pSound->Check(bSoundWindow);}
+
pMenuBar->Append(pDebugDialogs, _T("&Views"));
}
+ // ===============
+
{
wxMenu *pSymbolsMenu = new wxMenu;
@@ -665,10 +749,18 @@ void CCodeWindow::OnSymbolListContextMenu(wxContextMenuEvent& event)
void CCodeWindow::OnToggleLogWindow(wxCommandEvent& event)
{
+
if (IsLoggingActivated())
{
bool show = GetMenuBar()->IsChecked(event.GetId());
+ // this may be a little ugly to have these here - you're more than welcome to
+ // turn this into the same fancy class stuff like the load windows positions
+ IniFile ini;
+ ini.Load("Debugger.ini");
+ ini.Set("ShowOnStart", "LogWindow", show);
+ ini.Save("Debugger.ini");
+
if (show)
{
if (!m_LogWindow)
@@ -699,6 +791,11 @@ void CCodeWindow::OnToggleRegisterWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
+ IniFile ini;
+ ini.Load("Debugger.ini");
+ ini.Set("ShowOnStart", "RegisterWindow", show);
+ ini.Save("Debugger.ini");
+
if (show)
{
if (!m_RegisterWindow)
@@ -723,10 +820,79 @@ void CCodeWindow::OnToggleRegisterWindow(wxCommandEvent& event)
}
}
+
+// =======================================================================================
+// Toggle Sound Debugging Window
+// ------------
+void CCodeWindow::OnToggleSoundWindow(wxCommandEvent& event)
+{
+ bool show = GetMenuBar()->IsChecked(event.GetId());
+
+ IniFile ini;
+ ini.Load("Debugger.ini");
+ ini.Set("ShowOnStart", "SoundWindow", show);
+ ini.Save("Debugger.ini");
+
+
+ if (IsLoggingActivated() && show)
+ {
+ // TODO: add some kind of if?
+ CPluginManager::GetInstance().OpenDebug(
+ GetHandle(),
+ SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDSPPlugin.c_str()
+ );
+ }
+ else // hide
+ {
+ // can we close the dll window from here?
+ }
+}
+// ===========
+
+
+void CCodeWindow::OnToggleJitWindow(wxCommandEvent& event)
+{
+ bool show = GetMenuBar()->IsChecked(event.GetId());
+
+ IniFile ini;
+ ini.Load("Debugger.ini");
+ ini.Set("ShowOnStart", "JitWindow", show);
+ ini.Save("Debugger.ini");
+
+ if (show)
+ {
+ if (!m_JitWindow)
+ {
+ m_JitWindow = new CJitWindow(this);
+ }
+
+ m_JitWindow->Show(true);
+ }
+ else // hide
+ {
+ // If m_dialog is NULL, then possibly the system
+ // didn't report the checked menu item status correctly.
+ // It should be true just after the menu item was selected,
+ // if there was no modeless dialog yet.
+ wxASSERT(m_JitWindow != NULL);
+
+ if (m_JitWindow)
+ {
+ m_JitWindow->Hide();
+ }
+ }
+}
+
+
void CCodeWindow::OnToggleBreakPointWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
+ IniFile ini;
+ ini.Load("Debugger.ini");
+ ini.Set("ShowOnStart", "BreakpointWindow", show);
+ ini.Save("Debugger.ini");
+
if (show)
{
if (!m_BreakpointWindow)
@@ -754,6 +920,11 @@ void CCodeWindow::OnToggleBreakPointWindow(wxCommandEvent& event)
void CCodeWindow::OnToggleMemoryWindow(wxCommandEvent& event)
{
bool show = GetMenuBar()->IsChecked(event.GetId());
+
+ IniFile ini;
+ ini.Load("Debugger.ini");
+ ini.Set("ShowOnStart", "MemoryWindow", show);
+ ini.Save("Debugger.ini");
if (show)
{
@@ -803,7 +974,6 @@ void CCodeWindow::OnHostMessage(wxCommandEvent& event)
{
m_RegisterWindow->NotifyUpdate();
}
-
break;
case IDM_UPDATEBREAKPOINTS:
diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.h b/Source/Core/DebuggerWX/Src/CodeWindow.h
index 4981b0f5f1..e39e9c8427 100644
--- a/Source/Core/DebuggerWX/Src/CodeWindow.h
+++ b/Source/Core/DebuggerWX/Src/CodeWindow.h
@@ -15,6 +15,7 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
+
#ifndef CODEWINDOW_H_
#define CODEWINDOW_H_
@@ -83,6 +84,8 @@ class CCodeWindow
IDM_REGISTERWINDOW,
IDM_BREAKPOINTWINDOW,
IDM_MEMORYWINDOW,
+ IDM_SOUNDWINDOW, // sound
+ IDM_JITWINDOW, // jit
IDM_SCANFUNCTIONS,
IDM_LOGINSTRUCTIONS,
IDM_LOADMAPFILE,
@@ -143,6 +146,9 @@ class CCodeWindow
void OnToggleBreakPointWindow(wxCommandEvent& event);
void OnToggleLogWindow(wxCommandEvent& event);
void OnToggleMemoryWindow(wxCommandEvent& event);
+ void OnToggleJitWindow(wxCommandEvent& event);
+ void OnToggleSoundWindow(wxCommandEvent& event);
+
void OnHostMessage(wxCommandEvent& event);
void OnSymbolsMenu(wxCommandEvent& event);
void OnJitMenu(wxCommandEvent& event);
diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp
index af97bd29f9..264a1fd4b6 100644
--- a/Source/Core/DolphinWX/Src/Main.cpp
+++ b/Source/Core/DolphinWX/Src/Main.cpp
@@ -103,12 +103,15 @@ bool DolphinApp::OnInit()
}
#endif
+ // ============
+ // Check for debugger
bool UseDebugger = false;
#if wxUSE_CMDLINE_PARSER
wxCmdLineEntryDesc cmdLineDesc[] =
{
- {wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"), wxCMD_LINE_VAL_NONE, wxCMD_LINE_OPTION_HELP},
+ {wxCMD_LINE_SWITCH, _T("h"), _T("help"), _T("Show this help message"), wxCMD_LINE_VAL_NONE,
+ wxCMD_LINE_OPTION_HELP},
{wxCMD_LINE_SWITCH, _T("d"), _T("debugger"), _T("Opens the debugger")},
{wxCMD_LINE_NONE}
};
@@ -123,6 +126,7 @@ bool DolphinApp::OnInit()
}
UseDebugger = parser.Found(_T("debugger"));
+ // ============
#endif
SConfig::GetInstance().LoadSettings();
@@ -141,8 +145,32 @@ bool DolphinApp::OnInit()
const char *title = "Dolphin SVN Linux";
#endif
#endif
- main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
- wxPoint(100, 100), wxSize(800, 600));
+
+ // ---------------------------------------------------------------------------------------
+ // If we are debugging let use save the main window position and size
+ // TODO: Save position and size on exit
+ // ---------
+ IniFile ini;
+ ini.Load("Debugger.ini");
+
+ int x, y, w, h;
+
+ ini.Get("MainWindow", "x", &x, 100);
+ ini.Get("MainWindow", "y", &y, 100);
+ ini.Get("MainWindow", "w", &w, 600);
+ ini.Get("MainWindow", "h", &h, 800);
+ // ---------
+ if(UseDebugger)
+ {
+ main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
+ wxPoint(x, y), wxSize(h, w));
+ }
+ else
+ {
+ main_frame = new CFrame((wxFrame*) NULL, wxID_ANY, wxString::FromAscii(title),
+ wxPoint(100, 100), wxSize(800, 600));
+ }
+ // ---------
// create debugger
if (UseDebugger)
diff --git a/Source/Core/DolphinWX/Src/PluginManager.cpp b/Source/Core/DolphinWX/Src/PluginManager.cpp
index bd00c956ab..918c7b7fe6 100644
--- a/Source/Core/DolphinWX/Src/PluginManager.cpp
+++ b/Source/Core/DolphinWX/Src/PluginManager.cpp
@@ -118,6 +118,15 @@ void CPluginManager::OpenConfig(void* _Parent, const char *_rFilename)
}
}
+void CPluginManager::OpenDebug(void* _Parent, const char *_rFilename)
+{
+ if (Common::CPlugin::Load(_rFilename))
+ {
+ Common::CPlugin::Debug((HWND)_Parent);
+ Common::CPlugin::Release();
+ }
+}
+
CPluginInfo::CPluginInfo(const char *_rFileName)
: m_FileName(_rFileName)
, m_Valid(false)
diff --git a/Source/Core/DolphinWX/Src/PluginManager.h b/Source/Core/DolphinWX/Src/PluginManager.h
index 4ce0322616..d34302f5fe 100644
--- a/Source/Core/DolphinWX/Src/PluginManager.h
+++ b/Source/Core/DolphinWX/Src/PluginManager.h
@@ -43,6 +43,7 @@ public:
void ScanForPlugins(wxWindow* _wxWindow);
void OpenAbout(void* _Parent, const char *_rFilename);
void OpenConfig(void* _Parent, const char *_rFilename);
+ void OpenDebug(void* _Parent, const char *_rFilename);
const CPluginInfos& GetPluginInfos() {return(m_PluginInfos);}
private: