Added loading of a banks worth of data to RomWidget, from addresses

$F000 to $FFFF.

Updated both debugger disassemble() methods to never pass $FFFF
when disassembling data.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@739 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-08-24 22:01:45 +00:00
parent 9d0060a6ac
commit 2370bb9764
5 changed files with 33 additions and 21 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.86 2005-08-24 13:18:02 stephena Exp $
// $Id: Debugger.cxx,v 1.87 2005-08-24 22:01:45 stephena Exp $
//============================================================================
#include "bspf.hxx"
@ -772,14 +772,15 @@ const string& Debugger::disassemble(int start, int lines) {
result += " ";
result += buf;
result += "\n";
} while(--lines > 0);
result += "\n";
} while(--lines > 0 && start <= 0xffff);
return result;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Debugger::disassemble(StringList& list, int start, int lines)
void Debugger::disassemble(StringList& addr, StringList& data,
int start, int lines)
{
char buf[255], bbuf[255];
string result;
@ -805,9 +806,10 @@ void Debugger::disassemble(StringList& list, int start, int lines)
result += " ";
result += buf;
list.push_back(result);
addr.push_back(label);
data.push_back(result);
} while(--lines > 0);
} while(--lines > 0 && start <= 0xffff);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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.hxx,v 1.70 2005-08-24 13:18:02 stephena Exp $
// $Id: Debugger.hxx,v 1.71 2005-08-24 22:01:45 stephena Exp $
//============================================================================
#ifndef DEBUGGER_HXX
@ -76,7 +76,7 @@ typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)();
for all debugging operations in Stella (parser, 6502 debugger, etc).
@author Stephen Anthony
@version $Id: Debugger.hxx,v 1.70 2005-08-24 13:18:02 stephena Exp $
@version $Id: Debugger.hxx,v 1.71 2005-08-24 22:01:45 stephena Exp $
*/
class Debugger : public DialogContainer
{
@ -185,9 +185,9 @@ class Debugger : public DialogContainer
/**
Disassemble from the starting address the specified number of lines
and place result in given stringlist.
and place addresses and data in given arrays.
*/
void disassemble(StringList& list, int start, int lines);
void disassemble(StringList& addr, StringList& data, int start, int lines);
int step();
int trace();

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: RomWidget.cxx,v 1.4 2005-08-24 13:18:02 stephena Exp $
// $Id: RomWidget.cxx,v 1.5 2005-08-24 22:01:45 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -31,7 +31,8 @@ RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
: Widget(boss, x, y, 16, 16),
CommandSender(boss),
myFirstLoad(true),
mySourceAvailable(false)
mySourceAvailable(false),
myCurrentBank(-1)
{
int w = 58 * font.getMaxCharWidth(),
h = 31 * font.getLineHeight();
@ -76,7 +77,8 @@ void RomWidget::loadConfig()
should be filled with new data.
*/
cerr << "RomWidget::loadConfig()\n";
if(myFirstLoad) // load the whole bank
// Only reload full bank when necessary
if(myFirstLoad || myCurrentBank != instance()->debugger().getBank())
{
initialUpdate();
myFirstLoad = false;
@ -92,19 +94,22 @@ void RomWidget::initialUpdate()
{
Debugger& dbg = instance()->debugger();
myCurrentBank = dbg.getBank();
// Fill romlist with entire ROM (FIXME - only fill with current bank)
if(mySourceAvailable)
; // FIXME
else
{
StringList l;
BoolArray b;
StringList addr, data;
BoolArray state;
dbg.disassemble(l, 0, 2048); // FIXME - use bank size
for(int i = 0; i < 2048; ++i)
b.push_back(false);
// Disassemble entire bank (up to 4096 lines)
dbg.disassemble(addr, data, 0xf000, 4096);
for(unsigned int i = 0; i < data.size(); ++i)
state.push_back(false);
myRomList->setList(l, b);
myRomList->setList(data, state);
}
}

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: RomWidget.hxx,v 1.2 2005-08-24 13:18:02 stephena Exp $
// $Id: RomWidget.hxx,v 1.3 2005-08-24 22:01:45 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -25,10 +25,13 @@
class GuiObject;
class CheckListWidget;
#include <map>
#include "Array.hxx"
#include "Widget.hxx"
#include "Command.hxx"
typedef multimap<int,int> LinePCMapping;
class RomWidget : public Widget, public CommandSender
{
@ -47,8 +50,11 @@ class RomWidget : public Widget, public CommandSender
private:
CheckListWidget* myRomList;
LinePCMapping myLinePCMapping;
bool myFirstLoad;
bool mySourceAvailable;
int myCurrentBank;
};
#endif

View File

@ -12,7 +12,6 @@ MODULE_OBJS := \
src/gui/DialogContainer.o \
src/gui/Dialog.o \
src/gui/EditableWidget.o \
src/gui/EditNumWidget.o \
src/gui/EditTextWidget.o \
src/gui/EventMappingDialog.o \
src/gui/Font.o \