diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 23dc810bf..d062b9ee8 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.102 2005-10-15 17:35:16 urchlay Exp $ +// $Id: Debugger.cxx,v 1.103 2005-10-22 15:43:16 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -986,6 +986,9 @@ void Debugger::setQuitState() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GUI::Rect Debugger::getDialogBounds() const { + // FIXME - This whole method is due for an overall + // We need to decide if Stella GUI size will be pixel based + // or font based, and update the GUI code everywhere GUI::Rect tia = getTiaBounds(); int userHeight = myOSystem->settings().getInt("debugheight"); @@ -998,8 +1001,8 @@ GUI::Rect Debugger::getDialogBounds() const // Make sure window is always at least 'kDebuggerHeight' high // We need this to make positioning of widget easier - if(userHeight < kDebuggerHeight + tia.height()) - userHeight = kDebuggerHeight - tia.height(); + if(userHeight + tia.height() < kDebuggerHeight) + userHeight = kDebuggerHeight; GUI::Rect r(0, 0, kDebuggerWidth, userHeight + tia.height()); return r; diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index 93334b5a8..256424954 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.81 2005-10-20 19:01:58 stephena Exp $ +// $Id: Debugger.hxx,v 1.82 2005-10-22 15:43:16 stephena Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -79,7 +79,7 @@ typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)(); for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.81 2005-10-20 19:01:58 stephena Exp $ + @version $Id: Debugger.hxx,v 1.82 2005-10-22 15:43:16 stephena Exp $ */ class Debugger : public DialogContainer { @@ -262,7 +262,17 @@ class Debugger : public DialogContainer */ static Debugger& debugger() { return *myStaticDebugger; } - /* these are now exposed so Expressions can use them. */ + /** + Get the dimensions of the various debugger dialog areas + (takes mediasource into account) + */ + GUI::Rect getDialogBounds() const; + GUI::Rect getTiaBounds() const; + GUI::Rect getRomBounds() const; + GUI::Rect getStatusBounds() const; + GUI::Rect getTabBounds() const; + + /* These are now exposed so Expressions can use them. */ int peek(int addr); int dpeek(int addr); int getBank(); @@ -278,8 +288,8 @@ class Debugger : public DialogContainer bool setBank(int bank); bool patchROM(int addr, int value); - void lockState(); - void unlockState(); + void lockState(); + void unlockState(); private: /** @@ -297,16 +307,6 @@ class Debugger : public DialogContainer */ void setQuitState(); - /** - Get the dimensions of the various debugger dialog areas - (takes mediasource into account) - */ - GUI::Rect getDialogBounds() const; - GUI::Rect getTiaBounds() const; - GUI::Rect getRomBounds() const; - GUI::Rect getStatusBounds() const; - GUI::Rect getTabBounds() const; - /** Resize the debugger dialog based on the current dimensions from getDialogBounds. diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index f8bc69191..4718fa63f 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.84 2005-10-06 17:28:54 stephena Exp $ +// $Id: DebuggerParser.cxx,v 1.85 2005-10-22 15:43:16 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -1477,8 +1477,9 @@ void DebuggerParser::executeExec() { // "height" void DebuggerParser::executeHeight() { - int height = debugger->setHeight(args[0]); - commandResult = "height set to " + debugger->valueToString(height, kBASE_10); + int height = debugger->setHeight(args[0]); + commandResult = "height set to " + debugger->valueToString(height, kBASE_10) + + "\nExit debugger and reload ROM to take effect"; } // "help" diff --git a/stella/src/debugger/gui/RomWidget.cxx b/stella/src/debugger/gui/RomWidget.cxx index 04bc78cf0..a497840da 100644 --- a/stella/src/debugger/gui/RomWidget.cxx +++ b/stella/src/debugger/gui/RomWidget.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: RomWidget.cxx,v 1.13 2005-10-14 13:50:00 stephena Exp $ +// $Id: RomWidget.cxx,v 1.14 2005-10-22 15:43:17 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -45,8 +45,7 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y) myCurrentBank(-1) { int w = 58 * font.getMaxCharWidth(), - h = 30 * font.getLineHeight(), - xpos, ypos; + h = 0, xpos, ypos; StaticTextWidget* t; // Create bank editable area @@ -82,6 +81,12 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y) // Create rom listing xpos = x; ypos += myBank->getHeight() + 4; + + // Update height of widget to use all remaining vertical space + GUI::Rect dialog = instance()->debugger().getDialogBounds(); + int rows = ((dialog.height() - ypos) / font.getLineHeight()) - 1; + h = rows * font.getLineHeight(); + myRomList = new RomListWidget(boss, font, xpos, ypos, w, h); myRomList->setTarget(this); myRomList->myMenu->setTarget(this);