From d3b50b51943cdb4bd0d23b08151fd1b46609fa6e Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Tue, 4 Apr 2017 17:38:45 -0230 Subject: [PATCH] Fixed some minor issues with DelayQueueWidget. - Removed redundant code to get TIA write address labels - Added '$' to indicate hex output - Added newlines to affected files. --- src/debugger/gui/DelayQueueWidget.cxx | 156 ++----------------------- src/debugger/gui/DelayQueueWidget.hxx | 9 +- src/emucore/tia/DelayQueueIterator.cxx | 2 +- src/emucore/tia/DelayQueueIterator.hxx | 6 +- 4 files changed, 12 insertions(+), 161 deletions(-) diff --git a/src/debugger/gui/DelayQueueWidget.cxx b/src/debugger/gui/DelayQueueWidget.cxx index 098d7d8fe..2658405a8 100644 --- a/src/debugger/gui/DelayQueueWidget.cxx +++ b/src/debugger/gui/DelayQueueWidget.cxx @@ -22,149 +22,6 @@ #include "Debugger.hxx" #include "Base.hxx" -static const string formatRegister(uInt8 address) -{ - switch (address) { - case WSYNC: - return "WSYNC"; - - case RSYNC: - return "RSYNC"; - - case VSYNC: - return "VSYNC"; - - case VBLANK: - return "VBLANK"; - - case AUDV0: - return "AUDV0"; - - case AUDV1: - return "AUDV1"; - - case AUDF0: - return "AUDF0"; - - case AUDF1: - return "AUDF1"; - - case AUDC0: - return "AUDC0"; - - case AUDC1: - return "AUDC1"; - - case HMOVE: - return "HMOVE"; - - case COLUBK: - return "COLUBK"; - - case COLUP0: - return "COLUP0"; - - case COLUP1: - return "COLUP1"; - - case COLUPF: - return "COLUPF"; - - case CTRLPF: - return "CTRLPF"; - - case PF0: - return "PF0"; - - case PF1: - return "PF1"; - - case PF2: - return "PF2"; - - case ENAM0: - return "ENAM0"; - - case ENAM1: - return "ENAM1"; - - case RESM0: - return "RESM0"; - - case RESM1: - return "RESM1"; - - case RESMP0: - return "RESMP0"; - - case RESMP1: - return "RESMP1"; - - case RESP0: - return "RESP0"; - - case RESP1: - return "RESP1"; - - case RESBL: - return "RESBL"; - - case NUSIZ0: - return "NUSIZ0"; - - case NUSIZ1: - return "NUSIZ1"; - - case HMM0: - return "HMM0"; - - case HMM1: - return "HMM1"; - - case HMP0: - return "HMP0"; - - case HMP1: - return "HMP1"; - - case HMBL: - return "HMBL"; - - case HMCLR: - return "HMCLR"; - - case GRP0: - return "GRP0"; - - case GRP1: - return "GRP1"; - - case REFP0: - return "REFP0"; - - case REFP1: - return "REFP1"; - - case VDELP0: - return "VDELP0"; - - case VDELP1: - return "VDELP1"; - - case VDELBL: - return "VDELBL"; - - case ENABL: - return "ENABL"; - - case CXCLR: - return "CXCLR"; - - default: - return Common::Base::toString(address, Common::Base::Format::F_16_2); - } -} - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DelayQueueWidget::DelayQueueWidget( GuiObject* boss, @@ -182,18 +39,21 @@ DelayQueueWidget::DelayQueueWidget( // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void DelayQueueWidget::loadConfig() { - shared_ptr delayQueueIterator = instance().debugger().tiaDebug().delayQueueIterator(); + shared_ptr delayQueueIterator = + instance().debugger().tiaDebug().delayQueueIterator(); + using Common::Base; for (uInt8 i = 0; i < 3; i++) { if (delayQueueIterator->isValid() && delayQueueIterator->address() < 64) { stringstream ss; ss << int(delayQueueIterator->delay()) - << " clk, " - << Common::Base::toString(delayQueueIterator->value(), Common::Base::Format::F_16_2) + << " clk, $" + << Base::toString(delayQueueIterator->value(), Base::Format::F_16_2) << " -> " - << formatRegister(delayQueueIterator->address()); + << instance().debugger().cartDebug().getLabel( + delayQueueIterator->address(), false); myLines[i] = ss.str(); delayQueueIterator->next(); @@ -230,4 +90,4 @@ void DelayQueueWidget::drawWidget(bool hilite) y += lineHeight; surface.drawString(_font, myLines[2], x, y, w, _textcolor); -} \ No newline at end of file +} diff --git a/src/debugger/gui/DelayQueueWidget.hxx b/src/debugger/gui/DelayQueueWidget.hxx index 98cad3273..c405ca02d 100644 --- a/src/debugger/gui/DelayQueueWidget.hxx +++ b/src/debugger/gui/DelayQueueWidget.hxx @@ -22,33 +22,28 @@ class DelayQueueWidget : public Widget { - public: - DelayQueueWidget( GuiObject* boss, const GUI::Font& font, int x, int y ); + virtual ~DelayQueueWidget() = default; void loadConfig() override; protected: - void drawWidget(bool hilite) override; private: - string myLines[3]; private: - DelayQueueWidget() = delete; DelayQueueWidget(const DelayQueueWidget&) = delete; DelayQueueWidget(DelayQueueWidget&&) = delete; DelayQueueWidget& operator=(const DelayQueueWidget&); DelayQueueWidget& operator=(DelayQueueWidget&&); - }; -#endif // DELAY_QUEUE_WIDGET_HXX \ No newline at end of file +#endif // DELAY_QUEUE_WIDGET_HXX diff --git a/src/emucore/tia/DelayQueueIterator.cxx b/src/emucore/tia/DelayQueueIterator.cxx index 96e300f01..65c393efe 100644 --- a/src/emucore/tia/DelayQueueIterator.cxx +++ b/src/emucore/tia/DelayQueueIterator.cxx @@ -91,4 +91,4 @@ bool DelayQueueIterator::next() } return isValid(); -} \ No newline at end of file +} diff --git a/src/emucore/tia/DelayQueueIterator.hxx b/src/emucore/tia/DelayQueueIterator.hxx index 5b72c4f6a..481e66c49 100644 --- a/src/emucore/tia/DelayQueueIterator.hxx +++ b/src/emucore/tia/DelayQueueIterator.hxx @@ -25,7 +25,6 @@ class DelayQueueIterator { public: - DelayQueueIterator(const DelayQueue&); bool isValid() const; @@ -39,18 +38,15 @@ class DelayQueueIterator bool next(); private: - uInt8 currentIndex() const { return (myDelayQueue.myIndex + myDelayCycle) % myDelayQueue.myMembers.size(); } private: - const DelayQueue& myDelayQueue; uInt8 myDelayCycle; - DelayQueueMember::iterator myCurrentIterator; }; -#endif // TIA_DELAY_QUEUE_ITERATOR \ No newline at end of file +#endif // TIA_DELAY_QUEUE_ITERATOR