Fixed debugger issue where a sym file loaded from a previous ROM load

was still being used for the next ROM.  It makes me wonder how many
people use this feature, since this problem was never reported before.

Some general cleanup of the Debugger API.  I generally don't like
pointers, and use (const) references whenever possible.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1440 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2008-03-23 17:43:22 +00:00
parent ee08e375b5
commit bb8ebc853e
13 changed files with 269 additions and 283 deletions

View File

@ -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.119 2008-02-24 16:51:52 stephena Exp $ // $Id: Debugger.cxx,v 1.120 2008-03-23 17:43:21 stephena Exp $
//============================================================================ //============================================================================
#include "bspf.hxx" #include "bspf.hxx"
@ -100,10 +100,10 @@ Debugger::Debugger(OSystem* osystem)
myTiaOutput(NULL), myTiaOutput(NULL),
myTiaZoom(NULL), myTiaZoom(NULL),
myRom(NULL), myRom(NULL),
equateList(NULL), myEquateList(NULL),
breakPoints(NULL), myBreakPoints(NULL),
readTraps(NULL), myReadTraps(NULL),
writeTraps(NULL), myWriteTraps(NULL),
myWidth(1030), myWidth(1030),
myHeight(690) myHeight(690)
{ {
@ -118,10 +118,10 @@ Debugger::Debugger(OSystem* osystem)
// Init parser // Init parser
myParser = new DebuggerParser(this); myParser = new DebuggerParser(this);
equateList = new EquateList(); myEquateList = new EquateList();
breakPoints = new PackedBitArray(0x10000); myBreakPoints = new PackedBitArray(0x10000);
readTraps = new PackedBitArray(0x10000); myReadTraps = new PackedBitArray(0x10000);
writeTraps = new PackedBitArray(0x10000); myWriteTraps = new PackedBitArray(0x10000);
// Allow access to this object from any class // Allow access to this object from any class
// Technically this violates pure OO programming, but since I know // Technically this violates pure OO programming, but since I know
@ -139,10 +139,10 @@ Debugger::~Debugger()
delete myRamDebug; delete myRamDebug;
delete myTiaDebug; delete myTiaDebug;
delete equateList; delete myEquateList;
delete breakPoints; delete myBreakPoints;
delete readTraps; delete myReadTraps;
delete writeTraps; delete myWriteTraps;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -191,6 +191,12 @@ void Debugger::setConsole(Console* console)
delete myTiaDebug; delete myTiaDebug;
myTiaDebug = new TIADebug(this, myConsole); myTiaDebug = new TIADebug(this, myConsole);
// Initialize equates and breakpoints to known state
delete myEquateList;
myEquateList = new EquateList();
clearAllBreakPoints();
clearAllTraps();
autoLoadSymbols(myOSystem->romFile()); autoLoadSymbols(myOSystem->romFile());
loadListFile(); loadListFile();
@ -221,16 +227,17 @@ void Debugger::quit()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::autoLoadSymbols(string fileName) { void Debugger::autoLoadSymbols(string fileName)
{
string file = fileName; string file = fileName;
string::size_type pos; string::size_type pos;
if( (pos = file.find_last_of('.')) != string::npos ) { if( (pos = file.find_last_of('.')) != string::npos )
file.replace(pos, file.size(), ".sym"); file.replace(pos, file.size(), ".sym");
} else { else
file += ".sym"; file += ".sym";
}
string ret = equateList->loadFile(file); string ret = myEquateList->loadFile(file);
// cerr << "loading syms from file " << file << ": " << ret << endl; // cerr << "loading syms from file " << file << ": " << ret << endl;
} }
@ -289,7 +296,7 @@ string Debugger::loadListFile(string f)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string Debugger::getSourceLines(int addr) string Debugger::getSourceLines(int addr) const
{ {
if(sourceLines.size() == 0) if(sourceLines.size() == 0)
return ""; return "";
@ -452,16 +459,18 @@ const string Debugger::cpuState()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/* The timers, joysticks, and switches can be read via peeks, so /* The timers, joysticks, and switches can be read via peeks, so
I didn't write a separate RIOTDebug class. */ I didn't write a separate RIOTDebug class. */
const string Debugger::riotState() { const string Debugger::riotState()
{
string ret; string ret;
// TODO: inverse video for changed regs. Core needs to track this. // TODO: inverse video for changed regs. Core needs to track this.
// TODO: keyboard controllers? // TODO: keyboard controllers?
for(int i=0x280; i<0x284; i++) { for(int i=0x280; i<0x284; i++)
{
ret += valueToString(i); ret += valueToString(i);
ret += "/"; ret += "/";
ret += equates()->getFormatted(i, 2); ret += equates().getFormatted(i, 2);
ret += "="; ret += "=";
ret += valueToString(mySystem->peek(i)); ret += valueToString(mySystem->peek(i));
ret += " "; ret += " ";
@ -532,52 +541,24 @@ const string Debugger::riotState() {
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::reset() { void Debugger::reset()
{
int pc = myCpuDebug->dPeek(0xfffc); int pc = myCpuDebug->dPeek(0xfffc);
myCpuDebug->setPC(pc); myCpuDebug->setPC(pc);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::formatFlags(BoolArray& b, char *out) { void Debugger::formatFlags(BoolArray& b, char *out)
{
// NV-BDIZC // NV-BDIZC
out[0] = myCpuDebug->n() ? 'N' : 'n';
if(myCpuDebug->n()) out[1] = myCpuDebug->v() ? 'V' : 'v';
out[0] = 'N';
else
out[0] = 'n';
if(myCpuDebug->v())
out[1] = 'V';
else
out[1] = 'v';
out[2] = '-'; out[2] = '-';
out[3] = myCpuDebug->b() ? 'B' : 'b';
if(myCpuDebug->b()) out[4] = myCpuDebug->d() ? 'D' : 'd';
out[3] = 'B'; out[5] = myCpuDebug->i() ? 'I' : 'i';
else out[6] = myCpuDebug->z() ? 'Z' : 'z';
out[3] = 'b'; out[7] = myCpuDebug->c() ? 'C' : 'c';
if(myCpuDebug->d())
out[4] = 'D';
else
out[4] = 'd';
if(myCpuDebug->i())
out[5] = 'I';
else
out[5] = 'i';
if(myCpuDebug->z())
out[6] = 'Z';
else
out[6] = 'z';
if(myCpuDebug->c())
out[7] = 'C';
else
out[7] = 'c';
out[8] = '\0'; out[8] = '\0';
} }
@ -585,7 +566,8 @@ void Debugger::formatFlags(BoolArray& b, char *out) {
/* Element 0 of args is the address. The remaining elements are the data /* Element 0 of args is the address. The remaining elements are the data
to poke, starting at the given address. to poke, starting at the given address.
*/ */
const string Debugger::setRAM(IntArray& args) { const string Debugger::setRAM(IntArray& args)
{
char buf[10]; char buf[10];
int count = args.size(); int count = args.size();
@ -729,80 +711,84 @@ int Debugger::trace()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
EquateList *Debugger::equates() { void Debugger::toggleBreakPoint(int bp)
return equateList; {
} mySystem->m6502().setBreakPoints(myBreakPoints);
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::toggleBreakPoint(int bp) {
mySystem->m6502().setBreakPoints(breakPoints);
if(bp < 0) bp = myCpuDebug->pc(); if(bp < 0) bp = myCpuDebug->pc();
breakPoints->toggle(bp); myBreakPoints->toggle(bp);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::setBreakPoint(int bp, bool set) void Debugger::setBreakPoint(int bp, bool set)
{ {
mySystem->m6502().setBreakPoints(breakPoints); mySystem->m6502().setBreakPoints(myBreakPoints);
if(bp < 0) bp = myCpuDebug->pc(); if(bp < 0) bp = myCpuDebug->pc();
if(set) if(set)
breakPoints->set(bp); myBreakPoints->set(bp);
else else
breakPoints->clear(bp); myBreakPoints->clear(bp);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Debugger::breakPoint(int bp) { bool Debugger::breakPoint(int bp)
{
if(bp < 0) bp = myCpuDebug->pc(); if(bp < 0) bp = myCpuDebug->pc();
return breakPoints->isSet(bp) != 0; return myBreakPoints->isSet(bp) != 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::toggleReadTrap(int t) { void Debugger::toggleReadTrap(int t)
mySystem->m6502().setTraps(readTraps, writeTraps); {
readTraps->toggle(t); mySystem->m6502().setTraps(myReadTraps, myWriteTraps);
myReadTraps->toggle(t);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::toggleWriteTrap(int t) { void Debugger::toggleWriteTrap(int t)
mySystem->m6502().setTraps(readTraps, writeTraps); {
writeTraps->toggle(t); mySystem->m6502().setTraps(myReadTraps, myWriteTraps);
myWriteTraps->toggle(t);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::toggleTrap(int t) { void Debugger::toggleTrap(int t)
{
toggleReadTrap(t); toggleReadTrap(t);
toggleWriteTrap(t); toggleWriteTrap(t);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Debugger::readTrap(int t) { bool Debugger::readTrap(int t)
return readTraps->isSet(t) != 0; {
return myReadTraps->isSet(t) != 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Debugger::writeTrap(int t) { bool Debugger::writeTrap(int t)
return writeTraps->isSet(t) != 0; {
return myWriteTraps->isSet(t) != 0;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int Debugger::cycles() { int Debugger::cycles()
{
return mySystem->cycles(); return mySystem->cycles();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string& Debugger::disassemble(int start, int lines) { const string& Debugger::disassemble(int start, int lines)
{
char buf[255], bbuf[255]; char buf[255], bbuf[255];
static string result; static string result;
result = ""; result = "";
do { do {
const char *label = equateList->getFormatted(start, 4); const char *label = myEquateList->getFormatted(start, 4);
result += label; result += label;
result += ": "; result += ": ";
int count = myCpuDebug->disassemble(start, buf, equateList); int count = myCpuDebug->disassemble(start, buf, myEquateList);
for(int i=0; i<count; i++) { for(int i=0; i<count; i++) {
sprintf(bbuf, "%02x ", peek(start++)); sprintf(bbuf, "%02x ", peek(start++));
@ -830,11 +816,11 @@ void Debugger::disassemble(IntArray& addr, StringList& addrLabel,
do do
{ {
tmp = equateList->getFormatted(start, 4); tmp = myEquateList->getFormatted(start, 4);
addrLabel.push_back(tmp + ":"); addrLabel.push_back(tmp + ":");
addr.push_back(start); addr.push_back(start);
int count = myCpuDebug->disassemble(start, buf, equateList); int count = myCpuDebug->disassemble(start, buf, myEquateList);
tmp = ""; tmp = "";
for(int i=0; i<count; i++) { for(int i=0; i<count; i++) {
@ -873,18 +859,18 @@ void Debugger::nextFrame(int frames)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::clearAllBreakPoints() void Debugger::clearAllBreakPoints()
{ {
delete breakPoints; delete myBreakPoints;
breakPoints = new PackedBitArray(0x10000); myBreakPoints = new PackedBitArray(0x10000);
mySystem->m6502().setBreakPoints(NULL); mySystem->m6502().setBreakPoints(NULL);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::clearAllTraps() void Debugger::clearAllTraps()
{ {
delete readTraps; delete myReadTraps;
delete writeTraps; delete myWriteTraps;
readTraps = new PackedBitArray(0x10000); myReadTraps = new PackedBitArray(0x10000);
writeTraps = new PackedBitArray(0x10000); myWriteTraps = new PackedBitArray(0x10000);
mySystem->m6502().setTraps(NULL, NULL); mySystem->m6502().setTraps(NULL, NULL);
} }
@ -909,7 +895,7 @@ string Debugger::showWatches()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::addLabel(string label, int address) void Debugger::addLabel(string label, int address)
{ {
equateList->addEquate(label, address); myEquateList->addEquate(label, address);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -944,10 +930,9 @@ int Debugger::bankCount()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const char *Debugger::getCartType() string Debugger::getCartType()
{ {
return myConsole->cartridge().name().c_str(); return myConsole->cartridge().name();
// FIXME - maybe whatever is calling this should use a string instead
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -982,7 +967,7 @@ void Debugger::setQuitState()
// execute one instruction on quit. If we're // execute one instruction on quit. If we're
// sitting at a breakpoint/trap, this will get us past it. // sitting at a breakpoint/trap, this will get us past it.
// Somehow this feels like a hack to me, but I don't know why // Somehow this feels like a hack to me, but I don't know why
// if(breakPoints->isSet(myCpuDebug->pc())) // if(myBreakPoints->isSet(myCpuDebug->pc()))
mySystem->m6502().execute(1); mySystem->m6502().execute(1);
} }
@ -1055,7 +1040,7 @@ GUI::Rect Debugger::getTabBounds() const
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::addFunction(string name, string definition, void Debugger::addFunction(const string& name, const string& definition,
Expression* exp, bool builtin) Expression* exp, bool builtin)
{ {
functions.insert(make_pair(name, exp)); functions.insert(make_pair(name, exp));
@ -1064,7 +1049,7 @@ void Debugger::addFunction(string name, string definition,
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::delFunction(string name) void Debugger::delFunction(const string& name)
{ {
FunctionMap::iterator iter = functions.find(name); FunctionMap::iterator iter = functions.find(name);
if(iter == functions.end()) if(iter == functions.end())
@ -1081,7 +1066,7 @@ void Debugger::delFunction(string name)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expression *Debugger::getFunction(string name) Expression* Debugger::getFunction(const string& name)
{ {
FunctionMap::iterator iter = functions.find(name); FunctionMap::iterator iter = functions.find(name);
if(iter == functions.end()) if(iter == functions.end())
@ -1091,7 +1076,7 @@ Expression *Debugger::getFunction(string name)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Debugger::getFunctionDef(string name) string Debugger::getFunctionDef(const string& name)
{ {
FunctionDefMap::iterator iter = functionDefs.find(name); FunctionDefMap::iterator iter = functionDefs.find(name);
if(iter == functionDefs.end()) if(iter == functionDefs.end())
@ -1101,13 +1086,13 @@ string Debugger::getFunctionDef(string name)
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const FunctionDefMap Debugger::getFunctionDefMap() const FunctionDefMap Debugger::getFunctionDefMap() const
{ {
return functionDefs; return functionDefs;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const string Debugger::builtinHelp() const string Debugger::builtinHelp() const
{ {
string result; string result;
@ -1125,7 +1110,7 @@ const string Debugger::builtinHelp()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Debugger::saveROM(string filename) bool Debugger::saveROM(const string& filename) const
{ {
// TODO: error checking // TODO: error checking
ofstream *out = new ofstream(filename.c_str(), ios::out | ios::binary); ofstream *out = new ofstream(filename.c_str(), ios::out | ios::binary);

View File

@ -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.91 2008-02-06 13:45:19 stephena Exp $ // $Id: Debugger.hxx,v 1.92 2008-03-23 17:43:21 stephena Exp $
//============================================================================ //============================================================================
#ifndef DEBUGGER_HXX #ifndef DEBUGGER_HXX
@ -69,10 +69,13 @@ typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)();
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.91 2008-02-06 13:45:19 stephena Exp $ @version $Id: Debugger.hxx,v 1.92 2008-03-23 17:43:21 stephena Exp $
*/ */
class Debugger : public DialogContainer class Debugger : public DialogContainer
{ {
// Make these friend classes, to ease communications with the debugger
// Although it isn't enforced, these classes should use accessor methods
// directly, and not touch the instance variables
friend class DebuggerDialog; friend class DebuggerDialog;
friend class DebuggerParser; friend class DebuggerParser;
friend class EventHandler; friend class EventHandler;
@ -121,12 +124,14 @@ class Debugger : public DialogContainer
*/ */
void quit(); void quit();
void addFunction(string name, string def, Expression *exp, bool builtin=false); void addFunction(const string& name, const string& def,
string getFunctionDef(string name); Expression* exp, bool builtin = false);
void delFunction(string name); void delFunction(const string& name);
Expression *getFunction(string name); Expression* getFunction(const string& name);
const FunctionDefMap getFunctionDefMap();
const string builtinHelp(); string getFunctionDef(const string& name);
const FunctionDefMap getFunctionDefMap() const;
const string builtinHelp() const;
/** /**
The debugger subsystem responsible for all CPU state The debugger subsystem responsible for all CPU state
@ -146,13 +151,12 @@ class Debugger : public DialogContainer
/** /**
List of English-like aliases for 6502 opcodes and operands. List of English-like aliases for 6502 opcodes and operands.
*/ */
EquateList *equates(); EquateList& equates() const { return *myEquateList; }
DebuggerParser *parser() { return myParser; } DebuggerParser& parser() const { return *myParser; }
PackedBitArray& breakpoints() const { return *myBreakPoints; }
PackedBitArray *breakpoints() { return breakPoints; } PackedBitArray& readtraps() const { return *myReadTraps; }
PackedBitArray *readtraps() { return readTraps; } PackedBitArray& writetraps() const { return *myWriteTraps; }
PackedBitArray *writetraps() { return writeTraps; }
/** /**
Run the debugger command and return the result. Run the debugger command and return the result.
@ -274,10 +278,10 @@ class Debugger : public DialogContainer
void setBreakPoint(int bp, bool set); void setBreakPoint(int bp, bool set);
string loadListFile(string f = ""); string loadListFile(string f = "");
const string getSourceLines(int addr); string getSourceLines(int addr) const;
bool haveListFile() { return sourceLines.size() > 0; } bool haveListFile() const { return sourceLines.size() > 0; }
bool saveROM(string filename); bool saveROM(const string& filename) const;
bool setBank(int bank); bool setBank(int bank);
bool patchROM(int addr, int value); bool patchROM(int addr, int value);
@ -336,7 +340,7 @@ class Debugger : public DialogContainer
PromptWidget *prompt() { return myPrompt; } PromptWidget *prompt() { return myPrompt; }
void addLabel(string label, int address); void addLabel(string label, int address);
const char *getCartType(); string getCartType();
void saveState(int state); void saveState(int state);
void loadState(int state); void loadState(int state);
@ -360,10 +364,10 @@ class Debugger : public DialogContainer
RomWidget* myRom; RomWidget* myRom;
EditTextWidget* myMessage; EditTextWidget* myMessage;
EquateList *equateList; EquateList* myEquateList;
PackedBitArray *breakPoints; PackedBitArray* myBreakPoints;
PackedBitArray *readTraps; PackedBitArray* myReadTraps;
PackedBitArray *writeTraps; PackedBitArray* myWriteTraps;
PromptWidget* myPrompt; PromptWidget* myPrompt;
ListFile sourceLines; ListFile sourceLines;

View File

@ -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: DebuggerExpressions.hxx,v 1.3 2008-02-06 13:45:20 stephena Exp $ // $Id: DebuggerExpressions.hxx,v 1.4 2008-03-23 17:43:21 stephena Exp $
//============================================================================ //============================================================================
#ifndef DEBUGGER_EXPRESSIONS_HXX #ifndef DEBUGGER_EXPRESSIONS_HXX
@ -123,7 +123,7 @@ class EquateExpression : public Expression
{ {
public: public:
EquateExpression(const string& label) : Expression(0, 0), myLabel(label) {} EquateExpression(const string& label) : Expression(0, 0), myLabel(label) {}
uInt16 evaluate() { return Debugger::debugger().equates()->getAddress(myLabel); } uInt16 evaluate() { return Debugger::debugger().equates().getAddress(myLabel); }
private: private:
string myLabel; string myLabel;

View File

@ -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: DebuggerParser.cxx,v 1.102 2008-02-06 13:45:20 stephena Exp $ // $Id: DebuggerParser.cxx,v 1.103 2008-03-23 17:43:21 stephena Exp $
//============================================================================ //============================================================================
#include <fstream> #include <fstream>
@ -265,7 +265,7 @@ int DebuggerParser::decipher_arg(const string &str)
else if(arg == "pc" || arg == ".") result = state.PC; else if(arg == "pc" || arg == ".") result = state.PC;
else { // Not a special, must be a regular arg: check for label first else { // Not a special, must be a regular arg: check for label first
const char *a = arg.c_str(); const char *a = arg.c_str();
result = debugger->equateList->getAddress(arg); result = debugger->equates().getAddress(arg);
if(result < 0) { // if not label, must be a number if(result < 0) { // if not label, must be a number
if(bin) { // treat as binary if(bin) { // treat as binary
@ -559,7 +559,7 @@ string DebuggerParser::eval()
char buf[50]; char buf[50];
string ret; string ret;
for(int i=0; i<argCount; i++) { for(int i=0; i<argCount; i++) {
string label = debugger->equates()->getLabel(args[i]); string label = debugger->equates().getLabel(args[i]);
if(label != "") { if(label != "") {
ret += label; ret += label;
ret += ": "; ret += ": ";
@ -598,7 +598,7 @@ string DebuggerParser::trapStatus(int addr)
else else
result += " none "; result += " none ";
string l = debugger->equateList->getLabel(addr); string l = debugger->equates().getLabel(addr);
if(l != "") { if(l != "") {
result += " ("; result += " (";
result += l; result += l;
@ -978,8 +978,8 @@ void DebuggerParser::executeListbreaks()
int count = 0; int count = 0;
for(unsigned int i=0; i<0x10000; i++) { for(unsigned int i=0; i<0x10000; i++) {
if(debugger->breakPoints->isSet(i)) { if(debugger->breakpoints().isSet(i)) {
sprintf(buf, "%s ", debugger->equateList->getFormatted(i, 4)); sprintf(buf, "%s ", debugger->equates().getFormatted(i, 4));
commandResult += buf; commandResult += buf;
if(! (++count % 8) ) commandResult += "\n"; if(! (++count % 8) ) commandResult += "\n";
} }
@ -1057,7 +1057,7 @@ void DebuggerParser::executeLoadlist()
// "loadsym" // "loadsym"
void DebuggerParser::executeLoadsym() void DebuggerParser::executeLoadsym()
{ {
commandResult = debugger->equateList->loadFile(argStrings[0]); commandResult = debugger->equates().loadFile(argStrings[0]);
debugger->myRom->invalidate(); debugger->myRom->invalidate();
} }
@ -1221,7 +1221,7 @@ void DebuggerParser::executeSavestate()
// "savesym" // "savesym"
void DebuggerParser::executeSavesym() void DebuggerParser::executeSavesym()
{ {
if(debugger->equateList->saveFile(argStrings[0])) if(debugger->equates().saveFile(argStrings[0]))
commandResult = "saved symbols to file " + argStrings[0]; commandResult = "saved symbols to file " + argStrings[0];
else else
commandResult = red("I/O error"); commandResult = red("I/O error");
@ -1296,7 +1296,7 @@ void DebuggerParser::executeTrapwrite()
// "undef" // "undef"
void DebuggerParser::executeUndef() void DebuggerParser::executeUndef()
{ {
if(debugger->equateList->undefine(argStrings[0])) if(debugger->equates().undefine(argStrings[0]))
{ {
debugger->myRom->invalidate(); debugger->myRom->invalidate();
commandResult = argStrings[0] + " now undefined"; commandResult = argStrings[0] + " now undefined";

View File

@ -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: CpuWidget.cxx,v 1.10 2008-02-06 13:45:20 stephena Exp $ // $Id: CpuWidget.cxx,v 1.11 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -281,5 +281,5 @@ void CpuWidget::fillGrid()
changed.push_back(state.PSbits[i] != oldstate.PSbits[i]); changed.push_back(state.PSbits[i] != oldstate.PSbits[i]);
myPSRegister->setState(state.PSbits, changed); myPSRegister->setState(state.PSbits, changed);
myPCLabel->setEditString(dbg.equates()->getLabel(state.PC, EQF_ROM)); myPCLabel->setEditString(dbg.equates().getLabel(state.PC, EQF_ROM));
} }

View File

@ -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: DebuggerDialog.cxx,v 1.22 2008-02-06 13:45:20 stephena Exp $ // $Id: DebuggerDialog.cxx,v 1.23 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -271,29 +271,29 @@ void DebuggerDialog::addRomArea()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doStep() void DebuggerDialog::doStep()
{ {
instance()->debugger().parser()->run("step"); instance()->debugger().parser().run("step");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doTrace() void DebuggerDialog::doTrace()
{ {
instance()->debugger().parser()->run("trace"); instance()->debugger().parser().run("trace");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doAdvance() void DebuggerDialog::doAdvance()
{ {
instance()->debugger().parser()->run("frame #1"); instance()->debugger().parser().run("frame #1");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doScanlineAdvance() void DebuggerDialog::doScanlineAdvance()
{ {
instance()->debugger().parser()->run("scanline #1"); instance()->debugger().parser().run("scanline #1");
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DebuggerDialog::doExit() void DebuggerDialog::doExit()
{ {
instance()->debugger().parser()->run("run"); instance()->debugger().parser().run("run");
} }

View File

@ -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: PromptWidget.cxx,v 1.22 2008-02-06 13:45:20 stephena Exp $ // $Id: PromptWidget.cxx,v 1.23 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -239,30 +239,30 @@ bool PromptWidget::handleKeyDown(int ascii, int keycode, int modifiers)
if(lastDelimPos < 0) if(lastDelimPos < 0)
{ {
// no delimiters, do command completion: // no delimiters, do command completion:
DebuggerParser *parser = instance()->debugger().parser(); DebuggerParser& parser = instance()->debugger().parser();
possibilities = parser->countCompletions(str); possibilities = parser.countCompletions(str);
if(possibilities < 1) { if(possibilities < 1) {
delete[] str; delete[] str;
break; break;
} }
completionList = parser->getCompletions(); completionList = parser.getCompletions();
prefix = parser->getCompletionPrefix(); prefix = parser.getCompletionPrefix();
} }
else else
{ {
// we got a delimiter, so this must be a label: // we got a delimiter, so this must be a label:
EquateList *equates = instance()->debugger().equates(); EquateList& equates = instance()->debugger().equates();
possibilities = equates->countCompletions(str + lastDelimPos + 1); possibilities = equates.countCompletions(str + lastDelimPos + 1);
if(possibilities < 1) { if(possibilities < 1) {
delete[] str; delete[] str;
break; break;
} }
completionList = equates->getCompletions(); completionList = equates.getCompletions();
prefix = equates->getCompletionPrefix(); prefix = equates.getCompletionPrefix();
} }
if(possibilities == 1) if(possibilities == 1)

View File

@ -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: RamWidget.cxx,v 1.15 2008-02-24 16:51:52 stephena Exp $ // $Id: RamWidget.cxx,v 1.16 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -177,7 +177,7 @@ void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
value = myRamGrid->getSelectedValue(); value = myRamGrid->getSelectedValue();
myLabel->setEditString( myLabel->setEditString(
instance()->debugger().equates()->getLabel(addr+kRamStart, EQF_RAM)); instance()->debugger().equates().getLabel(addr+kRamStart, EQF_RAM));
myDecValue->setEditString(instance()->debugger().valueToString(value, kBASE_10)); myDecValue->setEditString(instance()->debugger().valueToString(value, kBASE_10));
myBinValue->setEditString(instance()->debugger().valueToString(value, kBASE_2)); myBinValue->setEditString(instance()->debugger().valueToString(value, kBASE_2));
break; break;

View File

@ -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: RomWidget.cxx,v 1.23 2008-02-06 13:45:20 stephena Exp $ // $Id: RomWidget.cxx,v 1.24 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -217,7 +217,7 @@ void RomWidget::loadConfig()
void RomWidget::initialUpdate() void RomWidget::initialUpdate()
{ {
Debugger& dbg = instance()->debugger(); Debugger& dbg = instance()->debugger();
PackedBitArray* bp = dbg.breakpoints(); PackedBitArray& bp = dbg.breakpoints();
// Reading from ROM might trigger a bankswitch, so save the current bank // Reading from ROM might trigger a bankswitch, so save the current bank
myCurrentBank = dbg.getBank(); myCurrentBank = dbg.getBank();
@ -238,7 +238,7 @@ void RomWidget::initialUpdate()
dbg.disassemble(myAddrList, label, data, disasm, 0xf000, 4096); dbg.disassemble(myAddrList, label, data, disasm, 0xf000, 4096);
for(unsigned int i = 0; i < data.size(); ++i) for(unsigned int i = 0; i < data.size(); ++i)
{ {
if(bp && bp->isSet(myAddrList[i])) if(bp.isSet(myAddrList[i]))
state.push_back(true); state.push_back(true);
else else
state.push_back(false); state.push_back(false);
@ -285,14 +285,14 @@ void RomWidget::patchROM(int data, const string& bytes)
// Temporarily set to base 16, since that's the format the disassembled // Temporarily set to base 16, since that's the format the disassembled
// byte string is in. This eliminates the need to prefix each byte with // byte string is in. This eliminates the need to prefix each byte with
// a '$' character // a '$' character
BaseFormat oldbase = instance()->debugger().parser()->base(); BaseFormat oldbase = instance()->debugger().parser().base();
instance()->debugger().parser()->setBase(kBASE_16); instance()->debugger().parser().setBase(kBASE_16);
command << "rom #" << myAddrList[data] << " " << bytes; command << "rom #" << myAddrList[data] << " " << bytes;
instance()->debugger().run(command.str()); instance()->debugger().run(command.str());
// Restore previous base // Restore previous base
instance()->debugger().parser()->setBase(oldbase); instance()->debugger().parser().setBase(oldbase);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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: TiaOutputWidget.cxx,v 1.14 2008-02-06 13:45:20 stephena Exp $ // $Id: TiaOutputWidget.cxx,v 1.15 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -118,7 +118,7 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in
if(lines > 0) if(lines > 0)
{ {
command << "scanline #" << lines; command << "scanline #" << lines;
instance()->debugger().parser()->run(command.str()); instance()->debugger().parser().run(command.str());
} }
break; break;
} }
@ -128,7 +128,7 @@ void TiaOutputWidget::handleCommand(CommandSender* sender, int cmd, int data, in
ostringstream command; ostringstream command;
int scanline = myClickY + ystart; int scanline = myClickY + ystart;
command << "breakif _scan==#" << scanline; command << "breakif _scan==#" << scanline;
instance()->debugger().parser()->run(command.str()); instance()->debugger().parser().run(command.str());
break; break;
} }

View File

@ -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: TiaWidget.cxx,v 1.9 2008-02-06 13:45:20 stephena Exp $ // $Id: TiaWidget.cxx,v 1.10 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -800,7 +800,7 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
addr = myRamGrid->getSelectedAddr(); addr = myRamGrid->getSelectedAddr();
value = myRamGrid->getSelectedValue(); value = myRamGrid->getSelectedValue();
myLabel->setEditString(dbg.equates()->getLabel(addr)); myLabel->setEditString(dbg.equates().getLabel(addr));
myDecValue->setEditString(dbg.valueToString(value, kBASE_10)); myDecValue->setEditString(dbg.valueToString(value, kBASE_10));
myBinValue->setEditString(dbg.valueToString(value, kBASE_2)); myBinValue->setEditString(dbg.valueToString(value, kBASE_2));

View File

@ -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: FileSnapDialog.cxx,v 1.16 2008-03-23 16:22:46 stephena Exp $ // $Id: FileSnapDialog.cxx,v 1.17 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -41,17 +41,13 @@ FileSnapDialog::FileSnapDialog(
myIsGlobal(boss != 0) myIsGlobal(boss != 0)
{ {
const int lineHeight = font.getLineHeight(), const int lineHeight = font.getLineHeight(),
fontWidth = font.getMaxCharWidth(), buttonWidth = font.getStringWidth("Properties file:") + 20,
buttonWidth = font.getStringWidth("Defaults") + 20,
buttonHeight = font.getLineHeight() + 4; buttonHeight = font.getLineHeight() + 4;
const int vBorder = 8; const int vBorder = 8;
int xpos, ypos, bwidth, bheight; int xpos, ypos;
WidgetArray wid; WidgetArray wid;
ButtonWidget* b; ButtonWidget* b;
bwidth = font.getStringWidth("Properties file:") + 20;
bheight = font.getLineHeight() + 4;
// Set real dimensions // Set real dimensions
// _w = 50 * fontWidth + 10; // _w = 50 * fontWidth + 10;
// _h = 11 * (lineHeight + 4) + 10; // _h = 11 * (lineHeight + 4) + 10;
@ -60,62 +56,62 @@ FileSnapDialog::FileSnapDialog(
// ROM path // ROM path
ButtonWidget* romButton = ButtonWidget* romButton =
new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Rom path:", new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
kChooseRomDirCmd); "Rom path:", kChooseRomDirCmd);
wid.push_back(romButton); wid.push_back(romButton);
xpos += bwidth + 10; xpos += buttonWidth + 10;
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2, myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), ""); _w - xpos - 10, lineHeight, "");
wid.push_back(myRomPath); wid.push_back(myRomPath);
// State directory // State directory
xpos = vBorder; ypos += romButton->getHeight() + 3; xpos = vBorder; ypos += romButton->getHeight() + 3;
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "State path:", b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
kChooseStateDirCmd); "State path:", kChooseStateDirCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += buttonWidth + 10;
myStatePath = new EditTextWidget(this, font, xpos, ypos + 2, myStatePath = new EditTextWidget(this, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), ""); _w - xpos - 10, lineHeight, "");
wid.push_back(myStatePath); wid.push_back(myStatePath);
// Cheat file // Cheat file
xpos = vBorder; ypos += b->getHeight() + 3; xpos = vBorder; ypos += b->getHeight() + 3;
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Cheat file:", b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
kChooseCheatFileCmd); "Cheat file:", kChooseCheatFileCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += buttonWidth + 10;
myCheatFile = new EditTextWidget(this, font, xpos, ypos + 2, myCheatFile = new EditTextWidget(this, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), ""); _w - xpos - 10, lineHeight, "");
wid.push_back(myCheatFile); wid.push_back(myCheatFile);
// Palette file // Palette file
xpos = vBorder; ypos += b->getHeight() + 3; xpos = vBorder; ypos += b->getHeight() + 3;
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Palette file:", b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
kChoosePaletteFileCmd); "Palette file:", kChoosePaletteFileCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += buttonWidth + 10;
myPaletteFile = new EditTextWidget(this, font, xpos, ypos + 2, myPaletteFile = new EditTextWidget(this, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), ""); _w - xpos - 10, lineHeight, "");
wid.push_back(myPaletteFile); wid.push_back(myPaletteFile);
// Properties file // Properties file
xpos = vBorder; ypos += b->getHeight() + 3; xpos = vBorder; ypos += b->getHeight() + 3;
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Properties file:", b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
kChoosePropsFileCmd); "Properties file:", kChoosePropsFileCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += buttonWidth + 10;
myPropsFile = new EditTextWidget(this, font, xpos, ypos + 2, myPropsFile = new EditTextWidget(this, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), ""); _w - xpos - 10, lineHeight, "");
wid.push_back(myPropsFile); wid.push_back(myPropsFile);
// Snapshot path // Snapshot path
xpos = vBorder; ypos += b->getHeight() + 3; xpos = vBorder; ypos += b->getHeight() + 3;
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Snapshot path:", b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
kChooseSnapDirCmd); "Snapshot path:", kChooseSnapDirCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += buttonWidth + 10;
mySnapPath = new EditTextWidget(this, font, xpos, ypos + 2, mySnapPath = new EditTextWidget(this, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), ""); _w - xpos - 10, lineHeight, "");
wid.push_back(mySnapPath); wid.push_back(mySnapPath);
// Snapshot single or multiple saves // Snapshot single or multiple saves
@ -126,7 +122,8 @@ FileSnapDialog::FileSnapDialog(
// Add Defaults, OK and Cancel buttons // Add Defaults, OK and Cancel buttons
b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10, b = new ButtonWidget(this, font, 10, _h - buttonHeight - 10,
buttonWidth, buttonHeight, "Defaults", kDefaultsCmd); font.getStringWidth("Defaults") + 20, buttonHeight,
"Defaults", kDefaultsCmd);
wid.push_back(b); wid.push_back(b);
addOKCancelBGroup(wid, font); addOKCancelBGroup(wid, font);

View File

@ -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: YaccParser.cxx,v 1.23 2008-02-06 13:45:24 stephena Exp $ // $Id: YaccParser.cxx,v 1.24 2008-03-23 17:43:22 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -102,7 +102,7 @@ inline bool is_operator(char x) {
// responsibility, not the lexer's // responsibility, not the lexer's
int const_to_int(char *c) { int const_to_int(char *c) {
// what base is the input in? // what base is the input in?
BaseFormat base = Debugger::debugger().parser()->base(); BaseFormat base = Debugger::debugger().parser().base();
switch(*c) { switch(*c) {
case '\\': case '\\':
@ -261,7 +261,7 @@ int yylex() {
// happen if the user defines a label that matches one of // happen if the user defines a label that matches one of
// the specials. Who would do that, though? // the specials. Who would do that, though?
if(Debugger::debugger().equates()->getAddress(idbuf) > -1) { if(Debugger::debugger().equates().getAddress(idbuf) > -1) {
yylval.equate = idbuf; yylval.equate = idbuf;
return EQUATE; return EQUATE;
} else if( (cpuMeth = getCpuSpecial(idbuf)) ) { } else if( (cpuMeth = getCpuSpecial(idbuf)) ) {