From 2370bb9764cdb87dc42466d60be0b2806add9625 Mon Sep 17 00:00:00 2001 From: stephena Date: Wed, 24 Aug 2005 22:01:45 +0000 Subject: [PATCH] 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 --- stella/src/debugger/Debugger.cxx | 14 ++++++++------ stella/src/debugger/Debugger.hxx | 8 ++++---- stella/src/debugger/RomWidget.cxx | 23 ++++++++++++++--------- stella/src/debugger/RomWidget.hxx | 8 +++++++- stella/src/gui/module.mk | 1 - 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/stella/src/debugger/Debugger.cxx b/stella/src/debugger/Debugger.cxx index 94efcf7c6..0568ef8c5 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.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); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/stella/src/debugger/Debugger.hxx b/stella/src/debugger/Debugger.hxx index 12fb947fe..8fb9a2ae8 100644 --- a/stella/src/debugger/Debugger.hxx +++ b/stella/src/debugger/Debugger.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: 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(); diff --git a/stella/src/debugger/RomWidget.cxx b/stella/src/debugger/RomWidget.cxx index b2e855ad0..3b906f3d4 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.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); } } diff --git a/stella/src/debugger/RomWidget.hxx b/stella/src/debugger/RomWidget.hxx index 4d73fd182..b61f6b7f8 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.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 + #include "Array.hxx" #include "Widget.hxx" #include "Command.hxx" +typedef multimap 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 diff --git a/stella/src/gui/module.mk b/stella/src/gui/module.mk index ae9bd6e78..c42866452 100644 --- a/stella/src/gui/module.mk +++ b/stella/src/gui/module.mk @@ -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 \