diff --git a/stella/src/common/FrameBufferGL.cxx b/stella/src/common/FrameBufferGL.cxx index 22e7e71df..c14e7bfd5 100644 --- a/stella/src/common/FrameBufferGL.cxx +++ b/stella/src/common/FrameBufferGL.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: FrameBufferGL.cxx,v 1.30 2005-06-16 00:55:56 stephena Exp $ +// $Id: FrameBufferGL.cxx,v 1.31 2005-06-21 23:01:23 stephena Exp $ //============================================================================ #include @@ -32,9 +32,10 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FrameBufferGL::FrameBufferGL(OSystem* osystem) : FrameBuffer(osystem), - myTexture(0), + myTexture(NULL), myScreenmode(0), myScreenmodeCount(0), + myTextureID(0), myFilterParam(GL_NEAREST), myFilterParamName("GL_NEAREST"), myFSScaleFactor(1.0) diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index f9acd8876..8f95a49e7 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.25 2005-06-21 18:46:33 stephena Exp $ +// $Id: Debugger.cxx,v 1.26 2005-06-21 23:01:24 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -274,18 +274,19 @@ void Debugger::writeRAM(uInt16 addr, uInt8 value) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -const string Debugger::setRAM(int argCount, int *args) { +const string Debugger::setRAM(IntArray args) { char buf[10]; + int count = args.size(); int address = args[0]; - for(int i=1; ipoke(address++, args[i]); string ret = "changed "; - sprintf(buf, "%d", argCount-1); + sprintf(buf, "%d", count-1); ret += buf; ret += " location"; - if(argCount > 2) + if(count > 2) ret += "s"; return ret; } diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index dd2eb9d25..9e7aa2b7f 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.21 2005-06-21 04:30:49 urchlay Exp $ +// $Id: Debugger.hxx,v 1.22 2005-06-21 23:01:24 stephena Exp $ //============================================================================ #ifndef DEBUGGER_HXX @@ -51,7 +51,7 @@ enum { for all debugging operations in Stella (parser, 6502 debugger, etc). @author Stephen Anthony - @version $Id: Debugger.hxx,v 1.21 2005-06-21 04:30:49 urchlay Exp $ + @version $Id: Debugger.hxx,v 1.22 2005-06-21 23:01:24 stephena Exp $ */ class Debugger : public DialogContainer { @@ -168,7 +168,7 @@ class Debugger : public DialogContainer void writeRAM(uInt16 addr, uInt8 value); // set a bunch of RAM locations at once - const string setRAM(int argCount, int *args); + const string setRAM(IntArray args); bool start(); void quit(); diff --git a/stella/src/debugger/DebuggerParser.cxx b/stella/src/debugger/DebuggerParser.cxx index 607f610b7..6d935a287 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.23 2005-06-21 04:30:49 urchlay Exp $ +// $Id: DebuggerParser.cxx,v 1.24 2005-06-21 23:01:24 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -35,11 +35,12 @@ DebuggerParser::DebuggerParser(Debugger* d) { done = false; defaultBase = kBASE_16; - for(int i=0; ic_str()) != '\0') { + // Clear the args, since we're going to pass them to eval() + argStrings.clear(); + args.clear(); + for(unsigned int i=0; ic_str()) == '\0') { - string *w = new string(watch); - watches[i] = w; - return "Added watch"; - } - } - return "Can't add watch: Too many watches"; + watches.push_back(watch); + return "Added watch"; } void DebuggerParser::delAllWatches() { - for(int i=0; i= kMAX_WATCHES) + if(which < 0 || which >= (int)watches.size()) return "no such watch"; else - watches[which] = new string; + watches.remove_at(which); return "removed watch"; } @@ -386,7 +383,7 @@ string DebuggerParser::run(const string& command) { // "verb" is the command, stripped of any arguments. // In the if/else below, put shorter command names first. // In case of conflicts (e.g. user enters "t", possible - // commands are "tia" and "trace"), try to guess which + // commands are "tia" and "trace"), try to guess which // will be used more often, and put it first. The user // can always disambiguate: "ti" is short for "tia", or // "tr" for "trace". @@ -462,7 +459,7 @@ string DebuggerParser::run(const string& command) { else if(argCount == 1) return "missing data (need 2 or more args)"; else - result = debugger->setRAM(argCount, args); + result = debugger->setRAM(args); } else if(subStringMatch(verb, "tia")) { result = debugger->dumpTIA(); } else if(subStringMatch(verb, "reset")) { @@ -526,6 +523,9 @@ string DebuggerParser::run(const string& command) { delAllWatches(); return "cleared all watches"; } else if(subStringMatch(verb, "watch")) { + if(argCount != 1) + return "one argument required"; + addWatch(argStrings[0]); } else if(subStringMatch(verb, "delwatch")) { if(argCount == 1) diff --git a/stella/src/debugger/DebuggerParser.hxx b/stella/src/debugger/DebuggerParser.hxx index 0003a25cb..c9174a3c9 100644 --- a/stella/src/debugger/DebuggerParser.hxx +++ b/stella/src/debugger/DebuggerParser.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: DebuggerParser.hxx,v 1.14 2005-06-21 04:30:49 urchlay Exp $ +// $Id: DebuggerParser.hxx,v 1.15 2005-06-21 23:01:25 stephena Exp $ //============================================================================ #ifndef DEBUGGER_PARSER_HXX @@ -23,9 +23,7 @@ class Debugger; #include "bspf.hxx" #include "EquateList.hxx" - -#define kMAX_ARGS 100 -#define kMAX_WATCHES 10 +#include "Array.hxx" typedef enum { kBASE_16, @@ -34,6 +32,9 @@ typedef enum { kBASE_DEFAULT } BaseFormat; +typedef GUI::Array IntArray; +typedef GUI::Array StringArray; + class DebuggerParser { public: @@ -66,11 +67,13 @@ class DebuggerParser bool done; string verb; - int args[kMAX_ARGS+1]; // FIXME: should be dynamic - string argStrings[kMAX_ARGS+1]; + + IntArray args; + StringArray argStrings; int argCount; + BaseFormat defaultBase; - string *watches[kMAX_WATCHES]; // FIXME: remove the limit sometime + StringArray watches; }; #endif diff --git a/stella/src/debugger/EquateList.cxx b/stella/src/debugger/EquateList.cxx index b79a778c3..bc5da2733 100644 --- a/stella/src/debugger/EquateList.cxx +++ b/stella/src/debugger/EquateList.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: EquateList.cxx,v 1.11 2005-06-21 18:46:33 stephena Exp $ +// $Id: EquateList.cxx,v 1.12 2005-06-21 23:01:25 stephena Exp $ //============================================================================ #include @@ -107,7 +107,6 @@ EquateList::EquateList() { } EquateList::~EquateList() { -cerr << "EquateList::~EquateList()\n"; ourVcsEquates.clear(); } @@ -170,21 +169,7 @@ string EquateList::loadFile(string file) { if(!in.is_open()) return "Unable to read symbols from " + file; - long start = in.tellg(); // save pointer to beginning of file - -// FIXME - we no longer need # of lines, so this can probably be removed - // iterate over file, count lines - while( !in.eof() ) { - in.getline(buffer, 255); - lines++; - } - - // cerr << "total lines " << lines << endl; - - // allocate enough storage for all the lines plus the - // hard-coded symbols int hardSize = sizeof(hardCodedEquates)/sizeof(struct Equate); - lines = hardSize; // Make sure the hard-coded equates show up first ourVcsEquates.clear(); @@ -192,10 +177,6 @@ string EquateList::loadFile(string file) { ourVcsEquates.push_back(hardCodedEquates[i]); } - // start over, now that we've allocated enough entries. - in.clear(); - in.seekg(start); - while( !in.eof() ) { curVal = 0; curLabel = "";