Fixed bug whereby changes made to RAM from frame advance weren't showing

up in the RamWidget.  FrameBuffer::advance() now advances all frames and
then returns, instead of setting a flag to advance and then return
immediately (RAM wasn't being updated until the frames where advanced,
but by that point we'd returned from the method).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@596 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-07-03 00:53:59 +00:00
parent a7fefcd123
commit 1ba494a859
7 changed files with 40 additions and 29 deletions

View File

@ -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();
}

View File

@ -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 <sstream>
@ -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)
{

View File

@ -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.

View File

@ -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;

View File

@ -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;

View File

@ -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]; }

View File

@ -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);
}