The built-in Distella was assuming the 'r' flag (-r on commandline)

option was set, which normally isn't when disassembling standalone
ROMs.  As such, the disassembly didn't match standard Distella output.
The 'fflag' and 'rflag' options from Distella have therefore been
integrated, but they're not configurable at this point (hardcoded
to true and false, respectively).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2502 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-05-27 13:07:38 +00:00
parent 4750c64a17
commit 8f65771872
3 changed files with 11 additions and 7 deletions

View File

@ -72,6 +72,8 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
myOSystem.settings().getInt("gfxformat") == 16 ? kBASE_16 : kBASE_2; myOSystem.settings().getInt("gfxformat") == 16 ? kBASE_16 : kBASE_2;
DiStella::settings.show_addresses = DiStella::settings.show_addresses =
myOSystem.settings().getBool("showaddr"); myOSystem.settings().getBool("showaddr");
DiStella::settings.fflag = true; // Not currently configurable
DiStella::settings.rflag = false; // Not currently configurable
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -458,7 +458,7 @@ void DiStella::disasm(uInt32 distart, int pass)
} }
else if (pass == 3) else if (pass == 3)
{ {
if (ad < 0x100) if (ad < 0x100 && settings.fflag)
nextline << ".w "; nextline << ".w ";
else else
nextline << " "; nextline << " ";
@ -473,7 +473,7 @@ void DiStella::disasm(uInt32 distart, int pass)
nextline << CartDebug::ourIOMnemonic[ad-0x280]; nextline << CartDebug::ourIOMnemonic[ad-0x280];
nextlinebytes << HEX2 << (int)(ad&0xff) << " " << HEX2 << (int)(ad>>8); nextlinebytes << HEX2 << (int)(ad&0xff) << " " << HEX2 << (int)(ad>>8);
} }
else if (labfound == 4) else if (labfound == 4 && settings.rflag)
{ {
int tmp = (ad & myAppData.end)+myOffset; int tmp = (ad & myAppData.end)+myOffset;
USER_OR_AUTO_LABEL("", tmp, ""); USER_OR_AUTO_LABEL("", tmp, "");
@ -530,7 +530,7 @@ void DiStella::disasm(uInt32 distart, int pass)
} }
else if (pass == 3) else if (pass == 3)
{ {
if (ad < 0x100) if (ad < 0x100 && settings.fflag)
nextline << ".wx "; nextline << ".wx ";
else else
nextline << " "; nextline << " ";
@ -545,7 +545,7 @@ void DiStella::disasm(uInt32 distart, int pass)
nextline << CartDebug::ourIOMnemonic[ad-0x280] << ",X"; nextline << CartDebug::ourIOMnemonic[ad-0x280] << ",X";
nextlinebytes << HEX2 << (int)(ad&0xff) << " " << HEX2 << (int)(ad>>8); nextlinebytes << HEX2 << (int)(ad&0xff) << " " << HEX2 << (int)(ad>>8);
} }
else if (labfound == 4) else if (labfound == 4 && settings.rflag)
{ {
int tmp = (ad & myAppData.end)+myOffset; int tmp = (ad & myAppData.end)+myOffset;
USER_OR_AUTO_LABEL("", tmp, ",X"); USER_OR_AUTO_LABEL("", tmp, ",X");
@ -574,7 +574,7 @@ void DiStella::disasm(uInt32 distart, int pass)
} }
else if (pass == 3) else if (pass == 3)
{ {
if (ad < 0x100) if (ad < 0x100 && settings.fflag)
nextline << ".wy "; nextline << ".wy ";
else else
nextline << " "; nextline << " ";
@ -589,7 +589,7 @@ void DiStella::disasm(uInt32 distart, int pass)
nextline << CartDebug::ourIOMnemonic[ad-0x280] << ",Y"; nextline << CartDebug::ourIOMnemonic[ad-0x280] << ",Y";
nextlinebytes << HEX2 << (int)(ad&0xff) << " " << HEX2 << (int)(ad>>8); nextlinebytes << HEX2 << (int)(ad&0xff) << " " << HEX2 << (int)(ad>>8);
} }
else if (labfound == 4) else if (labfound == 4 && settings.rflag)
{ {
int tmp = (ad & myAppData.end)+myOffset; int tmp = (ad & myAppData.end)+myOffset;
USER_OR_AUTO_LABEL("", tmp, ",Y"); USER_OR_AUTO_LABEL("", tmp, ",Y");
@ -705,7 +705,7 @@ void DiStella::disasm(uInt32 distart, int pass)
} }
else if (pass == 3) else if (pass == 3)
{ {
if (ad < 0x100) if (ad < 0x100 && settings.fflag)
nextline << ".ind "; nextline << ".ind ";
else else
nextline << " "; nextline << " ";

View File

@ -66,6 +66,8 @@ class DiStella
typedef struct { typedef struct {
BaseFormat gfx_format; BaseFormat gfx_format;
bool show_addresses; bool show_addresses;
bool fflag; // Forces correct address length (-f in Distella)
bool rflag; // Relocate calls out of address range (-r in Distella)
} Settings; } Settings;
static Settings settings; static Settings settings;