mirror of https://github.com/stella-emu/stella.git
added option for 'ghost' read traps
update documentation accordingly removed reload requirements for Time Machine
This commit is contained in:
parent
01c859d2a0
commit
481c85c0c3
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 4.8 KiB |
|
@ -2324,6 +2324,16 @@
|
||||||
'1' is bold labels only, '2' is bold non-labels only, '3' is all bold font.</td>
|
'1' is bold labels only, '2' is bold non-labels only, '3' is all bold font.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>-dbg.ghostreadstrap <1|0></pre></td>
|
||||||
|
<td>Debugger considers/ignores 'ghost' reads for trap addresses</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td><pre>-dbg.uhex <0|1></pre></td>
|
||||||
|
<td>Lower-/uppercase HEX display</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><pre>-break <address></pre></td>
|
<td><pre>-break <address></pre></td>
|
||||||
<td>Set a breakpoint at specified address.</td>
|
<td>Set a breakpoint at specified address.</td>
|
||||||
|
@ -3160,9 +3170,10 @@
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<table border="1" cellpadding="4">
|
<table border="1" cellpadding="4">
|
||||||
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
|
<tr><th>Item</th><th>Brief description</th><th>For more information,<br>see <a href="#CommandLine">CommandLine</a></th></tr>
|
||||||
<tr><td>Font size</td><td>Self-explanatory (requires ROM reload)</td><td>-dbg.fontsize</td></tr>
|
<tr><td>Font size</td><td>Self-explanatory</td><td>-dbg.fontsize</td></tr>
|
||||||
<tr><td>Font style</td><td>Self-explanatory (requires ROM reload)</td><td>-dbg.fontstyle</td></tr>
|
<tr><td>Font style</td><td>Self-explanatory</td><td>-dbg.fontstyle</td></tr>
|
||||||
<tr><td>Debugger width/height</td><td>Self-explanatory (requires ROM reload)</td><td>-dbg.res</td></tr>
|
<tr><td>Debugger width/height</td><td>Self-explanatory</td><td>-dbg.res</td></tr>
|
||||||
|
<tr><td>Trap on 'ghost' reads</td><td>Defines whether the debugger should consider CPU 'ghost' reads for trap adresses.</td><td><span style="white-space:nowrap">-dbg.ghostreadstrap</span></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -74,6 +74,7 @@ M6502::M6502(const Settings& settings)
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
myDebugger = nullptr;
|
myDebugger = nullptr;
|
||||||
myJustHitReadTrapFlag = myJustHitWriteTrapFlag = false;
|
myJustHitReadTrapFlag = myJustHitWriteTrapFlag = false;
|
||||||
|
myGhostReadsTrap = true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,6 +116,7 @@ void M6502::reset()
|
||||||
myDataAddressForPoke = 0;
|
myDataAddressForPoke = 0;
|
||||||
|
|
||||||
myHaltRequested = false;
|
myHaltRequested = false;
|
||||||
|
myGhostReadsTrap = mySettings.getBool("dbg.ghostreadstrap");
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -136,7 +138,8 @@ inline uInt8 M6502::peek(uInt16 address, uInt8 flags)
|
||||||
myLastPeekAddress = address;
|
myLastPeekAddress = address;
|
||||||
|
|
||||||
#ifdef DEBUGGER_SUPPORT
|
#ifdef DEBUGGER_SUPPORT
|
||||||
if(myReadTraps.isInitialized() && myReadTraps.isSet(address))
|
if(myReadTraps.isInitialized() && myReadTraps.isSet(address)
|
||||||
|
&& (myGhostReadsTrap || flags != DISASM_NONE))
|
||||||
{
|
{
|
||||||
myLastPeekBaseAddress = myDebugger->getBaseAddress(myLastPeekAddress, true); // mirror handling
|
myLastPeekBaseAddress = myDebugger->getBaseAddress(myLastPeekAddress, true); // mirror handling
|
||||||
int cond = evalCondTraps();
|
int cond = evalCondTraps();
|
||||||
|
@ -396,6 +399,7 @@ bool M6502::save(Serializer& out) const
|
||||||
|
|
||||||
out.putBool(myHaltRequested);
|
out.putBool(myHaltRequested);
|
||||||
out.putBool(myStepStateByInstruction);
|
out.putBool(myStepStateByInstruction);
|
||||||
|
out.putBool(myGhostReadsTrap);
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
|
@ -447,6 +451,7 @@ bool M6502::load(Serializer& in)
|
||||||
|
|
||||||
myHaltRequested = in.getBool();
|
myHaltRequested = in.getBool();
|
||||||
myStepStateByInstruction = in.getBool();
|
myStepStateByInstruction = in.getBool();
|
||||||
|
myGhostReadsTrap = in.getBool();
|
||||||
}
|
}
|
||||||
catch(...)
|
catch(...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -242,6 +242,8 @@ class M6502 : public Serializable
|
||||||
bool delCondTrap(uInt32 brk);
|
bool delCondTrap(uInt32 brk);
|
||||||
void clearCondTraps();
|
void clearCondTraps();
|
||||||
const StringList& getCondTrapNames() const;
|
const StringList& getCondTrapNames() const;
|
||||||
|
|
||||||
|
void setGhostReadsTrap(bool enable) { myGhostReadsTrap = enable; }
|
||||||
#endif // DEBUGGER_SUPPORT
|
#endif // DEBUGGER_SUPPORT
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -437,6 +439,8 @@ class M6502 : public Serializable
|
||||||
int address;
|
int address;
|
||||||
};
|
};
|
||||||
HitTrapInfo myHitTrapInfo;
|
HitTrapInfo myHitTrapInfo;
|
||||||
|
// trap on ghost reads
|
||||||
|
bool myGhostReadsTrap;
|
||||||
|
|
||||||
vector<unique_ptr<Expression>> myCondBreaks;
|
vector<unique_ptr<Expression>> myCondBreaks;
|
||||||
StringList myCondBreakNames;
|
StringList myCondBreakNames;
|
||||||
|
|
|
@ -137,7 +137,8 @@ Settings::Settings(OSystem& osystem)
|
||||||
// Debugger/disassembly options
|
// Debugger/disassembly options
|
||||||
setInternal("dbg.fontsize", "medium");
|
setInternal("dbg.fontsize", "medium");
|
||||||
setInternal("dbg.fontstyle", "0");
|
setInternal("dbg.fontstyle", "0");
|
||||||
setInternal("dbg.uhex", "true");
|
setInternal("dbg.uhex", "false");
|
||||||
|
setInternal("dbg.ghostreadstrap", "true");
|
||||||
setInternal("dis.resolve", "true");
|
setInternal("dis.resolve", "true");
|
||||||
setInternal("dis.gfxformat", "2");
|
setInternal("dis.gfxformat", "2");
|
||||||
setInternal("dis.showaddr", "true");
|
setInternal("dis.showaddr", "true");
|
||||||
|
@ -533,6 +534,8 @@ void Settings::usage() const
|
||||||
<< " -dbg.fontsize <small|medium| Font size to use in debugger window\n"
|
<< " -dbg.fontsize <small|medium| Font size to use in debugger window\n"
|
||||||
<< " large>\n"
|
<< " large>\n"
|
||||||
<< " -dbg.fontstyle <0-3> Font style to use in debugger window (bold vs. normal)\n"
|
<< " -dbg.fontstyle <0-3> Font style to use in debugger window (bold vs. normal)\n"
|
||||||
|
<< " -dbg.ghostreadstrap <1|0> Debugger traps on 'ghost' reads\n"
|
||||||
|
<< " -dbg.uhex <0|1> lower-/uppercase HEX display\n"
|
||||||
<< " -break <address> Set a breakpoint at 'address'\n"
|
<< " -break <address> Set a breakpoint at 'address'\n"
|
||||||
<< " -debug Start in debugger mode\n"
|
<< " -debug Start in debugger mode\n"
|
||||||
<< endl
|
<< endl
|
||||||
|
@ -569,6 +572,7 @@ void Settings::usage() const
|
||||||
<< " -plr.tv.jitter <1|0> Enable TV jitter effect\n"
|
<< " -plr.tv.jitter <1|0> Enable TV jitter effect\n"
|
||||||
<< " -plr.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n"
|
<< " -plr.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n"
|
||||||
<< " -plr.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n"
|
<< " -plr.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n"
|
||||||
|
<< " -plr.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n"
|
||||||
<< endl
|
<< endl
|
||||||
<< " The same parameters but for developer settings mode\n"
|
<< " The same parameters but for developer settings mode\n"
|
||||||
<< " -dev.stats <1|0> Overlay console info during emulation\n"
|
<< " -dev.stats <1|0> Overlay console info during emulation\n"
|
||||||
|
@ -581,7 +585,7 @@ void Settings::usage() const
|
||||||
<< " -dev.tv.jitter <1|0> Enable TV jitter effect\n"
|
<< " -dev.tv.jitter <1|0> Enable TV jitter effect\n"
|
||||||
<< " -dev.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n"
|
<< " -dev.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n"
|
||||||
<< " -dev.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n"
|
<< " -dev.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n"
|
||||||
<< " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n"
|
<< " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n"
|
||||||
<< endl << std::flush;
|
<< endl << std::flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
#include "StateManager.hxx"
|
#include "StateManager.hxx"
|
||||||
#include "RewindManager.hxx"
|
#include "RewindManager.hxx"
|
||||||
|
#include "M6502.hxx"
|
||||||
#include "DeveloperDialog.hxx"
|
#include "DeveloperDialog.hxx"
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -327,7 +328,7 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
|
||||||
|
|
||||||
int sWidth = font.getMaxCharWidth() * 8;
|
int sWidth = font.getMaxCharWidth() * 8;
|
||||||
myStateSizeWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, sWidth, lineHeight,
|
myStateSizeWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, sWidth, lineHeight,
|
||||||
"Buffer size (*) ", 0, kSizeChanged);
|
"Buffer size ", 0, kSizeChanged);
|
||||||
myStateSizeWidget->setMinValue(20);
|
myStateSizeWidget->setMinValue(20);
|
||||||
myStateSizeWidget->setMaxValue(1000);
|
myStateSizeWidget->setMaxValue(1000);
|
||||||
myStateSizeWidget->setStepValue(20);
|
myStateSizeWidget->setStepValue(20);
|
||||||
|
@ -362,11 +363,6 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
|
||||||
lineHeight, items, "Horizon ~ ", 0, kHorizonChanged);
|
lineHeight, items, "Horizon ~ ", 0, kHorizonChanged);
|
||||||
wid.push_back(myStateHorizonWidget);
|
wid.push_back(myStateHorizonWidget);
|
||||||
|
|
||||||
// Add message concerning usage
|
|
||||||
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
|
||||||
ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10;
|
|
||||||
new StaticTextWidget(myTab, infofont, HBORDER, ypos, "(*) Requires application restart");
|
|
||||||
|
|
||||||
addToFocusList(wid, myTab, tabID);
|
addToFocusList(wid, myTab, tabID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -399,7 +395,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
pwidth = font.getStringWidth("Medium");
|
pwidth = font.getStringWidth("Medium");
|
||||||
myDebuggerFontSize =
|
myDebuggerFontSize =
|
||||||
new PopUpWidget(myTab, font, HBORDER, ypos + 1, pwidth, lineHeight, items,
|
new PopUpWidget(myTab, font, HBORDER, ypos + 1, pwidth, lineHeight, items,
|
||||||
"Font size ", 0, kDFontSizeChanged);
|
"Font size (*) ", 0, kDFontSizeChanged);
|
||||||
wid.push_back(myDebuggerFontSize);
|
wid.push_back(myDebuggerFontSize);
|
||||||
ypos += lineHeight + 4;
|
ypos += lineHeight + 4;
|
||||||
|
|
||||||
|
@ -412,7 +408,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
pwidth = font.getStringWidth("Bold non-labels only");
|
pwidth = font.getStringWidth("Bold non-labels only");
|
||||||
myDebuggerFontStyle =
|
myDebuggerFontStyle =
|
||||||
new PopUpWidget(myTab, font, HBORDER, ypos + 1, pwidth, lineHeight, items,
|
new PopUpWidget(myTab, font, HBORDER, ypos + 1, pwidth, lineHeight, items,
|
||||||
"Font style ", 0);
|
"Font style (*) ", 0);
|
||||||
wid.push_back(myDebuggerFontStyle);
|
wid.push_back(myDebuggerFontStyle);
|
||||||
|
|
||||||
ypos += lineHeight + VGAP * 4;
|
ypos += lineHeight + VGAP * 4;
|
||||||
|
@ -420,7 +416,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
pwidth = font.getMaxCharWidth() * 8;
|
pwidth = font.getMaxCharWidth() * 8;
|
||||||
// Debugger width and height
|
// Debugger width and height
|
||||||
myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos-1, pwidth,
|
myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos-1, pwidth,
|
||||||
lineHeight, "Debugger width ",
|
lineHeight, "Debugger width (*) ",
|
||||||
0, kDWidthChanged);
|
0, kDWidthChanged);
|
||||||
myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW);
|
myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW);
|
||||||
myDebuggerWidthSlider->setMaxValue(ds.w);
|
myDebuggerWidthSlider->setMaxValue(ds.w);
|
||||||
|
@ -433,7 +429,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
|
|
||||||
myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos-1, pwidth,
|
myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos-1, pwidth,
|
||||||
lineHeight, "Debugger height ",
|
lineHeight, "Debugger height (*) ",
|
||||||
0, kDHeightChanged);
|
0, kDHeightChanged);
|
||||||
myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH);
|
myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH);
|
||||||
myDebuggerHeightSlider->setMaxValue(ds.h);
|
myDebuggerHeightSlider->setMaxValue(ds.h);
|
||||||
|
@ -444,10 +440,14 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
|
||||||
xpos + myDebuggerHeightSlider->getWidth() + 4,
|
xpos + myDebuggerHeightSlider->getWidth() + 4,
|
||||||
ypos + 1, 4 * fontWidth, fontHeight, "", TextAlign::Left);
|
ypos + 1, 4 * fontWidth, fontHeight, "", TextAlign::Left);
|
||||||
|
|
||||||
|
ypos += lineHeight + VGAP * 4;
|
||||||
|
myGhostReadsTrapWidget = new CheckboxWidget(myTab, font, HBORDER, ypos + 1,
|
||||||
|
"Trap on 'ghost' reads", kGhostReads);
|
||||||
|
|
||||||
// Add message concerning usage
|
// Add message concerning usage
|
||||||
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
const GUI::Font& infofont = instance().frameBuffer().infoFont();
|
||||||
ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10;
|
ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10;
|
||||||
new StaticTextWidget(myTab, infofont, HBORDER, ypos, "(*) Changes require application restart");
|
new StaticTextWidget(myTab, infofont, HBORDER, ypos, "(*) Changes require a ROM reload");
|
||||||
|
|
||||||
// Debugger is only realistically available in windowed modes 800x600 or greater
|
// Debugger is only realistically available in windowed modes 800x600 or greater
|
||||||
// (and when it's actually been compiled into the app)
|
// (and when it's actually been compiled into the app)
|
||||||
|
@ -673,6 +673,9 @@ void DeveloperDialog::loadConfig()
|
||||||
int style = instance().settings().getInt("dbg.fontstyle");
|
int style = instance().settings().getInt("dbg.fontstyle");
|
||||||
myDebuggerFontStyle->setSelected(style, "0");
|
myDebuggerFontStyle->setSelected(style, "0");
|
||||||
|
|
||||||
|
// Ghost reads trap
|
||||||
|
myGhostReadsTrapWidget->setState(instance().settings().getBool("dbg.ghostreadstrap"));
|
||||||
|
|
||||||
handleFontSize();
|
handleFontSize();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -725,6 +728,11 @@ void DeveloperDialog::saveConfig()
|
||||||
myDebuggerHeightSlider->getValue()));
|
myDebuggerHeightSlider->getValue()));
|
||||||
// Debugger font size
|
// Debugger font size
|
||||||
instance().settings().setValue("dbg.fontsize", myDebuggerFontSize->getSelectedTag().toString());
|
instance().settings().setValue("dbg.fontsize", myDebuggerFontSize->getSelectedTag().toString());
|
||||||
|
|
||||||
|
// Ghost reads trap
|
||||||
|
instance().settings().setValue("dbg.ghostreadstrap", myGhostReadsTrapWidget->getState());
|
||||||
|
if(instance().hasConsole())
|
||||||
|
instance().console().system().m6502().setGhostReadsTrap(myGhostReadsTrapWidget->getState());
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -785,6 +793,9 @@ void DeveloperDialog::setDefaults()
|
||||||
myDebuggerHeightLabel->setValue(h);
|
myDebuggerHeightLabel->setValue(h);
|
||||||
myDebuggerFontSize->setSelected("medium");
|
myDebuggerFontSize->setSelected("medium");
|
||||||
myDebuggerFontStyle->setSelected("0");
|
myDebuggerFontStyle->setSelected("0");
|
||||||
|
|
||||||
|
myGhostReadsTrapWidget->setState(true);
|
||||||
|
|
||||||
handleFontSize();
|
handleFontSize();
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -78,6 +78,7 @@ class DeveloperDialog : public Dialog
|
||||||
kDWidthChanged = 'UIdw',
|
kDWidthChanged = 'UIdw',
|
||||||
kDHeightChanged = 'UIdh',
|
kDHeightChanged = 'UIdh',
|
||||||
kDFontSizeChanged = 'UIfs',
|
kDFontSizeChanged = 'UIfs',
|
||||||
|
kGhostReads = 'Dbgh'
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
enum SettingsSet
|
enum SettingsSet
|
||||||
|
@ -133,6 +134,7 @@ class DeveloperDialog : public Dialog
|
||||||
StaticTextWidget* myDebuggerHeightLabel;
|
StaticTextWidget* myDebuggerHeightLabel;
|
||||||
PopUpWidget* myDebuggerFontSize;
|
PopUpWidget* myDebuggerFontSize;
|
||||||
PopUpWidget* myDebuggerFontStyle;
|
PopUpWidget* myDebuggerFontStyle;
|
||||||
|
CheckboxWidget* myGhostReadsTrapWidget;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool mySettings;
|
bool mySettings;
|
||||||
|
|
Loading…
Reference in New Issue