diff --git a/stella/src/debugger/EquateList.cxx b/stella/src/debugger/EquateList.cxx index dc4091ea9..7b70259ea 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.15 2005-06-24 00:03:39 urchlay Exp $ +// $Id: EquateList.cxx,v 1.16 2005-06-25 01:13:00 urchlay Exp $ //============================================================================ #include @@ -182,9 +182,11 @@ bool EquateList::saveFile(string file) { out << "--- Symbol List (sorted by symbol)" << endl; - int hardSize = sizeof(hardCodedEquates)/sizeof(struct Equate); + // we don't have these pre-loaded any more. + // int hardSize = sizeof(hardCodedEquates)/sizeof(struct Equate); + // for(int i=hardSize; i= 0) { sprintf(buf, "%-24s %04x \n", ourVcsEquates[i].label, a); @@ -209,13 +211,19 @@ string EquateList::loadFile(string file) { if(!in.is_open()) return "Unable to read symbols from " + file; - int hardSize = sizeof(hardCodedEquates)/sizeof(struct Equate); // Make sure the hard-coded equates show up first ourVcsEquates.clear(); + + /* + // Don't preload these: they cause more trouble than they're worth + // Besides which, any sane symfile will already have them all. + + int hardSize = sizeof(hardCodedEquates)/sizeof(struct Equate); for(int i=0; idebugger().equates()->countCompletions(str + lastSpace + 1); if(possibilities < 1) { delete[] str; break; } + nextLine(); + const char *got = instance()->debugger().equates()->getCompletions(); if(possibilities == 1) { // add to buffer as though user typed it (plus a space) _currentPos = _promptStartPos + lastSpace + 1; while(*got != '\0') { - _buffer[_currentPos++] = *got++; + putcharIntern(*got++); } - _buffer[_currentPos++] = ' '; + putcharIntern(' '); _promptEndPos = _currentPos; } else { - // add to buffer as-is, then add PROMPT plus whatever the user's typed + // add to buffer as-is, then add PROMPT plus whatever we have so far + _currentPos = _promptStartPos + lastSpace + 1; + + print("\n"); print(got); print("\n"); print(PROMPT); - print(str); - int offset = _currentPos - oldPos; - _promptStartPos += offset; - _promptEndPos += offset; + + _promptStartPos = _currentPos; + + for(i=0; idebugger().equates()->getCompletionPrefix() ); + _promptEndPos = _currentPos; } draw(); delete[] str;