diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 0568ef8c5..daba412e1 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.87 2005-08-24 22:01:45 stephena Exp $ +// $Id: Debugger.cxx,v 1.88 2005-08-25 18:18:48 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -789,6 +789,7 @@ void Debugger::disassemble(StringList& addr, StringList& data, result = ""; const char *label = equateList->getFormatted(start, 4); + addr.push_back(label); result += label; result += ": "; @@ -806,7 +807,6 @@ void Debugger::disassemble(StringList& addr, StringList& data, result += " "; result += buf; - addr.push_back(label); data.push_back(result); } while(--lines > 0 && start <= 0xffff); diff --git a/stella/src/debugger/RomWidget.cxx b/stella/src/debugger/RomWidget.cxx index 3b906f3d4..e51e51021 100644 --- a/stella/src/debugger/RomWidget.cxx +++ b/stella/src/debugger/RomWidget.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: RomWidget.cxx,v 1.5 2005-08-24 22:01:45 stephena Exp $ +// $Id: RomWidget.cxx,v 1.6 2005-08-25 18:18:48 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -62,7 +62,13 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) break; case kListItemChecked: - cerr << "(un)set a breakpoint at address " << data << endl; + // We don't care about state, as breakpoints are turned on + // and off with the same command + // FIXME - at some point, we might want to add 'breakon' + // and 'breakoff' to DebuggerParser, so the states + // don't get out of sync + instance()->debugger().run(string("break " + myAddrList[data])); + break; } } @@ -70,13 +76,7 @@ void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void RomWidget::loadConfig() { - /* FIXME - We need logic here to only fill the grid at startup and when - bankswitching. At other times, we receive 'kListScrolledCmd' - command, which means the current romlist view is invalid and - should be filled with new data. - */ -cerr << "RomWidget::loadConfig()\n"; +//cerr << "RomWidget::loadConfig()\n"; // Only reload full bank when necessary if(myFirstLoad || myCurrentBank != instance()->debugger().getBank()) { @@ -96,16 +96,17 @@ void RomWidget::initialUpdate() myCurrentBank = dbg.getBank(); - // Fill romlist with entire ROM (FIXME - only fill with current bank) + // Fill romlist the current bank of source or disassembly if(mySourceAvailable) ; // FIXME else { - StringList addr, data; + StringList data; BoolArray state; + myAddrList.clear(); // Disassemble entire bank (up to 4096 lines) - dbg.disassemble(addr, data, 0xf000, 4096); + dbg.disassemble(myAddrList, data, 0xf000, 4096); for(unsigned int i = 0; i < data.size(); ++i) state.push_back(false); diff --git a/stella/src/debugger/RomWidget.hxx b/stella/src/debugger/RomWidget.hxx index b61f6b7f8..0123d132c 100644 --- a/stella/src/debugger/RomWidget.hxx +++ b/stella/src/debugger/RomWidget.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: RomWidget.hxx,v 1.3 2005-08-24 22:01:45 stephena Exp $ +// $Id: RomWidget.hxx,v 1.4 2005-08-25 18:18:48 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -24,15 +24,12 @@ class GuiObject; class CheckListWidget; - -#include +class StringList; #include "Array.hxx" #include "Widget.hxx" #include "Command.hxx" -typedef multimap LinePCMapping; - class RomWidget : public Widget, public CommandSender { public: @@ -50,7 +47,7 @@ class RomWidget : public Widget, public CommandSender private: CheckListWidget* myRomList; - LinePCMapping myLinePCMapping; + StringList myAddrList; bool myFirstLoad; bool mySourceAvailable; diff --git a/stella/src/gui/CheckListWidget.cxx b/stella/src/gui/CheckListWidget.cxx index 184ddf607..bf717232c 100644 --- a/stella/src/gui/CheckListWidget.cxx +++ b/stella/src/gui/CheckListWidget.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: CheckListWidget.cxx,v 1.5 2005-08-24 13:18:02 stephena Exp $ +// $Id: CheckListWidget.cxx,v 1.6 2005-08-25 18:18:48 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -180,6 +180,15 @@ GUI::Rect CheckListWidget::getEditRect() const return r; } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +bool CheckListWidget::getState(int line) +{ + if(line < (int)_stateList.size()) + return _stateList[line]; + else + return false; +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CheckListWidget::handleCommand(CommandSender* sender, int cmd, int data, int id) diff --git a/stella/src/gui/CheckListWidget.hxx b/stella/src/gui/CheckListWidget.hxx index 69cbafc1c..2c7c126b8 100644 --- a/stella/src/gui/CheckListWidget.hxx +++ b/stella/src/gui/CheckListWidget.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: CheckListWidget.hxx,v 1.4 2005-08-23 18:32:51 stephena Exp $ +// $Id: CheckListWidget.hxx,v 1.5 2005-08-25 18:18:48 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -51,6 +51,8 @@ class CheckListWidget : public ListWidget void setList(const StringList& list, const BoolArray& state); void setLine(int line, const string& str, const bool& state); + bool getState(int line); + void handleCommand(CommandSender* sender, int cmd, int data, int id); protected: