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
|
|
|
|
//
|
2011-01-01 16:04:32 +00:00
|
|
|
// Copyright (c) 1995-2011 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// 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"
|
2010-09-05 17:57:21 +00:00
|
|
|
#include "DiStella.hxx"
|
2005-08-30 17:51:26 +00:00
|
|
|
#include "CpuDebug.hxx"
|
|
|
|
#include "GuiObject.hxx"
|
2005-10-06 17:28:55 +00:00
|
|
|
#include "InputTextDialog.hxx"
|
2010-08-16 16:41:24 +00:00
|
|
|
#include "DataGridWidget.hxx"
|
2005-11-27 22:37:25 +00:00
|
|
|
#include "EditTextWidget.hxx"
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
#include "PopUpWidget.hxx"
|
|
|
|
#include "StringList.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;
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
WidgetArray wid;
|
2005-10-13 18:53:07 +00:00
|
|
|
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
// Show current bank
|
|
|
|
xpos = x; ypos = y + 7;
|
2010-08-16 16:41:24 +00:00
|
|
|
ostringstream buf;
|
|
|
|
buf << "Current bank (" << dec
|
|
|
|
<< instance().debugger().cartDebug().bankCount() << " total):";
|
2006-02-22 17:38:04 +00:00
|
|
|
t = new StaticTextWidget(boss, font, xpos, ypos,
|
2010-08-16 16:41:24 +00:00
|
|
|
font.getStringWidth(buf.str()),
|
2005-10-13 18:53:07 +00:00
|
|
|
font.getFontHeight(),
|
2010-08-16 16:41:24 +00:00
|
|
|
buf.str(), kTextAlignLeft);
|
2005-10-13 18:53:07 +00:00
|
|
|
|
2010-08-16 16:41:24 +00:00
|
|
|
xpos += t->getWidth() + 5;
|
|
|
|
myBank = new DataGridWidget(boss, font, xpos, ypos-2,
|
|
|
|
1, 1, 4, 8, kBASE_10);
|
|
|
|
myBank->setTarget(this);
|
|
|
|
myBank->setRange(0, instance().debugger().cartDebug().bankCount());
|
|
|
|
if(instance().debugger().cartDebug().bankCount() <= 1)
|
|
|
|
myBank->setEditable(false);
|
|
|
|
addFocusWidget(myBank);
|
2005-10-13 18:53:07 +00:00
|
|
|
|
2010-04-10 20:00:16 +00:00
|
|
|
// 'resolvedata' setting for Distella
|
2010-08-16 16:41:24 +00:00
|
|
|
xpos += myBank->getWidth() + 20;
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
StringMap items;
|
2010-04-10 20:00:16 +00:00
|
|
|
items.push_back("Never", "never");
|
|
|
|
items.push_back("Always", "always");
|
|
|
|
items.push_back("Automatic", "auto");
|
|
|
|
myResolveData =
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
new PopUpWidget(boss, font, xpos, ypos-2, font.getStringWidth("Automatic"),
|
|
|
|
font.getLineHeight(), items,
|
2010-04-10 20:00:16 +00:00
|
|
|
"Resolve data: ", font.getStringWidth("Resolve data: "),
|
|
|
|
kResolveDataChanged);
|
|
|
|
myResolveData->setTarget(this);
|
|
|
|
addFocusWidget(myResolveData);
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
|
2005-10-13 18:53:07 +00:00
|
|
|
// Create rom listing
|
2005-10-14 13:50:00 +00:00
|
|
|
xpos = x; ypos += myBank->getHeight() + 4;
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
const 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
|
|
|
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);
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
|
|
|
|
// By default, we try to automatically determine code vs. data sections
|
2010-04-10 20:00:16 +00:00
|
|
|
myResolveData->setSelected(instance().settings().getString("resolvedata"), "auto");
|
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
|
|
|
}
|
|
|
|
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::loadConfig()
|
|
|
|
{
|
|
|
|
Debugger& dbg = instance().debugger();
|
|
|
|
CartDebug& cart = dbg.cartDebug();
|
|
|
|
bool bankChanged = myCurrentBank != cart.getBank();
|
|
|
|
myCurrentBank = cart.getBank();
|
|
|
|
|
|
|
|
// Fill romlist the current bank of source or disassembly
|
2010-04-10 20:00:16 +00:00
|
|
|
myListIsDirty |= cart.disassemble(myResolveData->getSelectedTag(), myListIsDirty);
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
if(myListIsDirty)
|
|
|
|
{
|
2010-06-05 01:17:03 +00:00
|
|
|
myRomList->setList(cart.disassembly(), dbg.breakpoints());
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
myListIsDirty = false;
|
|
|
|
}
|
|
|
|
|
2010-09-05 17:57:21 +00:00
|
|
|
// Update romlist to point to current PC (if it has changed)
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
int pcline = cart.addressToLine(dbg.cpuDebug().pc());
|
2010-09-05 17:57:21 +00:00
|
|
|
if(pcline >= 0 && pcline != myRomList->getHighlighted())
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
myRomList->setHighlighted(pcline);
|
|
|
|
|
|
|
|
// Set current bank and number of banks
|
2010-08-16 16:41:24 +00:00
|
|
|
myBank->setList(-1, myCurrentBank, bankChanged);
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
}
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|
|
|
{
|
|
|
|
switch(cmd)
|
|
|
|
{
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
case kRLBreakpointChangedCmd:
|
|
|
|
// 'id' is the line in the disassemblylist to be accessed
|
|
|
|
// 'data' is the state of the breakpoint at 'id'
|
|
|
|
setBreak(id, data);
|
2010-03-22 17:24:08 +00:00
|
|
|
// Refresh the romlist, since the breakpoint may not have
|
|
|
|
// actually changed
|
|
|
|
myRomList->setDirty();
|
|
|
|
myRomList->draw();
|
2005-09-07 18:34:52 +00:00
|
|
|
break;
|
|
|
|
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
case kRLRomChangedCmd:
|
|
|
|
// 'data' is the line in the disassemblylist to be accessed
|
|
|
|
patchROM(data, myRomList->getEditString());
|
2005-09-07 18:34:52 +00:00
|
|
|
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);
|
2010-04-03 17:11:23 +00:00
|
|
|
mySaveRom->setEditString("");
|
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());
|
2010-04-09 20:13:12 +00:00
|
|
|
else if(rmb == "runtopc")
|
|
|
|
runtoPC(myRomList->getSelected());
|
2010-08-30 12:04:56 +00:00
|
|
|
else if(rmb == "disasm")
|
|
|
|
invalidate();
|
2010-10-05 00:15:12 +00:00
|
|
|
else if(rmb == "pcaddr")
|
2010-10-03 18:19:09 +00:00
|
|
|
{
|
2010-10-05 00:15:12 +00:00
|
|
|
DiStella::settings.show_addresses = !DiStella::settings.show_addresses;
|
|
|
|
instance().settings().setString("showaddr",
|
|
|
|
DiStella::settings.show_addresses ? "true" : "false");
|
2010-10-03 18:19:09 +00:00
|
|
|
invalidate();
|
|
|
|
}
|
2010-10-05 00:15:12 +00:00
|
|
|
else if(rmb == "gfx")
|
2010-10-03 18:19:09 +00:00
|
|
|
{
|
2010-10-05 00:15:12 +00:00
|
|
|
if(DiStella::settings.gfx_format == kBASE_16)
|
|
|
|
{
|
|
|
|
DiStella::settings.gfx_format = kBASE_2;
|
|
|
|
instance().settings().setString("gfxformat", "2");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
DiStella::settings.gfx_format = kBASE_16;
|
|
|
|
instance().settings().setString("gfxformat", "16");
|
|
|
|
}
|
2010-10-03 18:19:09 +00:00
|
|
|
invalidate();
|
|
|
|
}
|
2010-10-05 00:15:12 +00:00
|
|
|
break; // kCMenuItemSelectedCmd
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
2005-10-06 17:28:55 +00:00
|
|
|
|
2010-08-16 16:41:24 +00:00
|
|
|
case kDGItemDataChangedCmd:
|
|
|
|
setBank(myBank->getSelectedValue());
|
|
|
|
break;
|
|
|
|
|
2010-04-10 20:00:16 +00:00
|
|
|
case kResolveDataChanged:
|
|
|
|
instance().settings().setString("resolvedata", myResolveData->getSelectedTag());
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
invalidate();
|
|
|
|
loadConfig();
|
|
|
|
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-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-16 16:41:24 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RomWidget::setBank(uInt16 bank)
|
|
|
|
{
|
|
|
|
ostringstream command;
|
|
|
|
command << "bank #" << bank;
|
|
|
|
instance().debugger().run(command.str());
|
|
|
|
}
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
void RomWidget::setBreak(int disasm_line, bool state)
|
2005-09-07 18:34:52 +00:00
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyList& list =
|
2010-06-05 01:17:03 +00:00
|
|
|
instance().debugger().cartDebug().disassembly().list;
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
if(disasm_line >= (int)list.size()) return;
|
2010-02-07 21:23:26 +00:00
|
|
|
|
2010-03-22 17:24:08 +00:00
|
|
|
if(list[disasm_line].address != 0 && list[disasm_line].bytes != "")
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
instance().debugger().setBreakPoint(list[disasm_line].address, state);
|
2005-09-07 18:34:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
void RomWidget::setPC(int disasm_line)
|
2005-09-07 18:34:52 +00:00
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyList& list =
|
2010-06-05 01:17:03 +00:00
|
|
|
instance().debugger().cartDebug().disassembly().list;
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
if(disasm_line >= (int)list.size()) return;
|
2010-02-07 21:23:26 +00:00
|
|
|
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
if(list[disasm_line].address != 0)
|
2010-02-07 21:23:26 +00:00
|
|
|
{
|
|
|
|
ostringstream command;
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
command << "pc #" << list[disasm_line].address;
|
2010-02-07 21:23:26 +00:00
|
|
|
instance().debugger().run(command.str());
|
|
|
|
}
|
2005-09-07 18:34:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2010-04-09 20:13:12 +00:00
|
|
|
void RomWidget::runtoPC(int disasm_line)
|
|
|
|
{
|
|
|
|
const CartDebug::DisassemblyList& list =
|
2010-06-05 01:17:03 +00:00
|
|
|
instance().debugger().cartDebug().disassembly().list;
|
2010-04-09 20:13:12 +00:00
|
|
|
if(disasm_line >= (int)list.size()) return;
|
|
|
|
|
|
|
|
if(list[disasm_line].address != 0)
|
|
|
|
{
|
|
|
|
ostringstream command;
|
|
|
|
command << "runtopc #" << list[disasm_line].address;
|
|
|
|
instance().debugger().run(command.str());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
void RomWidget::patchROM(int disasm_line, const string& bytes)
|
2005-09-07 18:34:52 +00:00
|
|
|
{
|
2010-02-07 21:23:26 +00:00
|
|
|
const CartDebug::DisassemblyList& list =
|
2010-06-05 01:17:03 +00:00
|
|
|
instance().debugger().cartDebug().disassembly().list;
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
if(disasm_line >= (int)list.size()) return;
|
2005-09-07 18:34:52 +00:00
|
|
|
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
if(list[disasm_line].address != 0)
|
2010-02-07 21:23:26 +00:00
|
|
|
{
|
|
|
|
ostringstream command;
|
2005-09-07 18:34:52 +00:00
|
|
|
|
2010-09-05 17:57:21 +00:00
|
|
|
// Temporarily set to correct base, so we don't have to prefix each byte
|
|
|
|
// with the type of data
|
2010-02-07 21:23:26 +00:00
|
|
|
BaseFormat oldbase = instance().debugger().parser().base();
|
2010-09-05 17:57:21 +00:00
|
|
|
if(list[disasm_line].type == CartDebug::GFX)
|
|
|
|
instance().debugger().parser().setBase(DiStella::settings.gfx_format);
|
|
|
|
else
|
|
|
|
instance().debugger().parser().setBase(kBASE_16);
|
2005-09-07 18:34:52 +00:00
|
|
|
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
command << "rom #" << list[disasm_line].address << " " << bytes;
|
2010-02-07 21:23:26 +00:00
|
|
|
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
|
|
|
}
|