From d3166fee1dd2e06f0e4080711b0355b8639b0cd7 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 19 Apr 2021 21:38:36 +0200 Subject: [PATCH] added some more debugger help links --- src/debugger/gui/CartRamWidget.cxx | 2 +- src/debugger/gui/CpuWidget.cxx | 3 +++ src/debugger/gui/DebuggerDialog.cxx | 10 ++++++++-- src/debugger/gui/RamWidget.cxx | 12 +++++++++++- src/debugger/gui/RamWidget.hxx | 3 ++- src/debugger/gui/RiotRamWidget.cxx | 3 ++- 6 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/debugger/gui/CartRamWidget.cxx b/src/debugger/gui/CartRamWidget.cxx index dbe7db89b..0202fc72d 100644 --- a/src/debugger/gui/CartRamWidget.cxx +++ b/src/debugger/gui/CartRamWidget.cxx @@ -117,7 +117,7 @@ CartRamWidget::InternalRamWidget::InternalRamWidget(GuiObject* boss, CartDebugWidget& dbg) : RamWidget(boss, lfont, nfont, x, y, w, h, dbg.internalRamSize(), std::min(dbg.internalRamSize() / 16, 16U), - std::min(dbg.internalRamSize() / 16, 16U) * 16), + std::min(dbg.internalRamSize() / 16, 16U) * 16, "CartridgeRAMInformation"), myCart(dbg) { } diff --git a/src/debugger/gui/CpuWidget.cxx b/src/debugger/gui/CpuWidget.cxx index 00a8d83f6..cb1a5a9cc 100644 --- a/src/debugger/gui/CpuWidget.cxx +++ b/src/debugger/gui/CpuWidget.cxx @@ -48,6 +48,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n "PC ", TextAlign::Left); myPCGrid = new DataGridWidget(boss, nfont, xpos + lwidth, ypos, 1, 1, 4, 16, Common::Base::Fmt::_16); + myPCGrid->setHelpAnchor("CPURegisters", true); myPCGrid->setTarget(this); myPCGrid->setID(kPCRegID); addFocusWidget(myPCGrid); @@ -79,6 +80,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n xpos = myCpuGridDecValue->getRight() + fontWidth * 2; myCpuGridBinValue = new DataGridWidget(boss, nfont, xpos, ypos, 1, 4, 8, 8, Common::Base::Fmt::_2); + myCpuGridBinValue->setHelpAnchor("CPURegisters", true); myCpuGridBinValue->setTarget(this); myCpuGridBinValue->setID(kCpuRegBinID); addFocusWidget(myCpuGridBinValue); @@ -123,6 +125,7 @@ CpuWidget::CpuWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n new StaticTextWidget(boss, lfont, xpos, ypos + 2, lwidth-2, fontHeight, "PS ", TextAlign::Left); myPSRegister = new ToggleBitWidget(boss, nfont, xpos+lwidth, ypos, 8, 1); + myPSRegister->setHelpAnchor("CPURegisters", true); myPSRegister->setTarget(this); addFocusWidget(myPSRegister); diff --git a/src/debugger/gui/DebuggerDialog.cxx b/src/debugger/gui/DebuggerDialog.cxx index 7a442e5b7..c1a746340 100644 --- a/src/debugger/gui/DebuggerDialog.cxx +++ b/src/debugger/gui/DebuggerDialog.cxx @@ -540,22 +540,27 @@ void DebuggerDialog::addRomArea() b = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, "Step", kDDStepCmd, true); + b->setHelpAnchor("GlobalButtons", true); wid2.push_back(b); buttonY += bheight + 4; b = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, "Trace", kDDTraceCmd, true); + b->setHelpAnchor("GlobalButtons", true); wid2.push_back(b); buttonY += bheight + 4; b = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, "Scan +1", kDDSAdvCmd, true); + b->setHelpAnchor("GlobalButtons", true); wid2.push_back(b); buttonY += bheight + 4; b = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, "Frame +1", kDDAdvCmd, true); + b->setHelpAnchor("GlobalButtons", true); wid2.push_back(b); buttonY += bheight + 4; b = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, "Run", kDDRunCmd); + b->setHelpAnchor("GlobalButtons", true); wid2.push_back(b); addCancelWidget(b); @@ -567,6 +572,7 @@ void DebuggerDialog::addRomArea() myRewindButton = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, LEFT_ARROW.data(), 7, 11, kDDRewindCmd, true); + myRewindButton->setHelpAnchor("GlobalButtons", true); myRewindButton->clearFlags(Widget::FLAG_ENABLED); buttonY += bheight + 4; @@ -575,6 +581,7 @@ void DebuggerDialog::addRomArea() myUnwindButton = new ButtonWidget(this, *myLFont, buttonX, buttonY, bwidth, bheight, RIGHT_ARROW.data(), 7, 11, kDDUnwindCmd, true); + myUnwindButton->setHelpAnchor("GlobalButtons", true); myUnwindButton->clearFlags(Widget::FLAG_ENABLED); int xpos = buttonX - 8*myLFont->getMaxCharWidth() - 20, ypos = 30; @@ -632,8 +639,7 @@ void DebuggerDialog::addRomArea() addToFocusList(myRom->getFocusList(), myRomTab, tabID); // The 'cart-specific' information tab (optional) - - tabID = myRomTab->addTab(" " + instance().console().cartridge().name() + " ", TabWidget::AUTO_WIDTH); + tabID = myRomTab->addTab(" " + instance().console().cartridge().name() + " ", TabWidget::AUTO_WIDTH); myCartInfo = instance().console().cartridge().infoWidget( myRomTab, *myLFont, *myNFont, 2, 2, tabWidth - 1, tabHeight - myRomTab->getTabHeight() - 2); diff --git a/src/debugger/gui/RamWidget.cxx b/src/debugger/gui/RamWidget.cxx index e1cf5ebc1..c5e418fe1 100644 --- a/src/debugger/gui/RamWidget.cxx +++ b/src/debugger/gui/RamWidget.cxx @@ -30,7 +30,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h, - uInt32 ramsize, uInt32 numrows, uInt32 pagesize) + uInt32 ramsize, uInt32 numrows, uInt32 pagesize, + const string& helpAnchor) : Widget(boss, lfont, x, y, w, h), CommandSender(boss), _nfont{nfont}, @@ -56,6 +57,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n bool useScrollbar = ramsize / numrows > 16; myRamGrid = new DataGridRamWidget(_boss, *this, _nfont, xpos, ypos, 16, myNumRows, 2, 8, Common::Base::Fmt::_16, useScrollbar); + myRamGrid->setHelpAnchor(helpAnchor, true); myRamGrid->setTarget(this); myRamGrid->setID(kRamGridID); addFocusWidget(myRamGrid); @@ -66,18 +68,21 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n myUndoButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Undo", kUndoCmd); + myUndoButton->setHelpAnchor("M6532Search", true); wid.push_back(myUndoButton); myUndoButton->setTarget(this); by += bheight + VGAP; myRevertButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Revert", kRevertCmd); + myRevertButton->setHelpAnchor("M6532Search", true); wid.push_back(myRevertButton); myRevertButton->setTarget(this); by += bheight + VGAP * 6; mySearchButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Search" + ELLIPSIS, kSearchCmd); + mySearchButton->setHelpAnchor("M6532Search", true); mySearchButton->setToolTip("Search and highlight found values."); wid.push_back(mySearchButton); mySearchButton->setTarget(this); @@ -85,6 +90,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n by += bheight + VGAP; myCompareButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Compare" + ELLIPSIS, kCmpCmd); + myCompareButton->setHelpAnchor("M6532Search", true); myCompareButton->setToolTip("Compare highlighted values."); wid.push_back(myCompareButton); myCompareButton->setTarget(this); @@ -92,6 +98,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n by += bheight + VGAP; myRestartButton = new ButtonWidget(boss, lfont, bx, by, bwidth, bheight, "Reset", kRestartCmd); + myRestartButton->setHelpAnchor("M6532Search", true); myRestartButton->setToolTip("Reset search/compare mode."); wid.push_back(myRestartButton); myRestartButton->setTarget(this); @@ -135,6 +142,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n s = new StaticTextWidget(boss, lfont, xpos, ypos, "%"); myBinValue = new DataGridWidget(boss, nfont, s->getRight() + myFontWidth * 0.1, ypos-2, 1, 1, 8, 8, Common::Base::Fmt::_2); + myBinValue->setHelpAnchor(helpAnchor, true); myBinValue->setTarget(this); myBinValue->setID(kRamBinID); @@ -143,6 +151,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n s = new StaticTextWidget(boss, lfont, xpos, ypos, "#"); myDecValue = new DataGridWidget(boss, nfont, s->getRight(), ypos-2, 1, 1, 3, 8, Common::Base::Fmt::_10); + myDecValue->setHelpAnchor(helpAnchor, true); myDecValue->setTarget(this); myDecValue->setID(kRamDecID); @@ -150,6 +159,7 @@ RamWidget::RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& n xpos -= 4.5 * myFontWidth; myHexValue = new DataGridWidget(boss, nfont, xpos, ypos - 2, 1, 1, 2, 8, Common::Base::Fmt::_16); + myHexValue->setHelpAnchor(helpAnchor, true); myHexValue->setTarget(this); myHexValue->setID(kRamHexID); diff --git a/src/debugger/gui/RamWidget.hxx b/src/debugger/gui/RamWidget.hxx index eaccb6e6c..f83a62b80 100644 --- a/src/debugger/gui/RamWidget.hxx +++ b/src/debugger/gui/RamWidget.hxx @@ -35,7 +35,8 @@ class RamWidget : public Widget, public CommandSender public: RamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h, - uInt32 ramsize, uInt32 numrows, uInt32 pagesize); + uInt32 ramsize, uInt32 numrows, uInt32 pagesize, + const string& helpAnchor); ~RamWidget() override; void loadConfig() override; diff --git a/src/debugger/gui/RiotRamWidget.cxx b/src/debugger/gui/RiotRamWidget.cxx index 6bbbcc840..74a2e6a35 100644 --- a/src/debugger/gui/RiotRamWidget.cxx +++ b/src/debugger/gui/RiotRamWidget.cxx @@ -24,9 +24,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RiotRamWidget::RiotRamWidget(GuiObject* boss, const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w) - : RamWidget(boss, lfont, nfont, x, y, w, 0, 128, 8, 128), + : RamWidget(boss, lfont, nfont, x, y, w, 0, 128, 8, 128, "M6532"), myDbg{instance().debugger().cartDebug()} { + // setHelpAnchor("M6532"); TODO: does not work due to use of "boss" insted of "this" } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -