From b6251ba674f3e70d777bc80075a8facd7859dc72 Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 31 Jan 2011 04:36:49 +0000 Subject: [PATCH] Fix the DSPLLE debugger window. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7007 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/DSP/DSPCore.cpp | 2 +- Source/Core/Core/Src/DSP/DSPEmitter.cpp | 10 +++++----- Source/Core/Core/Src/DSP/DSPEmitter.h | 4 ++-- Source/Core/DebuggerWX/CMakeLists.txt | 2 +- Source/Core/DebuggerWX/Src/CodeWindow.cpp | 1 + Source/Core/DebuggerWX/Src/CodeWindow.h | 2 ++ Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp | 3 +-- Source/Core/DebuggerWX/Src/DSPDebugWindow.cpp | 6 ++++-- Source/Core/DebuggerWX/Src/DSPDebugWindow.h | 8 ++++---- Source/Core/VideoUICommon/Src/DebuggerPanel.cpp | 5 +++-- 10 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Source/Core/Core/Src/DSP/DSPCore.cpp b/Source/Core/Core/Src/DSP/DSPCore.cpp index b053395881..67c7cc6167 100644 --- a/Source/Core/Core/Src/DSP/DSPCore.cpp +++ b/Source/Core/Core/Src/DSP/DSPCore.cpp @@ -251,7 +251,7 @@ int DSPCore_RunCycles(int cycles) if (dspjit) { cyclesLeft = cycles; - CompiledCode pExecAddr = (CompiledCode)dspjit->enterDispatcher; + DSPCompiledCode pExecAddr = (DSPCompiledCode)dspjit->enterDispatcher; pExecAddr(); if (g_dsp.external_interrupt_waiting) diff --git a/Source/Core/Core/Src/DSP/DSPEmitter.cpp b/Source/Core/Core/Src/DSP/DSPEmitter.cpp index e68fea7e18..ec14a0d30c 100644 --- a/Source/Core/Core/Src/DSP/DSPEmitter.cpp +++ b/Source/Core/Core/Src/DSP/DSPEmitter.cpp @@ -37,7 +37,7 @@ DSPEmitter::DSPEmitter() : gpr(*this), storeIndex(-1), storeIndex2(-1) AllocCodeSpace(COMPILED_CODE_SIZE); - blocks = new CompiledCode[MAX_BLOCKS]; + blocks = new DSPCompiledCode[MAX_BLOCKS]; blockLinks = new Block[MAX_BLOCKS]; blockSize = new u16[MAX_BLOCKS]; unresolvedJumps = new std::list[MAX_BLOCKS]; @@ -52,7 +52,7 @@ DSPEmitter::DSPEmitter() : gpr(*this), storeIndex(-1), storeIndex2(-1) //clear all of the block references for(int i = 0x0000; i < MAX_BLOCKS; i++) { - blocks[i] = (CompiledCode)stubEntryPoint; + blocks[i] = (DSPCompiledCode)stubEntryPoint; blockLinks[i] = 0; blockSize[i] = 0; } @@ -70,7 +70,7 @@ void DSPEmitter::ClearIRAM() { // ClearCodeSpace(); for(int i = 0x0000; i < 0x1000; i++) { - blocks[i] = (CompiledCode)stubEntryPoint; + blocks[i] = (DSPCompiledCode)stubEntryPoint; blockLinks[i] = 0; blockSize[i] = 0; } @@ -338,7 +338,7 @@ void DSPEmitter::Compile(u16 start_addr) #endif } - blocks[start_addr] = (CompiledCode)entryPoint; + blocks[start_addr] = (DSPCompiledCode)entryPoint; // Mark this block as a linkable destination if it does not contain // any unresolved CALL's @@ -356,7 +356,7 @@ void DSPEmitter::Compile(u16 start_addr) if (unresolvedJumps[i].size() < size) { // Mark the block to be recompiled again - blocks[i] = (CompiledCode)stubEntryPoint; + blocks[i] = (DSPCompiledCode)stubEntryPoint; blockLinks[i] = 0; blockSize[i] = 0; } diff --git a/Source/Core/Core/Src/DSP/DSPEmitter.h b/Source/Core/Core/Src/DSP/DSPEmitter.h index 17f1850001..874caef5fe 100644 --- a/Source/Core/Core/Src/DSP/DSPEmitter.h +++ b/Source/Core/Core/Src/DSP/DSPEmitter.h @@ -28,7 +28,7 @@ #define MAX_BLOCKS 0x10000 -typedef u32 (*CompiledCode)(); +typedef u32 (*DSPCompiledCode)(); typedef const u8 *Block; class DSPEmitter : public Gen::XCodeBlock, NonCopyable @@ -264,7 +264,7 @@ public: void SaveDSPRegs(); private: - CompiledCode *blocks; + DSPCompiledCode *blocks; Block blockLinkEntry; u16 compileSR; diff --git a/Source/Core/DebuggerWX/CMakeLists.txt b/Source/Core/DebuggerWX/CMakeLists.txt index df7f064249..36adbd6ff7 100644 --- a/Source/Core/DebuggerWX/CMakeLists.txt +++ b/Source/Core/DebuggerWX/CMakeLists.txt @@ -14,4 +14,4 @@ set(SRCS Src/BreakpointDlg.cpp Src/RegisterWindow.cpp) add_library(debwx STATIC ${SRCS}) -target_link_libraries(debwx common debugger_ui_util) +target_link_libraries(debwx common core debugger_ui_util) diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index 6ff7c5b82d..28b80e8a62 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -139,6 +139,7 @@ CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter , m_BreakpointWindow(NULL) , m_MemoryWindow(NULL) , m_JitWindow(NULL) + , m_SoundWindow(NULL) , m_VideoWindow(NULL) , codeview(NULL) { diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.h b/Source/Core/DebuggerWX/Src/CodeWindow.h index c5456c2940..af499aa6d3 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.h +++ b/Source/Core/DebuggerWX/Src/CodeWindow.h @@ -37,6 +37,7 @@ class CBreakPointWindow; class CMemoryWindow; class CJitWindow; class CCodeView; +class DSPDebuggerLLE; class GFXDebuggerPanel; class CCodeWindow @@ -107,6 +108,7 @@ class CCodeWindow CBreakPointWindow* m_BreakpointWindow; CMemoryWindow* m_MemoryWindow; CJitWindow* m_JitWindow; + DSPDebuggerLLE* m_SoundWindow; GFXDebuggerPanel* m_VideoWindow; // Settings diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index b88fd13bc8..7a2bade4ad 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -38,6 +38,7 @@ #include "MemoryWindow.h" #include "JitWindow.h" #include "DebuggerPanel.h" +#include "DSPDebugWindow.h" #include "FileUtil.h" #include "CodeWindow.h" @@ -516,7 +517,6 @@ void CCodeWindow::ToggleJitWindow(bool bShow) void CCodeWindow::ToggleSoundWindow(bool bShow) { // TODO: Resurrect DSP debugger window. -#if 0 GetMenuBar()->FindItem(IDM_SOUNDWINDOW)->Check(bShow); if (bShow) { @@ -531,7 +531,6 @@ void CCodeWindow::ToggleSoundWindow(bool bShow) Parent->DoRemovePage(m_SoundWindow, false); m_SoundWindow = NULL; } -#endif } void CCodeWindow::ToggleVideoWindow(bool bShow) diff --git a/Source/Core/DebuggerWX/Src/DSPDebugWindow.cpp b/Source/Core/DebuggerWX/Src/DSPDebugWindow.cpp index 4c11a0c917..2b29ae95ed 100644 --- a/Source/Core/DebuggerWX/Src/DSPDebugWindow.cpp +++ b/Source/Core/DebuggerWX/Src/DSPDebugWindow.cpp @@ -39,11 +39,13 @@ BEGIN_EVENT_TABLE(DSPDebuggerLLE, wxPanel) END_EVENT_TABLE() -DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent) - : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(700, 800), +DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id) + : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("DSP LLE Debugger")) , m_CachedStepCounter(-1) { + m_DebuggerFrame = this; + // notify wxAUI which frame to use m_mgr.SetManagedWindow(this); diff --git a/Source/Core/DebuggerWX/Src/DSPDebugWindow.h b/Source/Core/DebuggerWX/Src/DSPDebugWindow.h index d624cc2d54..95bd3b4286 100644 --- a/Source/Core/DebuggerWX/Src/DSPDebugWindow.h +++ b/Source/Core/DebuggerWX/Src/DSPDebugWindow.h @@ -47,7 +47,7 @@ class CMemoryView; class DSPDebuggerLLE : public wxPanel { public: - DSPDebuggerLLE(wxWindow *parent); + DSPDebuggerLLE(wxWindow *parent, wxWindowID id = wxID_ANY); virtual ~DSPDebuggerLLE(); void Refresh(); @@ -86,15 +86,15 @@ private: void OnClose(wxCloseEvent& event); void OnChangeState(wxCommandEvent& event); - void OnRightClick(wxListEvent& event); - void OnDoubleClick(wxListEvent& event); + //void OnRightClick(wxListEvent& event); + //void OnDoubleClick(wxListEvent& event); void OnAddrBoxChange(wxCommandEvent& event); void OnSymbolListChange(wxCommandEvent& event); bool JumpToAddress(u16 addr); void FocusOnPC(); - void UnselectAll(); + //void UnselectAll(); }; extern DSPDebuggerLLE* m_DebuggerFrame; diff --git a/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp b/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp index 9907e69f2c..3ba50d2d8d 100644 --- a/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp +++ b/Source/Core/VideoUICommon/Src/DebuggerPanel.cpp @@ -50,6 +50,8 @@ GFXDebuggerPanel::GFXDebuggerPanel(wxWindow *parent, wxWindowID id, const wxPoin const wxSize& size, long style, const wxString &title) : wxPanel(parent, id, position, size, style, title) { + g_pdebugger = this; + CreateGUIControls(); LoadSettings(); @@ -57,6 +59,7 @@ GFXDebuggerPanel::GFXDebuggerPanel(wxWindow *parent, wxWindowID id, const wxPoin GFXDebuggerPanel::~GFXDebuggerPanel() { + g_pdebugger = NULL; GFXDebuggerPauseFlag = false; } @@ -134,8 +137,6 @@ static const int numPauseEventMap = sizeof(pauseEventMap)/sizeof(PauseEventMap); void GFXDebuggerPanel::CreateGUIControls() { - g_pdebugger = this; - // Basic settings CenterOnParent();