diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index 0f493eba0..e65429619 100644 --- a/stella/src/debugger/DebuggerParser.cxx +++ b/stella/src/debugger/DebuggerParser.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerParser.cxx,v 1.17 2005-06-19 16:53:57 urchlay Exp $ +// $Id: DebuggerParser.cxx,v 1.18 2005-06-20 02:36:39 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -162,7 +162,7 @@ int DebuggerParser::decipher_arg(string &arg) { // The GUI uses this: bool DebuggerParser::parseArgument( - string& arg, int *value, char *rendered) + string& arg, int *value, char *rendered, int outputBase=kBASE_DEFAULT) { *value = decipher_arg(arg); @@ -171,7 +171,10 @@ bool DebuggerParser::parseArgument( return false; } - switch(defaultBase) { + if(outputBase == kBASE_DEFAULT) + outputBase = defaultBase; + + switch(outputBase) { case kBASE_2: if(*value < 0x100) sprintf(rendered, Debugger::to_bin_8(*value)); diff --git a/stella/src/debugger/DebuggerParser.hxx b/stella/src/debugger/DebuggerParser.hxx index 6a5aec51f..ef79474d7 100644 --- a/stella/src/debugger/DebuggerParser.hxx +++ b/stella/src/debugger/DebuggerParser.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: DebuggerParser.hxx,v 1.9 2005-06-19 08:29:40 urchlay Exp $ +// $Id: DebuggerParser.hxx,v 1.10 2005-06-20 02:36:39 urchlay Exp $ //============================================================================ #ifndef DEBUGGER_PARSER_HXX @@ -29,7 +29,8 @@ class Debugger; enum { kBASE_16, kBASE_10, - kBASE_2 + kBASE_2, + kBASE_DEFAULT }; class DebuggerParser @@ -39,7 +40,7 @@ class DebuggerParser ~DebuggerParser(); string run(const string& command); - bool parseArgument(string& arg, int *value, char *rendered); + bool parseArgument(string& arg, int *value, char *rendered, int outputBase); void setBase(int base); private: