added option for 'ghost' read traps

update documentation accordingly
removed reload requirements for Time Machine
This commit is contained in:
thrust26 2017-12-18 19:16:41 +01:00
parent 01c859d2a0
commit 481c85c0c3
8 changed files with 54 additions and 17 deletions

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

View File

@ -2324,6 +2324,16 @@
'1' is bold labels only, '2' is bold non-labels only, '3' is all bold font.</td>
</tr>
<tr>
<td><pre>-dbg.ghostreadstrap &lt;1|0&gt;</pre></td>
<td>Debugger considers/ignores 'ghost' reads for trap addresses</td>
</tr>
<tr>
<td><pre>-dbg.uhex &lt;0|1&gt;</pre></td>
<td>Lower-/uppercase HEX display</td>
</tr>
<tr>
<td><pre>-break &lt;address&gt;</pre></td>
<td>Set a breakpoint at specified address.</td>
@ -3160,9 +3170,10 @@
<td valign="top">
<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><td>Font size</td><td>Self-explanatory (requires ROM reload)</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>Debugger width/height</td><td>Self-explanatory (requires ROM reload)</td><td>-dbg.res</td></tr>
<tr><td>Font size</td><td>Self-explanatory</td><td>-dbg.fontsize</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</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>
</td>
</tr>

View File

@ -74,6 +74,7 @@ M6502::M6502(const Settings& settings)
#ifdef DEBUGGER_SUPPORT
myDebugger = nullptr;
myJustHitReadTrapFlag = myJustHitWriteTrapFlag = false;
myGhostReadsTrap = true;
#endif
}
@ -115,6 +116,7 @@ void M6502::reset()
myDataAddressForPoke = 0;
myHaltRequested = false;
myGhostReadsTrap = mySettings.getBool("dbg.ghostreadstrap");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -136,7 +138,8 @@ inline uInt8 M6502::peek(uInt16 address, uInt8 flags)
myLastPeekAddress = address;
#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
int cond = evalCondTraps();
@ -396,6 +399,7 @@ bool M6502::save(Serializer& out) const
out.putBool(myHaltRequested);
out.putBool(myStepStateByInstruction);
out.putBool(myGhostReadsTrap);
}
catch(...)
{
@ -447,6 +451,7 @@ bool M6502::load(Serializer& in)
myHaltRequested = in.getBool();
myStepStateByInstruction = in.getBool();
myGhostReadsTrap = in.getBool();
}
catch(...)
{

View File

@ -242,6 +242,8 @@ class M6502 : public Serializable
bool delCondTrap(uInt32 brk);
void clearCondTraps();
const StringList& getCondTrapNames() const;
void setGhostReadsTrap(bool enable) { myGhostReadsTrap = enable; }
#endif // DEBUGGER_SUPPORT
private:
@ -437,6 +439,8 @@ class M6502 : public Serializable
int address;
};
HitTrapInfo myHitTrapInfo;
// trap on ghost reads
bool myGhostReadsTrap;
vector<unique_ptr<Expression>> myCondBreaks;
StringList myCondBreakNames;

View File

@ -137,7 +137,8 @@ Settings::Settings(OSystem& osystem)
// Debugger/disassembly options
setInternal("dbg.fontsize", "medium");
setInternal("dbg.fontstyle", "0");
setInternal("dbg.uhex", "true");
setInternal("dbg.uhex", "false");
setInternal("dbg.ghostreadstrap", "true");
setInternal("dis.resolve", "true");
setInternal("dis.gfxformat", "2");
setInternal("dis.showaddr", "true");
@ -533,6 +534,8 @@ void Settings::usage() const
<< " -dbg.fontsize <small|medium| Font size to use in debugger window\n"
<< " large>\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"
<< " -debug Start in debugger mode\n"
<< endl
@ -569,6 +572,7 @@ void Settings::usage() const
<< " -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.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
<< " The same parameters but for developer settings mode\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_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.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;
}

View File

@ -39,6 +39,7 @@
#include "OSystem.hxx"
#include "StateManager.hxx"
#include "RewindManager.hxx"
#include "M6502.hxx"
#include "DeveloperDialog.hxx"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -327,7 +328,7 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
int sWidth = font.getMaxCharWidth() * 8;
myStateSizeWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 2, ypos - 1, sWidth, lineHeight,
"Buffer size (*) ", 0, kSizeChanged);
"Buffer size ", 0, kSizeChanged);
myStateSizeWidget->setMinValue(20);
myStateSizeWidget->setMaxValue(1000);
myStateSizeWidget->setStepValue(20);
@ -362,11 +363,6 @@ void DeveloperDialog::addTimeMachineTab(const GUI::Font& font)
lineHeight, items, "Horizon ~ ", 0, kHorizonChanged);
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);
}
@ -399,7 +395,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
pwidth = font.getStringWidth("Medium");
myDebuggerFontSize =
new PopUpWidget(myTab, font, HBORDER, ypos + 1, pwidth, lineHeight, items,
"Font size ", 0, kDFontSizeChanged);
"Font size (*) ", 0, kDFontSizeChanged);
wid.push_back(myDebuggerFontSize);
ypos += lineHeight + 4;
@ -412,7 +408,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
pwidth = font.getStringWidth("Bold non-labels only");
myDebuggerFontStyle =
new PopUpWidget(myTab, font, HBORDER, ypos + 1, pwidth, lineHeight, items,
"Font style ", 0);
"Font style (*) ", 0);
wid.push_back(myDebuggerFontStyle);
ypos += lineHeight + VGAP * 4;
@ -420,7 +416,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
pwidth = font.getMaxCharWidth() * 8;
// Debugger width and height
myDebuggerWidthSlider = new SliderWidget(myTab, font, xpos, ypos-1, pwidth,
lineHeight, "Debugger width ",
lineHeight, "Debugger width (*) ",
0, kDWidthChanged);
myDebuggerWidthSlider->setMinValue(DebuggerDialog::kSmallFontMinW);
myDebuggerWidthSlider->setMaxValue(ds.w);
@ -433,7 +429,7 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
ypos += lineHeight + VGAP;
myDebuggerHeightSlider = new SliderWidget(myTab, font, xpos, ypos-1, pwidth,
lineHeight, "Debugger height ",
lineHeight, "Debugger height (*) ",
0, kDHeightChanged);
myDebuggerHeightSlider->setMinValue(DebuggerDialog::kSmallFontMinH);
myDebuggerHeightSlider->setMaxValue(ds.h);
@ -444,10 +440,14 @@ void DeveloperDialog::addDebuggerTab(const GUI::Font& font)
xpos + myDebuggerHeightSlider->getWidth() + 4,
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
const GUI::Font& infofont = instance().frameBuffer().infoFont();
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
// (and when it's actually been compiled into the app)
@ -673,6 +673,9 @@ void DeveloperDialog::loadConfig()
int style = instance().settings().getInt("dbg.fontstyle");
myDebuggerFontStyle->setSelected(style, "0");
// Ghost reads trap
myGhostReadsTrapWidget->setState(instance().settings().getBool("dbg.ghostreadstrap"));
handleFontSize();
#endif
@ -725,6 +728,11 @@ void DeveloperDialog::saveConfig()
myDebuggerHeightSlider->getValue()));
// Debugger font size
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
}
@ -785,6 +793,9 @@ void DeveloperDialog::setDefaults()
myDebuggerHeightLabel->setValue(h);
myDebuggerFontSize->setSelected("medium");
myDebuggerFontStyle->setSelected("0");
myGhostReadsTrapWidget->setState(true);
handleFontSize();
#endif
break;

View File

@ -78,6 +78,7 @@ class DeveloperDialog : public Dialog
kDWidthChanged = 'UIdw',
kDHeightChanged = 'UIdh',
kDFontSizeChanged = 'UIfs',
kGhostReads = 'Dbgh'
#endif
};
enum SettingsSet
@ -133,6 +134,7 @@ class DeveloperDialog : public Dialog
StaticTextWidget* myDebuggerHeightLabel;
PopUpWidget* myDebuggerFontSize;
PopUpWidget* myDebuggerFontStyle;
CheckboxWidget* myGhostReadsTrapWidget;
#endif
bool mySettings;