Merge branch 'master' of github.com:stella-emu/stella

This commit is contained in:
Stephen Anthony 2021-09-05 17:16:24 -02:30
commit c79dedae98
9 changed files with 55 additions and 13 deletions

View File

@ -770,9 +770,11 @@ that holds 'number of scanlines' on an actual console).</p>
<tr><td> _fTimReadCycles</td><td>Number of cycles used by timer reads since frame started</td></tr>
<tr><td> _fWsyncCycles</td><td>Number of cycles skipped by WSYNC since frame started</td></tr>
<tr><td> _iCycles</td><td> Number of cycles of last instruction</td></tr>
<tr><td> _inTim</td><td> Current INTIM value</td></tr>
<tr><td> _scan</td><td> Current scanLine count</td></tr>
<tr><td> _scanEnd</td><td> Scanline count at end of last frame</td></tr>
<tr><td> _sCycles</td><td> Number of cycles in current scanLine</td></tr>
<tr><td> _timInt</td><td> Current TIMINT value</td></tr>
<tr><td> _timWrapRead</td><td> Timer read wrapped on this cycle</td></tr>
<tr><td> _timWrapWrite</td><td> Timer write wrapped on this cycle</td></tr>
<tr><td> _vBlank</td><td> Whether vertical blank is enabled (1 or 0)</td></tr>

View File

@ -962,7 +962,7 @@ std::array<Debugger::BuiltinFunction, 18> Debugger::ourBuiltinFunctions = { {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Names are defined here, but processed in YaccParser
std::array<Debugger::PseudoRegister, 16> Debugger::ourPseudoRegisters = { {
std::array<Debugger::PseudoRegister, 18> Debugger::ourPseudoRegisters = {{
// Debugger::PseudoRegister Debugger::ourPseudoRegisters[NUM_PSEUDO_REGS] = {
{ "_bank", "Currently selected bank" },
{ "_cClocks", "Color clocks on current scanline" },
@ -973,9 +973,11 @@ std::array<Debugger::PseudoRegister, 16> Debugger::ourPseudoRegisters = { {
{ "_fTimReadCycles","Number of cycles used by timer reads since frame started" },
{ "_fWsyncCycles", "Number of cycles skipped by WSYNC since frame started" },
{ "_iCycles", "Number of cycles of last instruction" },
{ "_inTim", "Curent INTIM value" },
{ "_scan", "Current scanline count" },
{ "_scanEnd", "Scanline count at end of last frame" },
{ "_sCycles", "Number of cycles in current scanline" },
{ "_timInt", "Current TIMINT value" },
{ "_timWrapRead", "Timer read wrapped on this cycle" },
{ "_timWrapWrite", "Timer write wrapped on this cycle" },
{ "_vBlank", "Whether vertical blank is enabled (1 or 0)" },

View File

@ -366,7 +366,7 @@ class Debugger : public DialogContainer
string name, help;
};
static std::array<BuiltinFunction, 18> ourBuiltinFunctions;
static std::array<PseudoRegister, 16> ourPseudoRegisters;
static std::array<PseudoRegister, 18> ourPseudoRegisters;
static constexpr Int8 ANY_BANK = -1;
bool myFirstLog{true};

View File

@ -85,6 +85,8 @@ class RiotDebug : public DebuggerSystem
int timWrappedOnWrite() const;
int timReadCycles() const;
int timintAsInt() const { return int(timint()); } // so we can use _timInt pseudo-register
int intimAsInt() const { return int(intim()); } // so we can use _inTim pseudo-register
/* Console switches */
bool diffP0(int newVal = -1);

View File

@ -81,6 +81,8 @@ const DebuggerState& TIADebug::getState()
myState.gr.push_back(myTIA.myPlayer1.getGRPOld());
myState.gr.push_back(myTIA.myBall.getENABLNew());
myState.gr.push_back(myTIA.myBall.getENABLOld());
myState.gr.push_back(enaM0());
myState.gr.push_back(enaM1());
// Player 0 & 1, Missile 0 & 1 and Ball graphics status registers
myState.ref.clear();
@ -191,6 +193,8 @@ void TIADebug::saveOldState()
myOldState.gr.push_back(myTIA.myPlayer1.getGRPOld());
myOldState.gr.push_back(myTIA.myBall.getENABLNew());
myOldState.gr.push_back(myTIA.myBall.getENABLOld());
myOldState.gr.push_back(enaM0());
myOldState.gr.push_back(enaM1());
// Player 0 & 1, Missile 0 & 1 and Ball graphics status registers
myOldState.ref.clear();
@ -1227,7 +1231,8 @@ string TIADebug::toString()
state.vdel[TiaState::P1] != oldState.vdel[TiaState::P1])
<< endl
<< "M0: "
<< stringOnly(enaM0() ? " ENABLED" : "disabled") << " " // TODO: changed, not tracked?
<< stringOnly(enaM0() ? " ENABLED" : "disabled",
state.gr[6] != oldState.gr[6]) << " "
<< decWithLabel("pos", state.pos[TiaState::M0],
state.pos[TiaState::M0] != oldState.pos[TiaState::M0]) << " "
<< hexWithLabel("HM", state.hm[TiaState::M0],
@ -1237,7 +1242,8 @@ string TIADebug::toString()
<< boolWithLabel("reset", resMP0(), state.resm[TiaState::P0] != oldState.resm[TiaState::P0])
<< endl
<< "M1: "
<< stringOnly(enaM1() ? " ENABLED" : "disabled") << " " // TODO: changed, not tracked?
<< stringOnly(enaM1() ? " ENABLED" : "disabled",
state.gr[7] != oldState.gr[7]) << " "
<< decWithLabel("pos", state.pos[TiaState::M1],
state.pos[TiaState::M1] != oldState.pos[TiaState::M1]) << " "
<< hexWithLabel("HM", state.hm[TiaState::M1],
@ -1278,17 +1284,17 @@ string TIADebug::toString()
<< boolWithLabel("priority", priorityPF(), state.pf[5] != oldState.pf[5])
<< endl
<< boolWithLabel("inpt0", myTIA.peek(0x08) & 0x80,
riotState.INPT0 != oldRiotState.INPT0) << " "
(riotState.INPT0 & 0x80) != (oldRiotState.INPT0 & 0x80)) << " "
<< boolWithLabel("inpt1", myTIA.peek(0x09) & 0x80,
riotState.INPT1 != oldRiotState.INPT1) << " "
(riotState.INPT1 & 0x80) != (oldRiotState.INPT1 & 0x80)) << " "
<< boolWithLabel("inpt2", myTIA.peek(0x0a) & 0x80,
riotState.INPT2 != oldRiotState.INPT2) << " "
(riotState.INPT2 & 0x80) != (oldRiotState.INPT2 & 0x80)) << " "
<< boolWithLabel("inpt3", myTIA.peek(0x0b) & 0x80,
riotState.INPT3 != oldRiotState.INPT3) << " "
(riotState.INPT3 & 0x80) != (oldRiotState.INPT3 & 0x80)) << " "
<< boolWithLabel("inpt4", myTIA.peek(0x0c) & 0x80,
riotState.INPT4 != oldRiotState.INPT4) << " "
(riotState.INPT4 & 0x80) != (oldRiotState.INPT4 & 0x80)) << " "
<< boolWithLabel("inpt5", myTIA.peek(0x0d) & 0x80,
riotState.INPT5 != oldRiotState.INPT5) << " "
(riotState.INPT5 & 0x80) != (oldRiotState.INPT5 & 0x80)) << " "
<< boolWithLabel("dump_gnd_0123", myTIA.myAnalogReadouts[0].vblankDumped(),
riotState.INPTDump != oldRiotState.INPTDump)
<< endl

View File

@ -138,6 +138,13 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
myTimWrite->setID(kTimWriteID);
addFocusWidget(myTimWrite);
t = new StaticTextWidget(boss, lfont, myTimWrite->getRight() + _fontWidth, ypos + 2 , "#");
myTimClocks = new DataGridWidget(boss, nfont, t->getRight() + _fontWidth / 2, ypos,
1, 1, 6, 30, Common::Base::Fmt::_10_6);
myTimClocks->setToolTip("Number of CPU cycles available for current timer interval.\n");
myTimClocks->setTarget(this);
myTimClocks->setEditable(false);
// Timer registers (RO)
static constexpr std::array<const char*, 5> readNames = {
"INTIM", "TIMINT", "Total Clks", "INTIM Clks", "Divider #"
@ -148,7 +155,7 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
t = new StaticTextWidget(boss, lfont, xpos, ypos + row * lineHeight + 2,
readNames[row]);
}
xpos += t->getWidth() + 5;
xpos += t->getWidth() + _fontWidth / 2;
myTimRead = new DataGridWidget(boss, nfont, xpos, ypos, 1, 4, 4, 30, Common::Base::Fmt::_16);
myTimRead->setTarget(this);
myTimRead->setEditable(false);
@ -341,6 +348,24 @@ void RiotWidget::loadConfig()
changed.push_back(state.T1024T != oldstate.T1024T);
myTimWrite->setList(alist, vlist, changed);
alist.clear(); vlist.clear(); changed.clear();
alist.push_back(0);
if(state.TIM1T)
vlist.push_back((state.TIM1T - 1) * 1);
else if(state.TIM8T)
vlist.push_back((state.TIM8T - 1) * 8);
else if(state.TIM64T)
vlist.push_back((state.TIM64T - 1) * 64);
else if(state.T1024T)
vlist.push_back((state.T1024T - 1) * 1024);
else
vlist.push_back(0);
changed.push_back(state.TIM1T != oldstate.TIM1T ||
state.TIM8T != oldstate.TIM8T ||
state.TIM64T != oldstate.TIM64T ||
state.T1024T != oldstate.T1024T);
myTimClocks->setList(alist, vlist, changed);
// Update timer read registers
alist.clear(); vlist.clear(); changed.clear();
alist.push_back(0); vlist.push_back(state.INTIM);

View File

@ -58,6 +58,7 @@ class RiotWidget : public Widget, public CommandSender
CheckboxWidget* myINPTDump{nullptr};
DataGridWidget* myTimWrite{nullptr};
DataGridWidget* myTimClocks{nullptr};
DataGridWidget* myTimRead{nullptr};
DataGridWidget* myTimDivider{nullptr};

View File

@ -460,8 +460,8 @@ Int32 M6532::intimClocks()
updateEmulation();
// This method is similar to intim(), except instead of giving the actual
// INTIM value, it will give the current number of clocks between one
// INTIM value and the next
// INTIM value, it will give the current number of CPU clocks since the last
// TIMxxT write
return ((myInterruptFlag & TimerBit) != 0) ? 1 : (myDivider - mySubTimer);
}

View File

@ -238,6 +238,10 @@ RiotMethod getRiotSpecial(char* ch)
return &RiotDebug::timWrappedOnWrite;
else if(BSPF::equalsIgnoreCase(ch, "_fTimReadCycles"))
return &RiotDebug::timReadCycles;
else if(BSPF::equalsIgnoreCase(ch, "_inTim"))
return &RiotDebug::intimAsInt;
else if(BSPF::equalsIgnoreCase(ch, "_timInt"))
return &RiotDebug::timintAsInt;
else
return nullptr;
}