mirror of https://github.com/stella-emu/stella.git
change tracking for TiaInfoWidget added
This commit is contained in:
parent
e9ef45ab0a
commit
d3575f3290
|
@ -108,6 +108,16 @@ const DebuggerState& TIADebug::getState()
|
|||
myState.aud.push_back(audV0());
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -168,6 +178,16 @@ void TIADebug::saveOldState()
|
|||
myOldState.aud.push_back(audC1());
|
||||
myOldState.aud.push_back(audV0());
|
||||
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
|
||||
|
|
|
@ -45,6 +45,7 @@ class TiaState : public DebuggerState
|
|||
IntArray pf;
|
||||
IntArray size;
|
||||
IntArray aud;
|
||||
IntArray info;
|
||||
};
|
||||
|
||||
class TIADebug : public DebuggerSystem
|
||||
|
|
|
@ -127,19 +127,26 @@ void TiaInfoWidget::loadConfig()
|
|||
{
|
||||
Debugger& dbg = instance().debugger();
|
||||
TIADebug& tia = dbg.tiaDebug();
|
||||
const TiaState& oldTia = static_cast<const TiaState&>(tia.getOldState());
|
||||
|
||||
myFrameCount->setText(" " + Common::Base::toString(tia.frameCount(), Common::Base::F_10));
|
||||
myFrameCycles->setText(" " + Common::Base::toString(tia.frameCycles(), Common::Base::F_10));
|
||||
myFrameCount->setText(" " + Common::Base::toString(tia.frameCount(), 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());
|
||||
myVBlank->setState(tia.vblank());
|
||||
myVSync->setState(tia.vsync(), tia.vsyncAsInt() != oldTia.info[2]);
|
||||
myVBlank->setState(tia.vblank(), tia.vblankAsInt() != oldTia.info[3]);
|
||||
|
||||
int clk = tia.clocksThisLine();
|
||||
myScanlineCount->setText(
|
||||
Common::Base::toString(tia.scanlines(), Common::Base::F_10));
|
||||
myScanlineCount->setText(Common::Base::toString(tia.scanlines(), Common::Base::F_10),
|
||||
tia.scanlines() != oldTia.info[4]);
|
||||
myScanlineCountLast->setText(
|
||||
Common::Base::toString(tia.scanlinesLastFrame(), Common::Base::F_10));
|
||||
myScanlineCycles->setText(Common::Base::toString(clk/3, Common::Base::F_10));
|
||||
myPixelPosition->setText(Common::Base::toString(clk-68, Common::Base::F_10));
|
||||
myColorClocks->setText(Common::Base::toString(clk, Common::Base::F_10));
|
||||
Common::Base::toString(tia.scanlinesLastFrame(), Common::Base::F_10),
|
||||
tia.scanlinesLastFrame() != oldTia.info[5]);
|
||||
myScanlineCycles->setText(Common::Base::toString(clk/3, 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]);
|
||||
}
|
||||
|
|
|
@ -544,6 +544,7 @@ CheckboxWidget::CheckboxWidget(GuiObject* boss, const GUI::Font& font,
|
|||
_state(false),
|
||||
_holdFocus(true),
|
||||
_drawBox(true),
|
||||
_changed(false),
|
||||
_fillColor(kColor),
|
||||
_boxY(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)
|
||||
{
|
||||
_state = state;
|
||||
setDirty();
|
||||
}
|
||||
_changed = changed;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -651,14 +653,14 @@ void CheckboxWidget::drawWidget(bool hilite)
|
|||
if(_drawBox)
|
||||
s.box(_x, _y + _boxY, 14, 14, kColor, kShadowColor);
|
||||
// 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)
|
||||
s.drawBitmap(_img, _x + 3, _y + _boxY + 3, isEnabled() ? kCheckColor : kShadowColor);
|
||||
#else
|
||||
if(_drawBox)
|
||||
s.frameRect(_x, _y + _boxY, 14, 14, hilite ? kScrollColorHi : kShadowColor);
|
||||
// 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)
|
||||
s.drawBitmap(_img, _x + 2, _y + _boxY + 2, isEnabled()
|
||||
? hilite ? kScrollColorHi : kCheckColor
|
||||
|
|
|
@ -263,7 +263,7 @@ class CheckboxWidget : public ButtonWidget
|
|||
void setEditable(bool editable);
|
||||
void setFill(FillType type);
|
||||
|
||||
void setState(bool state);
|
||||
void setState(bool state, bool changed = false);
|
||||
void toggleState() { setState(!_state); }
|
||||
bool getState() const { return _state; }
|
||||
|
||||
|
@ -280,6 +280,7 @@ class CheckboxWidget : public ButtonWidget
|
|||
bool _state;
|
||||
bool _holdFocus;
|
||||
bool _drawBox;
|
||||
bool _changed;
|
||||
|
||||
uInt32* _img;
|
||||
uInt32 _fillColor;
|
||||
|
|
Loading…
Reference in New Issue