completed change tracking on RIOT tab (except for controllers).

This commit is contained in:
thrust26 2017-12-20 10:01:44 +01:00
parent d3575f3290
commit 90733875b2
6 changed files with 27 additions and 15 deletions

View File

@ -54,6 +54,9 @@ const DebuggerState& RiotDebug::getState()
myState.INPT4 = inpt(4); myState.INPT4 = inpt(4);
myState.INPT5 = inpt(5); myState.INPT5 = inpt(5);
myState.INPTLatch = vblank(6);
myState.INPTDump = vblank(7);
// Timer registers // Timer registers
myState.TIM1T = tim1T(); myState.TIM1T = tim1T();
myState.TIM8T = tim8T(); myState.TIM8T = tim8T();
@ -92,6 +95,9 @@ void RiotDebug::saveOldState()
myOldState.INPT4 = inpt(4); myOldState.INPT4 = inpt(4);
myOldState.INPT5 = inpt(5); myOldState.INPT5 = inpt(5);
myOldState.INPTLatch = vblank(6);
myOldState.INPTDump = vblank(7);
// Timer registers // Timer registers
myOldState.TIM1T = tim1T(); myOldState.TIM1T = tim1T();
myOldState.TIM8T = tim8T(); myOldState.TIM8T = tim8T();

View File

@ -40,6 +40,7 @@ class RiotState : public DebuggerState
// These are actually from the TIA, but are I/O related // These are actually from the TIA, but are I/O related
uInt8 INPT0, INPT1, INPT2, INPT3, INPT4, INPT5; uInt8 INPT0, INPT1, INPT2, INPT3, INPT4, INPT5;
bool INPTLatch, INPTDump;
}; };
class RiotDebug : public DebuggerSystem class RiotDebug : public DebuggerSystem

View File

@ -288,8 +288,8 @@ void RiotWidget::loadConfig()
myRightINPT->setList(alist, vlist, changed); myRightINPT->setList(alist, vlist, changed);
// Update TIA VBLANK bits // Update TIA VBLANK bits
myINPTLatch->setState(riot.vblank(6)); myINPTLatch->setState(riot.vblank(6), state.INPTLatch != oldstate.INPTLatch);
myINPTDump->setState(riot.vblank(7)); myINPTDump->setState(riot.vblank(7), state.INPTDump != oldstate.INPTDump);
// Update timer write registers // Update timer write registers
alist.clear(); vlist.clear(); changed.clear(); alist.clear(); vlist.clear(); changed.clear();
@ -317,16 +317,17 @@ void RiotWidget::loadConfig()
// Console switches (inverted, since 'selected' in the UI // Console switches (inverted, since 'selected' in the UI
// means 'grounded' in the system) // means 'grounded' in the system)
myP0Diff->setSelectedIndex(riot.diffP0()); myP0Diff->setSelectedIndex(riot.diffP0(), state.swchbReadBits[1] != oldstate.swchbReadBits[1]);
myP1Diff->setSelectedIndex(riot.diffP1()); myP1Diff->setSelectedIndex(riot.diffP1(), state.swchbReadBits[0] != oldstate.swchbReadBits[0]);
bool devSettings = instance().settings().getBool("dev.settings"); bool devSettings = instance().settings().getBool("dev.settings");
myConsole->setText(instance().settings().getString(devSettings ? "dev.console" : "plr.console") == "7800" ? "Atari 7800" : "Atari 2600"); myConsole->setText(instance().settings().getString(devSettings ? "dev.console" : "plr.console") == "7800" ? "Atari 7800" : "Atari 2600");
myConsole->setEditable(false, true); myConsole->setEditable(false, true);
myTVType->setSelectedIndex(riot.tvType()); myTVType->setSelectedIndex(riot.tvType(), state.swchbReadBits[4] != oldstate.swchbReadBits[4]);
mySelect->setState(!riot.select()); myPause->setState(!riot.tvType(), state.swchbReadBits[4] != oldstate.swchbReadBits[4]);
myReset->setState(!riot.reset()); mySelect->setState(!riot.select(), state.swchbReadBits[6] != oldstate.swchbReadBits[6]);
myReset->setState(!riot.reset(), state.swchbReadBits[7] != oldstate.swchbReadBits[7]);
myLeftControl->loadConfig(); myLeftControl->loadConfig();
myRightControl->loadConfig(); myRightControl->loadConfig();

View File

@ -55,7 +55,8 @@ PopUpWidget::PopUpWidget(GuiObject* boss, const GUI::Font& font,
: Widget(boss, font, x, y - 1, w, h + 2), : Widget(boss, font, x, y - 1, w, h + 2),
CommandSender(boss), CommandSender(boss),
_label(label), _label(label),
_labelWidth(labelWidth) _labelWidth(labelWidth),
_changed(false)
{ {
_flags = WIDGET_ENABLED | WIDGET_RETAIN_FOCUS; _flags = WIDGET_ENABLED | WIDGET_RETAIN_FOCUS;
_bgcolor = kDlgColor; _bgcolor = kDlgColor;
@ -92,8 +93,9 @@ void PopUpWidget::setSelected(const Variant& tag, const Variant& def)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void PopUpWidget::setSelectedIndex(int idx) void PopUpWidget::setSelectedIndex(int idx, bool changed)
{ {
_changed = changed;
myMenu->setSelectedIndex(idx); myMenu->setSelectedIndex(idx);
} }
@ -231,7 +233,7 @@ void PopUpWidget::drawWidget(bool hilite)
s.vLine(x + w - 1, _y, _y +_h - 1, kShadowColor); s.vLine(x + w - 1, _y, _y +_h - 1, kShadowColor);
// Fill the background // Fill the background
s.fillRect(x + 1, _y + 1, w - 2, _h - 2, kWidColor); s.fillRect(x + 1, _y + 1, w - 2, _h - 2, _changed ? kDbgChangedColor : kWidColor);
// Draw an arrow pointing down at the right end to signal this is a dropdown/popup // Draw an arrow pointing down at the right end to signal this is a dropdown/popup
s.drawBitmap(up_down_arrows, x + w - 10, _y + myArrowsY, s.drawBitmap(up_down_arrows, x + w - 10, _y + myArrowsY,
!isEnabled() ? kColor : hilite ? kTextColorHi : kTextColor); !isEnabled() ? kColor : hilite ? kTextColorHi : kTextColor);

View File

@ -50,7 +50,7 @@ class PopUpWidget : public Widget, public CommandSender
See ContextMenu.hxx for more information. */ See ContextMenu.hxx for more information. */
void setSelected(const Variant& tag, void setSelected(const Variant& tag,
const Variant& def = EmptyVariant); const Variant& def = EmptyVariant);
void setSelectedIndex(int idx); void setSelectedIndex(int idx, bool changed = false);
void setSelectedMax(); void setSelectedMax();
void clearSelection(); void clearSelection();
@ -78,6 +78,7 @@ class PopUpWidget : public Widget, public CommandSender
string _label; string _label;
int _labelWidth; int _labelWidth;
bool _changed;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported

View File

@ -653,17 +653,18 @@ void CheckboxWidget::drawWidget(bool hilite)
if(_drawBox) if(_drawBox)
s.box(_x, _y + _boxY, 14, 14, kColor, kShadowColor); s.box(_x, _y + _boxY, 14, 14, kColor, kShadowColor);
// Do we draw a square or cross? // Do we draw a square or cross?
s.fillRect(_x + 2, _y + _boxY + 2, 10, 10, _changed ? kDbgChangedColor : isEnabled() ? _bgcolor : kColor); s.fillRect(_x + 2, _y + _boxY + 2, 10, 10, _changed ? kDbgChangedColor
: isEnabled() ? _bgcolor : kColor);
if(_state) if(_state)
s.drawBitmap(_img, _x + 3, _y + _boxY + 3, isEnabled() ? kCheckColor : kShadowColor); s.drawBitmap(_img, _x + 3, _y + _boxY + 3, isEnabled() ? kCheckColor : kShadowColor);
#else #else
if(_drawBox) if(_drawBox)
s.frameRect(_x, _y + _boxY, 14, 14, hilite ? kScrollColorHi : kShadowColor); s.frameRect(_x, _y + _boxY, 14, 14, hilite ? kScrollColorHi : kShadowColor);
// Do we draw a square or cross? // Do we draw a square or cross?
s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? kDbgChangedColor : isEnabled() ? _bgcolor : kColor); s.fillRect(_x + 1, _y + _boxY + 1, 12, 12, _changed ? kDbgChangedColor
: isEnabled() ? _bgcolor : kColor);
if(_state) if(_state)
s.drawBitmap(_img, _x + 2, _y + _boxY + 2, isEnabled() s.drawBitmap(_img, _x + 2, _y + _boxY + 2, isEnabled() ? hilite ? kScrollColorHi : kCheckColor
? hilite ? kScrollColorHi : kCheckColor
: kShadowColor, 10); : kShadowColor, 10);
#endif #endif