From 146fe3783c567a3b902c1dd984a5ed1e6c9d3ed2 Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Sat, 5 Sep 2020 16:16:12 +0200 Subject: [PATCH] made changes in controller widgets and switches highlighted in SWCHA(R)/SWCHB(R) made SWCHB(R) editable in debugger --- src/debugger/RiotDebug.cxx | 10 ++++++---- src/debugger/gui/RiotWidget.cxx | 13 ++++++++++++- src/debugger/gui/RiotWidget.hxx | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/debugger/RiotDebug.cxx b/src/debugger/RiotDebug.cxx index 0a71c6d92..4484944aa 100644 --- a/src/debugger/RiotDebug.cxx +++ b/src/debugger/RiotDebug.cxx @@ -75,10 +75,11 @@ const DebuggerState& RiotDebug::getState() void RiotDebug::saveOldState() { // Port A & B registers - myOldState.SWCHA_R = swcha(); + // read from myState where other widgets can update pins directly + myOldState.SWCHA_R = myState.SWCHA_R; // swcha(); myOldState.SWCHA_W = mySystem.m6532().myOutA; myOldState.SWACNT = swacnt(); - myOldState.SWCHB_R = swchb(); + myOldState.SWCHB_R = myState.SWCHB_R; // swchb(); myOldState.SWCHB_W = mySystem.m6532().myOutB; myOldState.SWBCNT = swbcnt(); Debugger::set_bits(myOldState.SWCHA_R, myOldState.swchaReadBits); @@ -93,8 +94,9 @@ void RiotDebug::saveOldState() myOldState.INPT1 = inpt(1); myOldState.INPT2 = inpt(2); myOldState.INPT3 = inpt(3); - myOldState.INPT4 = inpt(4); - myOldState.INPT5 = inpt(5); + // read from myState where other widgets can update pins directly + myOldState.INPT4 = myState.INPT4; // inpt(4); + myOldState.INPT5 = myState.INPT5; // inpt(5); myOldState.INPTLatch = vblank(6); myOldState.INPTDump = vblank(7); diff --git a/src/debugger/gui/RiotWidget.cxx b/src/debugger/gui/RiotWidget.cxx index e1b5bf415..171da0cd6 100644 --- a/src/debugger/gui/RiotWidget.cxx +++ b/src/debugger/gui/RiotWidget.cxx @@ -99,7 +99,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont, // SWCHB bits in 'peek' mode xpos = 10; ypos += lineHeight + 5; - CREATE_IO_REGS("SWCHB(R)", mySWCHBReadBits, 0, false) + CREATE_IO_REGS("SWCHB(R)", mySWCHBReadBits, kSWCHBRBitsID, true) // Timer registers (R/W) static constexpr std::array writeNames = { @@ -418,6 +418,17 @@ void RiotWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) rport.setPin(Controller::DigitalPin::Four, value & 0b00001000); break; } + case kSWCHBRBitsID: + { + value = Debugger::get_bits(mySWCHBReadBits->getState()); + + riot.reset( value & 0b00000001); + riot.select(value & 0b00000010); + riot.tvType(value & 0b00001000); + riot.diffP0(value & 0b01000000); + riot.diffP1(value & 0b10000000); + break; + } default: break; } diff --git a/src/debugger/gui/RiotWidget.hxx b/src/debugger/gui/RiotWidget.hxx index fdfd699ef..dfbe16ce2 100644 --- a/src/debugger/gui/RiotWidget.hxx +++ b/src/debugger/gui/RiotWidget.hxx @@ -76,7 +76,7 @@ class RiotWidget : public Widget, public CommandSender kTim1TID, kTim8TID, kTim64TID, kTim1024TID, kTimWriteID, kSWCHABitsID, kSWACNTBitsID, kSWCHBBitsID, kSWBCNTBitsID, kP0DiffChanged, kP1DiffChanged, kTVTypeChanged, kSelectID, kResetID, - kSWCHARBitsID, kPauseID + kSWCHARBitsID, kSWCHBRBitsID, kPauseID }; private: