change tracking for TiaInfoWidget added

This commit is contained in:
thrust26 2017-12-19 19:22:29 +01:00
parent e9ef45ab0a
commit d3575f3290
5 changed files with 45 additions and 14 deletions

View File

@ -108,6 +108,16 @@ const DebuggerState& TIADebug::getState()
myState.aud.push_back(audV0()); myState.aud.push_back(audV0());
myState.aud.push_back(audV1()); myState.aud.push_back(audV1());
// internal TIA state
myState.info.clear();
myState.info.push_back(frameCount());
myState.info.push_back(frameCycles());
myState.info.push_back(vsyncAsInt());
myState.info.push_back(vblankAsInt());
myState.info.push_back(scanlines());
myState.info.push_back(scanlinesLastFrame());
myState.info.push_back(clocksThisLine());
return myState; return myState;
} }
@ -168,6 +178,16 @@ void TIADebug::saveOldState()
myOldState.aud.push_back(audC1()); myOldState.aud.push_back(audC1());
myOldState.aud.push_back(audV0()); myOldState.aud.push_back(audV0());
myOldState.aud.push_back(audV1()); myOldState.aud.push_back(audV1());
// internal TIA state
myOldState.info.clear();
myOldState.info.push_back(frameCount());
myOldState.info.push_back(frameCycles());
myOldState.info.push_back(vsyncAsInt());
myOldState.info.push_back(vblankAsInt());
myOldState.info.push_back(scanlines());
myOldState.info.push_back(scanlinesLastFrame());
myOldState.info.push_back(clocksThisLine());
} }
/* the set methods now use mySystem.poke(). This will save us the /* the set methods now use mySystem.poke(). This will save us the

View File

@ -45,6 +45,7 @@ class TiaState : public DebuggerState
IntArray pf; IntArray pf;
IntArray size; IntArray size;
IntArray aud; IntArray aud;
IntArray info;
}; };
class TIADebug : public DebuggerSystem class TIADebug : public DebuggerSystem

View File

@ -127,19 +127,26 @@ void TiaInfoWidget::loadConfig()
{ {
Debugger& dbg = instance().debugger(); Debugger& dbg = instance().debugger();
TIADebug& tia = dbg.tiaDebug(); TIADebug& tia = dbg.tiaDebug();
const TiaState& oldTia = static_cast<const TiaState&>(tia.getOldState());
myFrameCount->setText(" " + Common::Base::toString(tia.frameCount(), Common::Base::F_10)); myFrameCount->setText(" " + Common::Base::toString(tia.frameCount(), Common::Base::F_10),
myFrameCycles->setText(" " + Common::Base::toString(tia.frameCycles(), Common::Base::F_10)); tia.frameCount() != oldTia.info[0]);
myFrameCycles->setText(" " + Common::Base::toString(tia.frameCycles(), Common::Base::F_10),
tia.frameCycles() != oldTia.info[1]);
myVSync->setState(tia.vsync()); myVSync->setState(tia.vsync(), tia.vsyncAsInt() != oldTia.info[2]);
myVBlank->setState(tia.vblank()); myVBlank->setState(tia.vblank(), tia.vblankAsInt() != oldTia.info[3]);
int clk = tia.clocksThisLine(); int clk = tia.clocksThisLine();
myScanlineCount->setText( myScanlineCount->setText(Common::Base::toString(tia.scanlines(), Common::Base::F_10),
Common::Base::toString(tia.scanlines(), Common::Base::F_10)); tia.scanlines() != oldTia.info[4]);
myScanlineCountLast->setText( myScanlineCountLast->setText(
Common::Base::toString(tia.scanlinesLastFrame(), Common::Base::F_10)); Common::Base::toString(tia.scanlinesLastFrame(), Common::Base::F_10),
myScanlineCycles->setText(Common::Base::toString(clk/3, Common::Base::F_10)); tia.scanlinesLastFrame() != oldTia.info[5]);
myPixelPosition->setText(Common::Base::toString(clk-68, Common::Base::F_10)); myScanlineCycles->setText(Common::Base::toString(clk/3, Common::Base::F_10),
myColorClocks->setText(Common::Base::toString(clk, Common::Base::F_10)); clk != oldTia.info[6]);
myPixelPosition->setText(Common::Base::toString(clk-68, Common::Base::F_10),
clk != oldTia.info[6]);
myColorClocks->setText(Common::Base::toString(clk, Common::Base::F_10),
clk != oldTia.info[6]);
} }

View File

@ -544,6 +544,7 @@ CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font,
_state(false), _state(false),
_holdFocus(true), _holdFocus(true),
_drawBox(true), _drawBox(true),
_changed(false),
_fillColor(kColor), _fillColor(kColor),
_boxY(0), _boxY(0),
_textY(0) _textY(0)
@ -632,13 +633,14 @@ void CheckboxWidget::setFill(FillType type)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void CheckboxWidget::setState(bool state) void CheckboxWidget::setState(bool state, bool changed)
{ {
if(_state != state) if(_state != state)
{ {
_state = state; _state = state;
setDirty(); setDirty();
} }
_changed = changed;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -651,14 +653,14 @@ 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, 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, 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

View File

@ -263,7 +263,7 @@ class CheckboxWidget : public ButtonWidget
void setEditable(bool editable); void setEditable(bool editable);
void setFill(FillType type); void setFill(FillType type);
void setState(bool state); void setState(bool state, bool changed = false);
void toggleState() { setState(!_state); } void toggleState() { setState(!_state); }
bool getState() const { return _state; } bool getState() const { return _state; }
@ -280,6 +280,7 @@ class CheckboxWidget : public ButtonWidget
bool _state; bool _state;
bool _holdFocus; bool _holdFocus;
bool _drawBox; bool _drawBox;
bool _changed;
uInt32* _img; uInt32* _img;
uInt32 _fillColor; uInt32 _fillColor;