made changes in controller widgets and switches highlighted in SWCHA(R)/SWCHB(R)

made SWCHB(R) editable in debugger
This commit is contained in:
Thomas Jentzsch 2020-09-05 16:16:12 +02:00
parent 507a367ced
commit 146fe3783c
3 changed files with 19 additions and 6 deletions

View File

@ -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);

View File

@ -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<const char*, 4> 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;
}

View File

@ -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: