diff --git a/stella/src/common/mainSDL.cxx b/stella/src/common/mainSDL.cxx index 87d67cbbd..c36a12226 100644 --- a/stella/src/common/mainSDL.cxx +++ b/stella/src/common/mainSDL.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: mainSDL.cxx,v 1.46 2005-06-17 14:42:48 stephena Exp $ +// $Id: mainSDL.cxx,v 1.47 2005-06-19 16:53:57 urchlay Exp $ //============================================================================ #include @@ -178,7 +178,11 @@ int main(int argc, char* argv[]) if(argc == 1 || !FilesystemNode::fileExists(romfile)) theOSystem->createLauncher(); else + { theOSystem->createConsole(romfile); + if(theOSystem->settings().getBool("debug")) + handler.enterDebugMode(); + } // Start the main loop, and don't exit until the user issues a QUIT command theOSystem->mainLoop(); diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 56b4e05ef..6c3ba9ad4 100644 --- a/stella/src/debugger/Debugger.cxx +++ b/stella/src/debugger/Debugger.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: Debugger.cxx,v 1.18 2005-06-19 08:29:39 urchlay Exp $ +// $Id: Debugger.cxx,v 1.19 2005-06-19 16:53:57 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -59,10 +59,14 @@ Debugger::~Debugger() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::initialize() { + int userHeight = myOSystem->settings().getInt("debugheight"); + if(userHeight < kDebuggerHeight) + userHeight = kDebuggerHeight; + int x = 0, y = myConsole->mediaSource().height(), w = kDebuggerWidth, - h = kDebuggerHeight - y; + h = userHeight - y; delete myBaseDialog; DebuggerDialog *dd = new DebuggerDialog(myOSystem, this, x, y, w, h); @@ -73,8 +77,12 @@ void Debugger::initialize() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Debugger::initializeVideo() { + int userHeight = myOSystem->settings().getInt("debugheight"); + if(userHeight < kDebuggerHeight) + userHeight = kDebuggerHeight; + string title = string("Stella version ") + STELLA_VERSION + ": Debugger mode"; - myOSystem->frameBuffer().initialize(title, kDebuggerWidth, kDebuggerHeight, false); + myOSystem->frameBuffer().initialize(title, kDebuggerWidth, userHeight, false); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -473,3 +481,21 @@ int Debugger::peek(int addr) { int Debugger::dpeek(int addr) { return mySystem->peek(addr) | (mySystem->peek(addr+1) << 8); } + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool Debugger::setHeight(int height) { + if(height == 0) + height = kDebuggerHeight; + + if(height < kDebuggerHeight) + return false; + + myOSystem->settings().setInt("debugheight", height); +/* +// FIXME: this segfaults + quit(); + initialize(); + initializeVideo(); +*/ + return true; +} diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index e832f783e..0a42ed6a9 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.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: Debugger.hxx,v 1.16 2005-06-19 08:29:39 urchlay Exp $ +// $Id: Debugger.hxx,v 1.17 2005-06-19 16:53:57 urchlay Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -49,7 +49,7 @@ enum { for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.16 2005-06-19 08:29:39 urchlay Exp $ + @version $Id: Debugger.hxx,v 1.17 2005-06-19 16:53:57 urchlay Exp $ */ class Debugger : public DialogContainer { @@ -130,6 +130,7 @@ class Debugger : public DialogContainer void toggleBreakPoint(int bp); bool breakPoint(int bp); string disassemble(int start, int lines); + bool setHeight(int height); public: /** diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index cf7231ba4..0f493eba0 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.16 2005-06-19 08:37:29 urchlay Exp $ +// $Id: DebuggerParser.cxx,v 1.17 2005-06-19 16:53:57 urchlay Exp $ //============================================================================ #include "bspf.hxx" @@ -449,7 +449,18 @@ string DebuggerParser::run(const string& command) { return "OK"; } else if(subStringMatch(verb, "clearbreaks")) { debugger->clearAllBreakPoints(); - return "cleared all breakpoints"; + } else if(subStringMatch(verb, "height")) { + if(argCount != 1) + return "one argument required"; + + return "This command is not yet supported. Start Stella with the -debugheight option instead."; +/* + if(debugger->setHeight(args[0])) + //return "Stella will use the new height next time it starts."; + return "OK"; + else + return "bad height (use 0 for default, min height #383)"; +*/ } else if(subStringMatch(verb, "print")) { if(argCount < 1) return "one or more arguments required"; @@ -498,6 +509,7 @@ string DebuggerParser::run(const string& command) { "disasm - Disassemble (from current PC)\n" "disasm xx - Disassemble (from address xx)\n" "frame - Advance to next TIA frame, then break\n" + "height xx - Set height of debugger window in pixels\n" "listbreaks - List all breakpoints\n" "loadsym f - Load DASM symbols from file f\n" "n - Toggle Negative Flag\n" diff --git a/stella/src/emucore/Settings.cxx b/stella/src/emucore/Settings.cxx index cd14fea82..db72501d7 100644 --- a/stella/src/emucore/Settings.cxx +++ b/stella/src/emucore/Settings.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: Settings.cxx,v 1.49 2005-06-17 14:42:49 stephena Exp $ +// $Id: Settings.cxx,v 1.50 2005-06-19 16:53:57 urchlay Exp $ //============================================================================ #include @@ -50,6 +50,7 @@ Settings::Settings(OSystem* osystem) set("grabmouse", "false"); set("center", "true"); set("palette", "standard"); + set("debugheight", "383"); set("sound", "true"); set("fragsize", "512"); @@ -146,6 +147,11 @@ bool Settings::loadCommandLine(int argc, char** argv) set(key, "true", false); // this confusing line means set 'listrominfo' return true; // to true, but don't save to the settings file } + else if(key == "debug") // this doesn't make Stella exit + { + set(key, "true", false); // don't save this to the config file either + return true; + } if(++i >= argc) {