2005-08-30 17:51:26 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// Copyright (c) 1995-2010 by Bradford W. Mott and the Stella Team
|
2005-08-30 17:51:26 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2005-08-30 17:51:26 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2005-08-30 17:51:26 +00:00
|
|
|
//
|
|
|
|
// Based on code from ScummVM - Scumm Interpreter
|
|
|
|
// Copyright (C) 2002-2004 The ScummVM project
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
#include "Debugger.hxx"
|
2005-09-07 18:34:52 +00:00
|
|
|
#include "DebuggerParser.hxx"
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
#include "CartDebug.hxx"
|
2005-08-30 17:51:26 +00:00
|
|
|
#include "CpuDebug.hxx"
|
2005-10-13 18:53:07 +00:00
|
|
|
#include "DataGridWidget.hxx"
|
2005-09-23 17:38:27 +00:00
|
|
|
#include "PackedBitArray.hxx"
|
2005-08-30 17:51:26 +00:00
|
|
|
#include "GuiObject.hxx"
|
2005-10-06 17:28:55 +00:00
|
|
|
#include "InputTextDialog.hxx"
|
2005-11-27 22:37:25 +00:00
|
|
|
#include "EditTextWidget.hxx"
|
2005-09-07 18:34:52 +00:00
|
|
|
#include "ContextMenu.hxx"
|
2005-08-30 17:51:26 +00:00
|
|
|
#include "RomListWidget.hxx"
|
|
|
|
#include "RomWidget.hxx"
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
RomWidget::RomWidget(GuiObject* boss, const GUI::Font& font, int x, int y)
|
2006-02-22 17:38:04 +00:00
|
|
|
: Widget(boss, font, x, y, 16, 16),
|
2005-08-30 17:51:26 +00:00
|
|
|
CommandSender(boss),
|
2005-09-15 19:43:36 +00:00
|
|
|
myListIsDirty(true),
|
2005-08-30 17:51:26 +00:00
|
|
|
myCurrentBank(-1)
|
|
|
|
{
|
2006-11-06 00:52:04 +00:00
|
|
|
_type = kRomWidget;
|
|
|
|
|
2007-08-12 23:05:12 +00:00
|
|
|
int xpos, ypos;
|
2005-10-13 18:53:07 +00:00
|
|
|
StaticTextWidget* t;
|
|
|
|
|
|
|
|
// Create bank editable area
|
2005-10-14 13:50:00 +00:00
|
|
|
xpos = x + 40; ypos = y + 7;
|
2006-02-22 17:38:04 +00:00
|
|
|
t = new StaticTextWidget(boss, font, xpos, ypos,
|
2005-10-13 18:53:07 +00:00
|
|
|
font.getStringWidth("Current bank: "),
|
|
|
|
font.getFontHeight(),
|
|
|
|
"Current bank:", kTextAlignLeft);
|
|
|
|
|
|
|
|
xpos += t->getWidth() + 10;
|
|
|
|
myBank = new DataGridWidget(boss, font, xpos, ypos-2,
|
2009-06-03 14:49:42 +00:00
|
|
|
1, 1, 4, 8, kBASE_10);
|
2005-10-13 18:53:07 +00:00
|
|
|
myBank->setTarget(this);
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
myBank->setRange(0, instance().debugger().cartDebug().bankCount());
|
|
|
|
if(instance().debugger().cartDebug().bankCount() <= 1)
|
2005-10-14 13:50:00 +00:00
|
|
|
myBank->setEditable(false);
|
2005-10-13 18:53:07 +00:00
|
|
|
addFocusWidget(myBank);
|
|
|
|
|
|
|
|
// Show number of banks
|
|
|
|
xpos += myBank->getWidth() + 45;
|
2006-02-22 17:38:04 +00:00
|
|
|
t = new StaticTextWidget(boss, font, xpos, ypos,
|
2005-10-13 18:53:07 +00:00
|
|
|
font.getStringWidth("Total banks: "),
|
|
|
|
font.getFontHeight(),
|
|
|
|
"Total banks:", kTextAlignLeft);
|
|
|
|
|
|
|
|
xpos += t->getWidth() + 10;
|
2006-02-22 17:38:04 +00:00
|
|
|
myBankCount = new EditTextWidget(boss, font, xpos, ypos-2,
|
2009-06-03 14:49:42 +00:00
|
|
|
font.getStringWidth("XXXX"),
|
|
|
|
font.getLineHeight(), "");
|
2005-10-13 18:53:07 +00:00
|
|
|
myBankCount->setEditable(false);
|
|
|
|
|
|
|
|
// Create rom listing
|
2005-10-14 13:50:00 +00:00
|
|
|
xpos = x; ypos += myBank->getHeight() + 4;
|
2008-06-13 13:14:52 +00:00
|
|
|
GUI::Rect dialog = instance().debugger().getDialogBounds();
|
2007-08-12 23:05:12 +00:00
|
|
|
int w = dialog.width() - x - 5, h = dialog.height() - ypos - 3;
|
2005-10-22 15:43:17 +00:00
|
|
|
|
2005-10-13 18:53:07 +00:00
|
|
|
myRomList = new RomListWidget(boss, font, xpos, ypos, w, h);
|
2005-08-30 17:51:26 +00:00
|
|
|
myRomList->setTarget(this);
|
2005-09-07 18:34:52 +00:00
|
|
|
myRomList->myMenu->setTarget(this);
|
2005-08-30 17:51:26 +00:00
|
|
|
myRomList->setStyle(kSolidFill);
|
|
|
|
addFocusWidget(myRomList);
|
|
|
|
|
|
|
|
// Calculate real dimensions
|
|
|
|
_w = myRomList->getWidth();
|
|
|
|
_h = myRomList->getHeight();
|
2005-10-06 17:28:55 +00:00
|
|
|
|
|
|
|
// Create dialog box for save ROM (get name)
|
2005-11-27 22:37:25 +00:00
|
|
|
StringList label;
|
|
|
|
label.push_back("Filename: ");
|
2008-06-19 19:15:44 +00:00
|
|
|
mySaveRom = new InputTextDialog(boss, font, label);
|
2005-10-06 17:28:55 +00:00
|
|
|
mySaveRom->setTarget(this);
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
RomWidget::~RomWidget()
|
|
|
|
{
|
2009-01-11 15:01:36 +00:00
|
|
|
delete mySaveRom;
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|
|
|
{
|
|
|
|
switch(cmd)
|
|
|
|
{
|
|
|
|
case kListItemChecked:
|
2005-09-07 18:34:52 +00:00
|
|
|
setBreak(data);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kListItemDataChangedCmd:
|
|
|
|
patchROM(data, myRomList->getSelectedString());
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kCMenuItemSelectedCmd:
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
2008-07-25 12:41:41 +00:00
|
|
|
const string& rmb = myRomList->myMenu->getSelectedTag();
|
2005-09-07 18:34:52 +00:00
|
|
|
|
2008-07-25 12:41:41 +00:00
|
|
|
if(rmb == "saverom")
|
2005-10-06 17:28:55 +00:00
|
|
|
{
|
2008-06-19 19:15:44 +00:00
|
|
|
mySaveRom->show(_x + 50, _y + 80);
|
2005-10-06 17:28:55 +00:00
|
|
|
mySaveRom->setTitle("");
|
|
|
|
mySaveRom->setEmitSignal(kRomNameEntered);
|
|
|
|
}
|
2008-07-25 12:41:41 +00:00
|
|
|
else if(rmb == "setpc")
|
2005-09-07 18:34:52 +00:00
|
|
|
setPC(myRomList->getSelected());
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
2005-10-06 17:28:55 +00:00
|
|
|
|
|
|
|
case kRomNameEntered:
|
|
|
|
{
|
|
|
|
const string& rom = mySaveRom->getResult();
|
|
|
|
if(rom == "")
|
|
|
|
mySaveRom->setTitle("Invalid name");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
saveROM(rom);
|
2008-06-13 13:14:52 +00:00
|
|
|
parent().removeDialog();
|
2005-10-06 17:28:55 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2005-10-13 18:53:07 +00:00
|
|
|
|
|
|
|
case kDGItemDataChangedCmd:
|
|
|
|
{
|
|
|
|
int bank = myBank->getSelectedValue();
|
2008-06-13 13:14:52 +00:00
|
|
|
instance().debugger().setBank(bank);
|
2005-10-13 18:53:07 +00:00
|
|
|
}
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::loadConfig()
|
|
|
|
{
|
2008-06-13 13:14:52 +00:00
|
|
|
Debugger& dbg = instance().debugger();
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
CartDebug& cart = dbg.cartDebug();
|
|
|
|
bool bankChanged = myCurrentBank != cart.getBank();
|
|
|
|
myCurrentBank = cart.getBank();
|
2005-09-13 18:27:42 +00:00
|
|
|
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
// Fill romlist the current bank of source or disassembly
|
2005-08-30 17:51:26 +00:00
|
|
|
// Only reload full bank when necessary
|
2010-02-07 21:23:26 +00:00
|
|
|
// TODO - bank changes aren't the only time that the disassembly needs to
|
|
|
|
// be redone; ROMs which dynamically change cart address space and
|
|
|
|
// have self-modifying code need to be taken into account
|
|
|
|
// As well, we don't always start from the 0xfffc; this only
|
|
|
|
// happens in the startup bank
|
|
|
|
myListIsDirty |= cart.disassemble(true);
|
|
|
|
if(myListIsDirty)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyList& list = cart.disassemblyList();
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
BoolArray state;
|
|
|
|
|
|
|
|
PackedBitArray& bp = dbg.breakpoints();
|
2010-02-07 21:23:26 +00:00
|
|
|
for(uInt32 i = 0; i < list.size(); ++i)
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyTag& tag = list[i];
|
|
|
|
if(tag.address != 0 && bp.isSet(tag.address))
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
state.push_back(true);
|
|
|
|
else
|
|
|
|
state.push_back(false);
|
|
|
|
}
|
|
|
|
|
2010-02-07 21:23:26 +00:00
|
|
|
myRomList->setList(list, state);
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
|
|
|
|
// Restore the old bank, in case we inadvertently switched while reading.
|
2010-03-06 18:56:36 +00:00
|
|
|
// dbg.setBank(myCurrentBank); // TODO - why is this here?
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
|
2005-09-15 19:43:36 +00:00
|
|
|
myListIsDirty = false;
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
2005-09-13 18:27:42 +00:00
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
// Update romlist to point to current PC
|
2010-02-07 21:23:26 +00:00
|
|
|
int pcline = cart.addressToLine(dbg.cpuDebug().pc());
|
|
|
|
if(pcline > 0)
|
|
|
|
myRomList->setHighlighted(pcline);
|
2005-10-13 18:53:07 +00:00
|
|
|
|
|
|
|
// Set current bank
|
|
|
|
IntArray alist;
|
|
|
|
IntArray vlist;
|
|
|
|
BoolArray changed;
|
|
|
|
|
|
|
|
alist.push_back(-1);
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
vlist.push_back(cart.getBank());
|
2005-10-13 18:53:07 +00:00
|
|
|
changed.push_back(bankChanged);
|
|
|
|
myBank->setList(alist, vlist, changed);
|
|
|
|
|
|
|
|
// Indicate total number of banks
|
OK, this is the first pass at a huge reorganization of the debugger
classes. First off, the distella code has been integrated into a
DiStella class. This code isn't yet tied to the debugger, but it does
at least compile and generate valid output.
The RamDebug class has been replaced by a CartDebug class, which
takes responsibility for the previous RamDebug stuff as well as
things related to Cart address space (read from write ports,
disassembly, etc).
Fixed E7 bankswitching when reading from the write port in the upper
256byte area.
Fixed 'read from write port functionality' in general for all carts
that supported it previously. Basically, if _rwport is enabled, the
address is checked to be an actual read (vs. one that's part of a
normal write cycle), *and* it's actually an illegal access (each
cart/bankswitch type now provides a hint to indicate this condition).
Still TODO is clean up the rework, properly integrate DiStella, and
fix labels and defines (which seem to be completely broken).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1922 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-01-17 16:48:45 +00:00
|
|
|
myBankCount->setEditString(dbg.valueToString(cart.bankCount(), kBASE_10));
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
2005-09-07 18:34:52 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::setBreak(int data)
|
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyList& list =
|
|
|
|
instance().debugger().cartDebug().disassemblyList();
|
|
|
|
if(data >= (int)list.size()) return;
|
|
|
|
|
2005-09-23 17:38:27 +00:00
|
|
|
bool state = myRomList->getState(data);
|
2010-02-07 21:23:26 +00:00
|
|
|
if(list[data].address != 0)
|
|
|
|
instance().debugger().setBreakPoint(list[data].address, state);
|
2005-09-07 18:34:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::setPC(int data)
|
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyList& list =
|
|
|
|
instance().debugger().cartDebug().disassemblyList();
|
|
|
|
if(data >= (int)list.size()) return;
|
|
|
|
|
|
|
|
if(list[data].address != 0)
|
|
|
|
{
|
|
|
|
ostringstream command;
|
|
|
|
command << "pc #" << list[data].address;
|
|
|
|
instance().debugger().run(command.str());
|
|
|
|
}
|
2005-09-07 18:34:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::patchROM(int data, const string& bytes)
|
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyList& list =
|
|
|
|
instance().debugger().cartDebug().disassemblyList();
|
|
|
|
if(data >= (int)list.size()) return;
|
2005-09-07 18:34:52 +00:00
|
|
|
|
2010-02-07 21:23:26 +00:00
|
|
|
if(list[data].address != 0)
|
|
|
|
{
|
|
|
|
ostringstream command;
|
2005-09-07 18:34:52 +00:00
|
|
|
|
2010-02-07 21:23:26 +00:00
|
|
|
// Temporarily set to base 16, since that's the format the disassembled
|
|
|
|
// byte string is in. This eliminates the need to prefix each byte with
|
|
|
|
// a '$' character
|
|
|
|
BaseFormat oldbase = instance().debugger().parser().base();
|
|
|
|
instance().debugger().parser().setBase(kBASE_16);
|
2005-09-07 18:34:52 +00:00
|
|
|
|
2010-02-07 21:23:26 +00:00
|
|
|
command << "rom #" << list[data].address << " " << bytes;
|
|
|
|
instance().debugger().run(command.str());
|
|
|
|
|
|
|
|
// Restore previous base
|
|
|
|
instance().debugger().parser().setBase(oldbase);
|
|
|
|
}
|
2005-09-07 18:34:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-10-06 17:28:55 +00:00
|
|
|
void RomWidget::saveROM(const string& rom)
|
2005-09-07 18:34:52 +00:00
|
|
|
{
|
2005-10-06 17:28:55 +00:00
|
|
|
ostringstream command;
|
|
|
|
command << "saverom " << rom;
|
2008-06-13 13:14:52 +00:00
|
|
|
instance().debugger().run(command.str());
|
2005-09-07 18:34:52 +00:00
|
|
|
}
|