diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 5fcb27687..0d822c3cc 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.47 2005-07-02 21:15:22 stephena Exp $ +// $Id: Debugger.cxx,v 1.48 2005-07-03 00:53:58 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -475,6 +475,8 @@ void Debugger::loadState(int state) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - int Debugger::step() { + saveRegs(); + int cyc = mySystem->cycles(); mySystem->m6502().execute(1); myTIAdebug->updateTIA(); @@ -499,6 +501,8 @@ int Debugger::trace() { // 32 is the 6502 JSR instruction: if(mySystem->peek(myDebugger->pc()) == 32) { + saveRegs(); + int cyc = mySystem->cycles(); int targetPC = myDebugger->pc() + 3; // return address while(myDebugger->pc() != targetPC) @@ -834,4 +838,3 @@ void Debugger::saveRegs() { oldP = getPS(); oldPC = getPC(); } - diff --git a/stella/src/emucore/FrameBuffer.cxx b/stella/src/emucore/FrameBuffer.cxx index 2b8fb7801..d3f0ca154 100644 --- a/stella/src/emucore/FrameBuffer.cxx +++ b/stella/src/emucore/FrameBuffer.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: FrameBuffer.cxx,v 1.50 2005-07-02 01:28:43 stephena Exp $ +// $Id: FrameBuffer.cxx,v 1.51 2005-07-03 00:53:59 stephena Exp $ //============================================================================ #include @@ -294,6 +294,17 @@ void FrameBuffer::refreshOverlay(bool now) if(now) update(); } +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +void FrameBuffer::advance(int frames) +{ + if(myOSystem->eventHandler().state() != EventHandler::S_DEBUGGER) + return; + + theFrameAdvanceIndicator = frames; + while(theFrameAdvanceIndicator) + update(); +} + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FrameBuffer::showMessage(const string& message) { diff --git a/stella/src/emucore/FrameBuffer.hxx b/stella/src/emucore/FrameBuffer.hxx index ad14fec7a..6bc9a555a 100644 --- a/stella/src/emucore/FrameBuffer.hxx +++ b/stella/src/emucore/FrameBuffer.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: FrameBuffer.hxx,v 1.44 2005-07-02 01:28:43 stephena Exp $ +// $Id: FrameBuffer.hxx,v 1.45 2005-07-03 00:53:59 stephena Exp $ //============================================================================ #ifndef FRAMEBUFFER_HXX @@ -52,7 +52,7 @@ enum FrameStyle { All GUI elements (ala ScummVM) are drawn here as well. @author Stephen Anthony - @version $Id: FrameBuffer.hxx,v 1.44 2005-07-02 01:28:43 stephena Exp $ + @version $Id: FrameBuffer.hxx,v 1.45 2005-07-03 00:53:59 stephena Exp $ */ class FrameBuffer { @@ -148,7 +148,7 @@ class FrameBuffer /** Indicates that the emulation should advance one frame. */ - void advance(int frames) { theFrameAdvanceIndicator = frames; } + void advance(int frames); /** Toggles between fullscreen and window mode. diff --git a/stella/src/gui/CpuWidget.cxx b/stella/src/gui/CpuWidget.cxx index d889af8c0..b1b3f5c97 100644 --- a/stella/src/gui/CpuWidget.cxx +++ b/stella/src/gui/CpuWidget.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: CpuWidget.cxx,v 1.8 2005-07-02 21:15:22 stephena Exp $ +// $Id: CpuWidget.cxx,v 1.9 2005-07-03 00:53:59 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -240,7 +240,9 @@ void CpuWidget::fillGrid() vlist.push_back(dbg.getX()); vlist.push_back(dbg.getY()); - myCpuGrid->setList(alist, vlist); + for(int i = 0; i < 6; ++i) // FIXME - track changes in registers + changed.push_back(false); + myCpuGrid->setList(alist, vlist, changed); // Update the PS register booleans BoolArray b; diff --git a/stella/src/gui/DataGridWidget.cxx b/stella/src/gui/DataGridWidget.cxx index 4157bcf1b..df75bca66 100644 --- a/stella/src/gui/DataGridWidget.cxx +++ b/stella/src/gui/DataGridWidget.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: DataGridWidget.cxx,v 1.6 2005-07-02 21:15:22 stephena Exp $ +// $Id: DataGridWidget.cxx,v 1.7 2005-07-03 00:53:59 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -64,30 +64,21 @@ DataGridWidget::~DataGridWidget() } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void DataGridWidget::setList(const AddrList& alist, const ValueList& vlist) +void DataGridWidget::setList(const AddrList& alist, const ValueList& vlist, + const BoolArray& changed) { int size = vlist.size(); // assume the alist is the same size assert(size == _rows * _cols); _addrList.clear(); _addrStringList.clear(); + _valueList.clear(); _valueStringList.clear(); _changedList.clear(); - // Check for any value changes since last time this method was called - if(_valueList.size() == 0) - { - for(int i = 0; i < size; ++i) - _changedList.push_back(false); - } - else - { - for(int i = 0; i < size; ++i) - _changedList.push_back(_valueList[i] != vlist[i]); - } - _valueList.clear(); - _addrList = alist; - _valueList = vlist; + _addrList = alist; + _valueList = vlist; + _changedList = changed; // An efficiency thing string temp; diff --git a/stella/src/gui/DataGridWidget.hxx b/stella/src/gui/DataGridWidget.hxx index d535f8629..bf1d35503 100644 --- a/stella/src/gui/DataGridWidget.hxx +++ b/stella/src/gui/DataGridWidget.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: DataGridWidget.hxx,v 1.4 2005-07-02 21:15:22 stephena Exp $ +// $Id: DataGridWidget.hxx,v 1.5 2005-07-03 00:53:59 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -50,7 +50,8 @@ class DataGridWidget : public EditableWidget, public CommandSender int colchars, int range, BaseFormat format = kBASE_DEFAULT); virtual ~DataGridWidget(); - void setList(const AddrList& alist, const ValueList& vlist); + void setList(const AddrList& alist, const ValueList& vlist, + const BoolArray& changed); void setSelectedValue(int value); int getSelectedAddr() const { return _addrList[_selectedItem]; } diff --git a/stella/src/gui/RamWidget.cxx b/stella/src/gui/RamWidget.cxx index 71bec8ca9..f528e5095 100644 --- a/stella/src/gui/RamWidget.cxx +++ b/stella/src/gui/RamWidget.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: RamWidget.cxx,v 1.11 2005-07-02 21:15:22 stephena Exp $ +// $Id: RamWidget.cxx,v 1.12 2005-07-03 00:53:59 stephena Exp $ // // Based on code from ScummVM - Scumm Interpreter // Copyright (C) 2002-2004 The ScummVM project @@ -231,12 +231,15 @@ void RamWidget::fillGrid() { AddrList alist; ValueList vlist; + BoolArray changed; + Debugger& dbg = instance()->debugger(); for(unsigned int i = 0; i < kRamSize; i++) { alist.push_back(kRamStart + i); - vlist.push_back(instance()->debugger().readRAM(i)); + vlist.push_back(dbg.readRAM(i)); + changed.push_back(dbg.ramChanged(i)); } - myRamGrid->setList(alist, vlist); + myRamGrid->setList(alist, vlist, changed); }