Added 'dis.relocate' commandline argument, which passes the

Distella '-r' option (Relocate calls out of address range) to
the disassembler core.  Also added UI item to dynamically
change the setting.

Renamed 'resolvedata', 'showaddr' and 'gfxformat' commandline
arguments to start with 'dis', indicating that they're part
of the disassembler.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2504 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-05-27 19:27:55 +00:00
parent 60912d6f38
commit 01d8c298ae
8 changed files with 50 additions and 24 deletions

View File

@ -40,13 +40,18 @@
a multi-file archive before using each ROM. Thanks go to Roland
Schabenberger (webOS maintainer) for this idea and sample code.
* Fixed several bugs in debugger disassembly:
* Several improvements to the debugger/disassembler:
- The 'resolvedata', 'showaddr' and 'gfxformat' commandline
arguments are renamed to start with 'dis', indicating that
they're used with the built-in disassembler.
- Zero-page code addresses no longer have their high-byte
truncated, and system equates (TIA and I/O registers) are now
properly marked as such.
- The Distella '-r' option (Relocate calls out of address range)
is no longer the default, resulting in output more consistent
with normal usage of Distella.
with normal usage of Distella. Related to this, added the
'-dis.relocate' commandline argument (and associated UI item)
to toggle this dynamically.
* Fixed bug in EFSC bankswitch scheme state saving; the Superchip RAM
wasn't actually being loaded and saved to state files.

View File

@ -1084,7 +1084,7 @@ graphically differentiate between RAM and ROM areas.</p>
<p>The ROM listing also contains a context menu, accessible by right-clicking
anywhere in the listing:</p>
<p><img src="graphics/debugger_romcmenu.png"></p>
<p>Currently, there are three options:</p>
<p>The following options are available:</p>
<ul>
<li><b>Save ROM</b>: A textbox will appear for you to enter filename,
and then the ROM will be saved. Note that the filename is considered
@ -1103,6 +1103,9 @@ addresses.</li>
<li><b>Toggle GFX binary/hex</b>: Switch between editing GFX and PGFX sections
in either hexidecimal or binary.</li>
<li><b>Toggle address relocation</b>: Corresponds to the Distella '-r' option
(Relocate calls out of address range).</li>
<li><b>Re-disassemble</b>: Self-explanatory; force the current bank to be
disassembled, regardless of whether anything has changed.</li>
</ul>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -2251,22 +2251,27 @@
</tr>
<tr>
<td><pre>-resolvedata &lt;never|always|auto&gt;</pre></td>
<td><pre>-dis.resolvedata &lt;never|always|auto&gt;</pre></td>
<td>Try to differentiate between code vs. data sections in the
disassembler. See the Debugger section for more information.</td>
</tr>
<tr>
<td><pre>-gfxformat &lt;2|16&gt;</pre></td>
<td><pre>-dis.gfxformat &lt;2|16&gt;</pre></td>
<td>Sets the base to use for displaying GFX sections in the disassembler.
</td>
</tr>
<tr>
<td><pre>-showaddr &lt;1|0&gt;</pre></td>
<td><pre>-dis.showaddr &lt;1|0&gt;</pre></td>
<td>Shows/hides opcode addresses in the disassembler.</td>
</tr>
<tr>
<td><pre>-dis.relocate &lt;1|0&gt;</pre></td>
<td>Relocate calls out of address range.</td>
</tr>
<tr>
<td><pre>-debuggerres &lt;WxH&gt;</pre></td>
<td>Set the size of the debugger window.</td>

View File

@ -69,11 +69,11 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
// Add settings for Distella
DiStella::settings.gfx_format =
myOSystem.settings().getInt("gfxformat") == 16 ? kBASE_16 : kBASE_2;
myOSystem.settings().getInt("dis.gfxformat") == 16 ? kBASE_16 : kBASE_2;
DiStella::settings.show_addresses =
myOSystem.settings().getBool("showaddr");
myOSystem.settings().getBool("dis.showaddr");
DiStella::settings.rflag = myOSystem.settings().getBool("dis.relocate");
DiStella::settings.fflag = true; // Not currently configurable
DiStella::settings.rflag = false; // Not currently configurable
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -65,9 +65,10 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& font,
l.push_back("Save ROM", "saverom");
l.push_back("Set PC", "setpc");
l.push_back("RunTo PC", "runtopc");
l.push_back("---------------------", "");
l.push_back("-------------------------", "");
l.push_back("Toggle PC addresses", "pcaddr");
l.push_back("Toggle GFX binary/hex", "gfx");
l.push_back("Toggle address relocation", "relocate");
l.push_back("Re-disassemble", "disasm");
myMenu = new ContextMenu(this, font, l);

View File

@ -104,7 +104,8 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
mySaveRom->setTarget(this);
// By default, we try to automatically determine code vs. data sections
myResolveData->setSelected(instance().settings().getString("resolvedata"), "auto");
myResolveData->setSelected(
instance().settings().getString("dis.resolvedata"), "auto");
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -178,8 +179,8 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
else if(rmb == "pcaddr")
{
DiStella::settings.show_addresses = !DiStella::settings.show_addresses;
instance().settings().setString("showaddr",
DiStella::settings.show_addresses ? "true" : "false");
instance().settings().setBool("dis.showaddr",
DiStella::settings.show_addresses);
invalidate();
}
else if(rmb == "gfx")
@ -187,15 +188,22 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
if(DiStella::settings.gfx_format == kBASE_16)
{
DiStella::settings.gfx_format = kBASE_2;
instance().settings().setString("gfxformat", "2");
instance().settings().setString("dis.gfxformat", "2");
}
else
{
DiStella::settings.gfx_format = kBASE_16;
instance().settings().setString("gfxformat", "16");
instance().settings().setString("dis.gfxformat", "16");
}
invalidate();
}
else if(rmb == "relocate")
{
DiStella::settings.rflag = !DiStella::settings.rflag;
instance().settings().setBool("dis.relocate",
DiStella::settings.rflag);
invalidate();
}
break; // kCMenuItemSelectedCmd
}
@ -204,7 +212,7 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break;
case kResolveDataChanged:
instance().settings().setString("resolvedata", myResolveData->getSelectedTag());
instance().settings().setString("dis.resolvedata", myResolveData->getSelectedTag());
invalidate();
loadConfig();
break;

View File

@ -136,10 +136,11 @@ Settings::Settings(OSystem* osystem)
setExternal("romloadcount", "0");
setExternal("maxres", "");
// Debugger options
setInternal("resolvedata", "auto");
setInternal("gfxformat", "2");
setInternal("showaddr", "true");
// Debugger disassembly options
setInternal("dis.resolvedata", "auto");
setInternal("dis.gfxformat", "2");
setInternal("dis.showaddr", "true");
setInternal("dis.relocate", "false");
// Thumb ARM emulation options
setInternal("thumb.trapfatal", "true");
@ -438,10 +439,13 @@ void Settings::usage()
<< " The following options are meant for developers\n"
<< " Arguments are more fully explained in the manual\n"
<< endl
<< " -resolvedata <never| Set automatic code vs. data determination in the disassembler\n"
<< " always|auto>\n"
<< " -gfxformat <2|16> Set base to use for displaying GFX sections in the disassembler\n"
<< " -showaddr <1|0> Show opcode addresses in the disassembler\n"
<< " -dis.resolvedata <never| Set automatic code vs. data determination in disassembler\n"
<< " always|\n"
<< " auto>\n"
<< " -dis.gfxformat <2|16> Set base to use for displaying GFX sections in disassembler\n"
<< " -dis.showaddr <1|0> Show opcode addresses in disassembler\n"
<< " -dis.relocate <1|0> Relocate calls out of address range in disassembler\n"
<< endl
<< " -debuggerres <WxH> The resolution to use in debugger mode\n"
<< " -break <address> Set a breakpoint at 'address'\n"
<< " -debug Start in debugger mode\n"