diff --git a/bin/docs/debugger.txt b/bin/docs/debugger.txt new file mode 100644 index 0000000000..a8fd3e3ca6 --- /dev/null +++ b/bin/docs/debugger.txt @@ -0,0 +1,31 @@ +disassembly view: + + ctrg+g goto + ctrl+e edit breakpoint + ctrl+d enable/disable breakpoint + ctrl+b add breakpoint + right follow branch/position memory view to accessed address + left go back one branch level/goto pc + up move cursor up one line + down move cursor down one line + page up move visible area up one page + page down move visible area down one page + f10 step over + tab toggle display symbols + left click select line/toggle breakpoint if line is already highlighted + right click open context menu + +memory view: + + ctrg+g goto + ctrl+b add breakpoint + left move cursor back one byte/nibble + right move cursor ahead one byte/nibble + up move cursor up one line + down move cursor down one line + page up move cursor up one page + page down move cursor down one page + 0-9,A-F overwrite hex nibble + any overwrite ansi byte + left click select byte/nibble + right click open context menu diff --git a/pcsx2/PathDefs.h b/pcsx2/PathDefs.h index 61d37bcd16..fcf06e0dca 100644 --- a/pcsx2/PathDefs.h +++ b/pcsx2/PathDefs.h @@ -63,6 +63,7 @@ namespace PathDefs extern wxDirName GetLangs(); extern wxDirName GetCheats(); extern wxDirName GetCheatsWS(); + extern wxDirName GetDocs(); extern wxDirName Get( FoldersEnum_t folderidx ); @@ -81,6 +82,7 @@ namespace PathDefs extern const wxDirName& Langs(); extern const wxDirName& Cheats(); extern const wxDirName& CheatsWS(); + extern const wxDirName& Docs(); } } diff --git a/pcsx2/gui/AppConfig.cpp b/pcsx2/gui/AppConfig.cpp index 6551a0f620..069b62120c 100644 --- a/pcsx2/gui/AppConfig.cpp +++ b/pcsx2/gui/AppConfig.cpp @@ -95,6 +95,12 @@ namespace PathDefs static const wxDirName retval( L"themes" ); return retval; } + + const wxDirName& Docs() + { + static const wxDirName retval( L"docs" ); + return retval; + } }; // Specifies the root folder for the application install. @@ -190,6 +196,11 @@ namespace PathDefs { return GetDocuments() + Base::CheatsWS(); } + + wxDirName GetDocs() + { + return AppRoot() + Base::Docs(); + } wxDirName GetSavestates() { diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.cpp b/pcsx2/gui/Debugger/DisassemblyDialog.cpp index 337cd791f6..624b3dbfc4 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.cpp +++ b/pcsx2/gui/Debugger/DisassemblyDialog.cpp @@ -5,6 +5,11 @@ #include "DebugTools/DisassemblyManager.h" #include "DebugTools/Breakpoints.h" #include "BreakpointWindow.h" +#include "PathDefs.h" + +#ifdef WIN32 +#include +#endif BEGIN_EVENT_TABLE(DisassemblyDialog, wxFrame) EVT_COMMAND( wxID_ANY, debEVT_SETSTATUSBARTEXT, DisassemblyDialog::onDebuggerEvent ) @@ -16,6 +21,34 @@ BEGIN_EVENT_TABLE(DisassemblyDialog, wxFrame) EVT_COMMAND( wxID_ANY, debEVT_UPDATE, DisassemblyDialog::onDebuggerEvent ) END_EVENT_TABLE() + +DebuggerHelpDialog::DebuggerHelpDialog(wxWindow* parent) + : wxDialog(parent,wxID_ANY,L"Help") +{ + wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); + + wxTextCtrl* textControl = new wxTextCtrl(this,wxID_ANY,L"",wxDefaultPosition,wxDefaultSize, + wxTE_MULTILINE|wxTE_READONLY); + textControl->SetMinSize(wxSize(400,300)); + auto fileName = PathDefs::GetDocs().ToString()+L"/debugger.txt"; + wxTextFile file(fileName); + if (file.Open()) + { + wxString text = file.GetFirstLine(); + while (!file.Eof()) + { + text += file.GetNextLine()+L"\r\n"; + } + + textControl->SetLabel(text); + textControl->SetSelection(0,0); + } + + sizer->Add(textControl,1,wxEXPAND); + SetSizerAndFit(sizer); +} + + CpuTabPage::CpuTabPage(wxWindow* parent, DebugInterface* _cpu) : wxPanel(parent), cpu(_cpu) { @@ -99,6 +132,38 @@ DisassemblyDialog::DisassemblyDialog(wxWindow* parent): setDebugMode(true); } +#ifdef WIN32 +WXLRESULT DisassemblyDialog::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) +{ + switch (nMsg) + { + case WM_SHOWWINDOW: + { + WXHWND hwnd = GetHWND(); + + u32 style = GetWindowLong((HWND)hwnd,GWL_STYLE); + style &= ~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX); + SetWindowLong((HWND)hwnd,GWL_STYLE,style); + + u32 exStyle = GetWindowLong((HWND)hwnd,GWL_EXSTYLE); + exStyle |= (WS_EX_CONTEXTHELP); + SetWindowLong((HWND)hwnd,GWL_EXSTYLE,exStyle); + } + break; + case WM_SYSCOMMAND: + if (wParam == SC_CONTEXTHELP) + { + DebuggerHelpDialog help(this); + help.ShowModal(); + return 0; + } + break; + } + + return wxFrame::MSWWindowProc(nMsg,wParam,lParam); +} +#endif + void DisassemblyDialog::onBreakRunClicked(wxCommandEvent& evt) { if (r5900Debug.isCpuPaused()) diff --git a/pcsx2/gui/Debugger/DisassemblyDialog.h b/pcsx2/gui/Debugger/DisassemblyDialog.h index 60b6adff2b..7a04a4ccc9 100644 --- a/pcsx2/gui/Debugger/DisassemblyDialog.h +++ b/pcsx2/gui/Debugger/DisassemblyDialog.h @@ -8,6 +8,12 @@ #include "CtrlMemView.h" #include "DebugEvents.h" +class DebuggerHelpDialog: public wxDialog +{ +public: + DebuggerHelpDialog(wxWindow* parent); +}; + class CpuTabPage: public wxPanel { public: @@ -37,6 +43,10 @@ public: void update(); void reset(); void setDebugMode(bool debugMode); + +#ifdef WIN32 + WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam); +#endif DECLARE_EVENT_TABLE() protected: