diff --git a/Changes.txt b/Changes.txt
index a5f5a3abd..e046fe833 100644
--- a/Changes.txt
+++ b/Changes.txt
@@ -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.
diff --git a/docs/debugger.html b/docs/debugger.html
index 154859c82..b53eeeb8d 100644
--- a/docs/debugger.html
+++ b/docs/debugger.html
@@ -1084,7 +1084,7 @@ graphically differentiate between RAM and ROM areas.
The ROM listing also contains a context menu, accessible by right-clicking
anywhere in the listing:
-Currently, there are three options:
+The following options are available:
- Save ROM: 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.
- Toggle GFX binary/hex: Switch between editing GFX and PGFX sections
in either hexidecimal or binary.
+- Toggle address relocation: Corresponds to the Distella '-r' option
+(Relocate calls out of address range).
+
- Re-disassemble: Self-explanatory; force the current bank to be
disassembled, regardless of whether anything has changed.
diff --git a/docs/graphics/debugger_romcmenu.png b/docs/graphics/debugger_romcmenu.png
index 6003a9fb7..cb161acd7 100644
Binary files a/docs/graphics/debugger_romcmenu.png and b/docs/graphics/debugger_romcmenu.png differ
diff --git a/docs/index.html b/docs/index.html
index 77413ca9a..2daabb677 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -2251,22 +2251,27 @@
- -resolvedata <never|always|auto> |
+ -dis.resolvedata <never|always|auto> |
Try to differentiate between code vs. data sections in the
disassembler. See the Debugger section for more information. |
- -gfxformat <2|16> |
+ -dis.gfxformat <2|16> |
Sets the base to use for displaying GFX sections in the disassembler.
|
- -showaddr <1|0> |
+ -dis.showaddr <1|0> |
Shows/hides opcode addresses in the disassembler. |
+
+ -dis.relocate <1|0> |
+ Relocate calls out of address range. |
+
+
-debuggerres <WxH> |
Set the size of the debugger window. |
diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx
index 18dbcf956..587f6a254 100644
--- a/src/debugger/CartDebug.cxx
+++ b/src/debugger/CartDebug.cxx
@@ -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
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/src/debugger/gui/RomListWidget.cxx b/src/debugger/gui/RomListWidget.cxx
index 0eef06c65..c8636f49c 100644
--- a/src/debugger/gui/RomListWidget.cxx
+++ b/src/debugger/gui/RomListWidget.cxx
@@ -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);
diff --git a/src/debugger/gui/RomWidget.cxx b/src/debugger/gui/RomWidget.cxx
index 0cc8c0e63..473f2a278 100644
--- a/src/debugger/gui/RomWidget.cxx
+++ b/src/debugger/gui/RomWidget.cxx
@@ -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;
diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx
index b3cac06e8..539691213 100644
--- a/src/emucore/Settings.cxx
+++ b/src/emucore/Settings.cxx
@@ -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 \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 \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 The resolution to use in debugger mode\n"
<< " -break Set a breakpoint at 'address'\n"
<< " -debug Start in debugger mode\n"