From 8f6577187277214074280ee0af7ecdca8d24f2d7 Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 27 May 2012 13:07:38 +0000 Subject: [PATCH] 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 --- src/debugger/CartDebug.cxx | 2 ++ src/debugger/DiStella.cxx | 14 +++++++------- src/debugger/DiStella.hxx | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index 95f0de615..18dbcf956 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -72,6 +72,8 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem) myOSystem.settings().getInt("gfxformat") == 16 ? kBASE_16 : kBASE_2; DiStella::settings.show_addresses = myOSystem.settings().getBool("showaddr"); + DiStella::settings.fflag = true; // Not currently configurable + DiStella::settings.rflag = false; // Not currently configurable } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/DiStella.cxx b/src/debugger/DiStella.cxx index fd490791b..01e57641a 100644 --- a/src/debugger/DiStella.cxx +++ b/src/debugger/DiStella.cxx @@ -458,7 +458,7 @@ void DiStella::disasm(uInt32 distart, int pass) } else if (pass == 3) { - if (ad < 0x100) + if (ad < 0x100 && settings.fflag) nextline << ".w "; else nextline << " "; @@ -473,7 +473,7 @@ void DiStella::disasm(uInt32 distart, int pass) nextline << CartDebug::ourIOMnemonic[ad-0x280]; 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; USER_OR_AUTO_LABEL("", tmp, ""); @@ -530,7 +530,7 @@ void DiStella::disasm(uInt32 distart, int pass) } else if (pass == 3) { - if (ad < 0x100) + if (ad < 0x100 && settings.fflag) nextline << ".wx "; else nextline << " "; @@ -545,7 +545,7 @@ void DiStella::disasm(uInt32 distart, int pass) nextline << CartDebug::ourIOMnemonic[ad-0x280] << ",X"; 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; USER_OR_AUTO_LABEL("", tmp, ",X"); @@ -574,7 +574,7 @@ void DiStella::disasm(uInt32 distart, int pass) } else if (pass == 3) { - if (ad < 0x100) + if (ad < 0x100 && settings.fflag) nextline << ".wy "; else nextline << " "; @@ -589,7 +589,7 @@ void DiStella::disasm(uInt32 distart, int pass) nextline << CartDebug::ourIOMnemonic[ad-0x280] << ",Y"; 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; USER_OR_AUTO_LABEL("", tmp, ",Y"); @@ -705,7 +705,7 @@ void DiStella::disasm(uInt32 distart, int pass) } else if (pass == 3) { - if (ad < 0x100) + if (ad < 0x100 && settings.fflag) nextline << ".ind "; else nextline << " "; diff --git a/src/debugger/DiStella.hxx b/src/debugger/DiStella.hxx index 2cf5579c0..fd752c05e 100644 --- a/src/debugger/DiStella.hxx +++ b/src/debugger/DiStella.hxx @@ -66,6 +66,8 @@ class DiStella typedef struct { BaseFormat gfx_format; bool show_addresses; + bool fflag; // Forces correct address length (-f in Distella) + bool rflag; // Relocate calls out of address range (-r in Distella) } Settings; static Settings settings;