mirror of https://github.com/stella-emu/stella.git
Some more changes for the 'height' command, cleaning up some
crufty code. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@644 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
c0924eaf4f
commit
59524329ef
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Debugger.cxx,v 1.62 2005-07-14 11:28:37 stephena Exp $
|
// $Id: Debugger.cxx,v 1.63 2005-07-14 15:13:14 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
@ -85,28 +85,8 @@ Debugger::~Debugger()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Debugger::initialize()
|
void Debugger::initialize()
|
||||||
{
|
{
|
||||||
cerr << "Debugger::initialize()\n";
|
int x, y, w, h;
|
||||||
// Calculate the actual pixels required for the # of lines
|
getDialogBounds(&x, &y, &w, &h);
|
||||||
// This is currently a bit of a hack, since it uses pixel
|
|
||||||
// values that it shouldn't know about (font and tab height, etc)
|
|
||||||
int userHeight = myOSystem->settings().getInt("debugheight");
|
|
||||||
if(userHeight < kDebuggerLines)
|
|
||||||
{
|
|
||||||
userHeight = kDebuggerLines;
|
|
||||||
myOSystem->settings().setInt("debugheight", userHeight);
|
|
||||||
}
|
|
||||||
userHeight = (userHeight + 3) * kDebuggerLineHeight - 8;
|
|
||||||
|
|
||||||
int x = 0,
|
|
||||||
y = myConsole->mediaSource().height(),
|
|
||||||
w = kDebuggerWidth,
|
|
||||||
h = userHeight;
|
|
||||||
|
|
||||||
cerr << "x = " << x << endl
|
|
||||||
<< "y = " << y << endl
|
|
||||||
<< "w = " << w << endl
|
|
||||||
<< "h = " << h << endl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
delete myBaseDialog;
|
delete myBaseDialog;
|
||||||
DebuggerDialog *dd = new DebuggerDialog(myOSystem, this, x, y, w, h);
|
DebuggerDialog *dd = new DebuggerDialog(myOSystem, this, x, y, w, h);
|
||||||
|
@ -123,23 +103,11 @@ cerr << "x = " << x << endl
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Debugger::initializeVideo()
|
void Debugger::initializeVideo()
|
||||||
{
|
{
|
||||||
cerr << "Debugger::initializeVideo()\n";
|
int x, y, w, h;
|
||||||
|
getDialogBounds(&x, &y, &w, &h);
|
||||||
// Calculate the actual pixels required for entire screen
|
|
||||||
// This is currently a bit of a hack, since it uses pixel
|
|
||||||
// values that it shouldn't know about (font and tab height, etc)
|
|
||||||
int userHeight = myOSystem->settings().getInt("debugheight");
|
|
||||||
if(userHeight < kDebuggerLines)
|
|
||||||
userHeight = kDebuggerLines;
|
|
||||||
userHeight = (userHeight + 3) * kDebuggerLineHeight - 8 +
|
|
||||||
myConsole->mediaSource().height();
|
|
||||||
|
|
||||||
cerr << "w = " << kDebuggerWidth << endl
|
|
||||||
<< "h = " << userHeight << endl
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
string title = string("Stella ") + STELLA_VERSION + ": Debugger mode";
|
string title = string("Stella ") + STELLA_VERSION + ": Debugger mode";
|
||||||
myOSystem->frameBuffer().initialize(title, kDebuggerWidth, userHeight, false);
|
myOSystem->frameBuffer().initialize(title, w, y+h, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -701,23 +669,14 @@ int Debugger::dpeek(int addr) {
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
int Debugger::setHeight(int height)
|
int Debugger::setHeight(int height)
|
||||||
{
|
{
|
||||||
// FIXME - this doesn't seem to work ...
|
|
||||||
|
|
||||||
cerr << "debugheight: " <<
|
|
||||||
myOSystem->settings().getInt("debugheight")
|
|
||||||
<< endl;
|
|
||||||
|
|
||||||
if(height < kDebuggerLines)
|
if(height < kDebuggerLines)
|
||||||
height = kDebuggerLines;
|
height = kDebuggerLines;
|
||||||
|
|
||||||
myOSystem->settings().setInt("debugheight", height);
|
myOSystem->settings().setInt("debugheight", height);
|
||||||
|
|
||||||
cerr << "height: " << height << endl;
|
// Inform the debugger dialog about the new size
|
||||||
|
|
||||||
quit();
|
quit();
|
||||||
|
resizeDialog();
|
||||||
// FIXME - implement ScummVM resize code
|
|
||||||
|
|
||||||
start();
|
start();
|
||||||
|
|
||||||
return height;
|
return height;
|
||||||
|
@ -799,3 +758,26 @@ void Debugger::setQuitState()
|
||||||
if(breakPoints->isSet(myCpuDebug->pc()))
|
if(breakPoints->isSet(myCpuDebug->pc()))
|
||||||
mySystem->m6502().execute(1);
|
mySystem->m6502().execute(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void Debugger::getDialogBounds(int* x, int* y, int* w, int* h)
|
||||||
|
{
|
||||||
|
int userHeight = myOSystem->settings().getInt("debugheight");
|
||||||
|
if(userHeight < kDebuggerLines)
|
||||||
|
{
|
||||||
|
userHeight = kDebuggerLines;
|
||||||
|
myOSystem->settings().setInt("debugheight", userHeight);
|
||||||
|
}
|
||||||
|
userHeight = (userHeight + 3) * kDebuggerLineHeight - 8;
|
||||||
|
|
||||||
|
*x = 0;
|
||||||
|
*y = myConsole->mediaSource().height();
|
||||||
|
*w = kDebuggerWidth;
|
||||||
|
*h = userHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void Debugger::resizeDialog()
|
||||||
|
{
|
||||||
|
cerr << "Debugger::resizeDialog()\n";
|
||||||
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Debugger.hxx,v 1.50 2005-07-14 11:28:37 stephena Exp $
|
// $Id: Debugger.hxx,v 1.51 2005-07-14 15:13:14 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef DEBUGGER_HXX
|
#ifndef DEBUGGER_HXX
|
||||||
|
@ -52,7 +52,7 @@ enum {
|
||||||
for all debugging operations in Stella (parser, 6502 debugger, etc).
|
for all debugging operations in Stella (parser, 6502 debugger, etc).
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: Debugger.hxx,v 1.50 2005-07-14 11:28:37 stephena Exp $
|
@version $Id: Debugger.hxx,v 1.51 2005-07-14 15:13:14 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class Debugger : public DialogContainer
|
class Debugger : public DialogContainer
|
||||||
{
|
{
|
||||||
|
@ -232,6 +232,17 @@ class Debugger : public DialogContainer
|
||||||
*/
|
*/
|
||||||
void setQuitState();
|
void setQuitState();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Get the dimensions of the debugger dialog (takes mediasource into account)
|
||||||
|
*/
|
||||||
|
void getDialogBounds(int* x, int* y, int* w, int* h);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Resize the debugger dialog based on the current dimensions from
|
||||||
|
getDialogBounds.
|
||||||
|
*/
|
||||||
|
void resizeDialog();
|
||||||
|
|
||||||
void toggleBreakPoint(int bp);
|
void toggleBreakPoint(int bp);
|
||||||
|
|
||||||
bool breakPoint(int bp);
|
bool breakPoint(int bp);
|
||||||
|
|
Loading…
Reference in New Issue