mirror of https://github.com/stella-emu/stella.git
Fixed 'debugheight' argument and associated 'height' debugger command
to correctly set the height of the Prompt/tab area in the debugger. The new minimum height is 27 lines in the prompt, which corresponds to an ~ 700 pixel high window. This should fix the problems OSX users were having with the dock taking up too much space onscreen in 1024x768 mode. Changing the height from within Stella still requires a reload of the ROM, and now a message is printed stating this fact. The GUI code is in need of a minor overhaul so that resizing can be done automatically, without requiring a ROM reload and also taking font size into account. This will be completed for a future release. Finally, the RomWidget is now also resized when the debugger height changes, taking the extra vertical space into account. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@853 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
c8599f2bc0
commit
b3610f44a5
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue