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>
|
|
|
|
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "DataGridWidget.hxx"
|
|
|
|
#include "EditTextWidget.hxx"
|
2005-08-30 17:51:26 +00:00
|
|
|
#include "FrameBuffer.hxx"
|
|
|
|
#include "GuiObject.hxx"
|
|
|
|
#include "InputTextDialog.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "OSystem.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"
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "Widget.hxx"
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
#include "RamWidget.hxx"
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
RamWidget::RamWidget(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),
|
|
|
|
myUndoAddress(-1),
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
myUndoValue(-1),
|
|
|
|
myCurrentRamBank(0)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
2006-11-06 00:52:04 +00:00
|
|
|
_type = kRamWidget;
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
const int fontWidth = font.getMaxCharWidth(),
|
|
|
|
fontHeight = font.getFontHeight(),
|
|
|
|
lineHeight = font.getLineHeight(),
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth = 44,//font.getStringWidth("Undo "),
|
|
|
|
bheight = lineHeight + 2;
|
2005-08-30 17:51:26 +00:00
|
|
|
int xpos, ypos, lwidth;
|
|
|
|
|
|
|
|
// Create a 16x8 grid holding byte values (16 x 8 = 128 RAM bytes) with labels
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
// Add a scrollbar, since there may be more than 128 bytes of RAM available
|
2005-08-30 17:51:26 +00:00
|
|
|
xpos = x; ypos = y + lineHeight; lwidth = 4 * fontWidth;
|
|
|
|
myRamGrid = new DataGridWidget(boss, font, xpos + lwidth, ypos,
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
16, 8, 2, 8, kBASE_16, true);
|
2005-08-30 17:51:26 +00:00
|
|
|
myRamGrid->setTarget(this);
|
|
|
|
addFocusWidget(myRamGrid);
|
|
|
|
|
|
|
|
// Create actions buttons to the left of the RAM grid
|
|
|
|
xpos += lwidth + myRamGrid->getWidth() + 4;
|
2006-02-22 17:38:04 +00:00
|
|
|
myUndoButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
|
Huge GUI-related changes. The GUI in launcher/options/command modes
is now fully navigable via the keyboard be means of 'tab-like'
functionality. This means that eventually systems without a keyboard
will also be able to navigate the interface without resorting to the
buggy joymouse code (which is soon to be removed).
Laid the infrastructure for remapping GUI events, whereby (for example)
a widget checks for Event::UISelect for 'doing its thing', vs. looking
at the Enter/Return key. So widgets now respond to events, and events
can (eventually) be remapped to *any* device.
Currently, these UI events are as follows:
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UIPrevDir, UINavNext, UINavPrev, UITabNext, UITabPrev, UISelect
At present, they're hardcoded to key events only, so pressing 'Return'
will send a UISelect, cursor up a UIUp, etc. When the remapping code
is complete, *any* input will be able to send these events, and that
remapping will be distinct from emulation mode. So, for example,
cursor up in GUI mode might generate a UIUp event, but in emulation
mode might generate a left joystick up event.
Modified 'tab' key while in emulation mode to only enter the options
menu. Once inside the menu, the tab key acts as navigation between
elements, and exiting the options menu requires navigating to the
'Exit menu' button.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1100 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-05-04 17:45:25 +00:00
|
|
|
"Undo", kUndoCmd);
|
2005-08-30 17:51:26 +00:00
|
|
|
myUndoButton->setTarget(this);
|
|
|
|
|
2006-03-23 16:16:33 +00:00
|
|
|
ypos += bheight + 4;
|
2006-02-22 17:38:04 +00:00
|
|
|
myRevertButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
|
Huge GUI-related changes. The GUI in launcher/options/command modes
is now fully navigable via the keyboard be means of 'tab-like'
functionality. This means that eventually systems without a keyboard
will also be able to navigate the interface without resorting to the
buggy joymouse code (which is soon to be removed).
Laid the infrastructure for remapping GUI events, whereby (for example)
a widget checks for Event::UISelect for 'doing its thing', vs. looking
at the Enter/Return key. So widgets now respond to events, and events
can (eventually) be remapped to *any* device.
Currently, these UI events are as follows:
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UIPrevDir, UINavNext, UINavPrev, UITabNext, UITabPrev, UISelect
At present, they're hardcoded to key events only, so pressing 'Return'
will send a UISelect, cursor up a UIUp, etc. When the remapping code
is complete, *any* input will be able to send these events, and that
remapping will be distinct from emulation mode. So, for example,
cursor up in GUI mode might generate a UIUp event, but in emulation
mode might generate a left joystick up event.
Modified 'tab' key while in emulation mode to only enter the options
menu. Once inside the menu, the tab key acts as navigation between
elements, and exiting the options menu requires navigating to the
'Exit menu' button.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1100 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-05-04 17:45:25 +00:00
|
|
|
"Rev", kRevertCmd);
|
2005-08-30 17:51:26 +00:00
|
|
|
myRevertButton->setTarget(this);
|
|
|
|
|
|
|
|
ypos += 2 * bheight + 2;
|
2006-02-22 17:38:04 +00:00
|
|
|
mySearchButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
|
Huge GUI-related changes. The GUI in launcher/options/command modes
is now fully navigable via the keyboard be means of 'tab-like'
functionality. This means that eventually systems without a keyboard
will also be able to navigate the interface without resorting to the
buggy joymouse code (which is soon to be removed).
Laid the infrastructure for remapping GUI events, whereby (for example)
a widget checks for Event::UISelect for 'doing its thing', vs. looking
at the Enter/Return key. So widgets now respond to events, and events
can (eventually) be remapped to *any* device.
Currently, these UI events are as follows:
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UIPrevDir, UINavNext, UINavPrev, UITabNext, UITabPrev, UISelect
At present, they're hardcoded to key events only, so pressing 'Return'
will send a UISelect, cursor up a UIUp, etc. When the remapping code
is complete, *any* input will be able to send these events, and that
remapping will be distinct from emulation mode. So, for example,
cursor up in GUI mode might generate a UIUp event, but in emulation
mode might generate a left joystick up event.
Modified 'tab' key while in emulation mode to only enter the options
menu. Once inside the menu, the tab key acts as navigation between
elements, and exiting the options menu requires navigating to the
'Exit menu' button.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1100 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-05-04 17:45:25 +00:00
|
|
|
"Srch", kSearchCmd);
|
2005-08-30 17:51:26 +00:00
|
|
|
mySearchButton->setTarget(this);
|
|
|
|
|
2006-03-23 16:16:33 +00:00
|
|
|
ypos += bheight + 4;
|
2006-02-22 17:38:04 +00:00
|
|
|
myCompareButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
|
Huge GUI-related changes. The GUI in launcher/options/command modes
is now fully navigable via the keyboard be means of 'tab-like'
functionality. This means that eventually systems without a keyboard
will also be able to navigate the interface without resorting to the
buggy joymouse code (which is soon to be removed).
Laid the infrastructure for remapping GUI events, whereby (for example)
a widget checks for Event::UISelect for 'doing its thing', vs. looking
at the Enter/Return key. So widgets now respond to events, and events
can (eventually) be remapped to *any* device.
Currently, these UI events are as follows:
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UIPrevDir, UINavNext, UINavPrev, UITabNext, UITabPrev, UISelect
At present, they're hardcoded to key events only, so pressing 'Return'
will send a UISelect, cursor up a UIUp, etc. When the remapping code
is complete, *any* input will be able to send these events, and that
remapping will be distinct from emulation mode. So, for example,
cursor up in GUI mode might generate a UIUp event, but in emulation
mode might generate a left joystick up event.
Modified 'tab' key while in emulation mode to only enter the options
menu. Once inside the menu, the tab key acts as navigation between
elements, and exiting the options menu requires navigating to the
'Exit menu' button.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1100 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-05-04 17:45:25 +00:00
|
|
|
"Cmp", kCmpCmd);
|
2005-08-30 17:51:26 +00:00
|
|
|
myCompareButton->setTarget(this);
|
|
|
|
|
2006-03-23 16:16:33 +00:00
|
|
|
ypos += bheight + 4;
|
2006-02-22 17:38:04 +00:00
|
|
|
myRestartButton = new ButtonWidget(boss, font, xpos, ypos, bwidth, bheight,
|
Huge GUI-related changes. The GUI in launcher/options/command modes
is now fully navigable via the keyboard be means of 'tab-like'
functionality. This means that eventually systems without a keyboard
will also be able to navigate the interface without resorting to the
buggy joymouse code (which is soon to be removed).
Laid the infrastructure for remapping GUI events, whereby (for example)
a widget checks for Event::UISelect for 'doing its thing', vs. looking
at the Enter/Return key. So widgets now respond to events, and events
can (eventually) be remapped to *any* device.
Currently, these UI events are as follows:
UIUp, UIDown, UILeft, UIRight, UIHome, UIEnd, UIPgUp, UIPgDown,
UIPrevDir, UINavNext, UINavPrev, UITabNext, UITabPrev, UISelect
At present, they're hardcoded to key events only, so pressing 'Return'
will send a UISelect, cursor up a UIUp, etc. When the remapping code
is complete, *any* input will be able to send these events, and that
remapping will be distinct from emulation mode. So, for example,
cursor up in GUI mode might generate a UIUp event, but in emulation
mode might generate a left joystick up event.
Modified 'tab' key while in emulation mode to only enter the options
menu. Once inside the menu, the tab key acts as navigation between
elements, and exiting the options menu requires navigating to the
'Exit menu' button.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1100 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-05-04 17:45:25 +00:00
|
|
|
"Rset", kRestartCmd);
|
2005-08-30 17:51:26 +00:00
|
|
|
myRestartButton->setTarget(this);
|
|
|
|
|
|
|
|
// Labels for RAM grid
|
|
|
|
xpos = x; ypos = y + lineHeight;
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
myRamStart =
|
|
|
|
new StaticTextWidget(boss, font, xpos, ypos - lineHeight,
|
|
|
|
font.getStringWidth("xxxx"), fontHeight,
|
|
|
|
"00xx", kTextAlignLeft);
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
for(int col = 0; col < 16; ++col)
|
|
|
|
{
|
2006-02-22 17:38:04 +00:00
|
|
|
new StaticTextWidget(boss, font, xpos + col*myRamGrid->colWidth() + lwidth + 8,
|
|
|
|
ypos - lineHeight,
|
|
|
|
fontWidth, fontHeight,
|
|
|
|
Debugger::to_hex_4(col),
|
|
|
|
kTextAlignLeft);
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
for(int row = 0; row < 8; ++row)
|
|
|
|
{
|
|
|
|
myRamLabels[row] =
|
|
|
|
new StaticTextWidget(boss, font, xpos + 5, ypos + row*lineHeight + 2,
|
|
|
|
3*fontWidth, fontHeight, "", kTextAlignLeft);
|
|
|
|
}
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
xpos = x + 10; ypos += 9 * lineHeight;
|
2006-02-22 17:38:04 +00:00
|
|
|
new StaticTextWidget(boss, font, xpos, ypos,
|
|
|
|
6*fontWidth, fontHeight,
|
|
|
|
"Label:", kTextAlignLeft);
|
2005-08-30 17:51:26 +00:00
|
|
|
xpos += 6*fontWidth + 5;
|
2006-02-22 17:38:04 +00:00
|
|
|
myLabel = new EditTextWidget(boss, font, xpos, ypos-2, 17*fontWidth,
|
|
|
|
lineHeight, "");
|
2005-08-30 17:51:26 +00:00
|
|
|
myLabel->setEditable(false);
|
|
|
|
|
|
|
|
xpos += 17*fontWidth + 20;
|
2006-02-22 17:38:04 +00:00
|
|
|
new StaticTextWidget(boss, font, xpos, ypos, 4*fontWidth, fontHeight,
|
|
|
|
"Dec:", kTextAlignLeft);
|
2005-08-30 17:51:26 +00:00
|
|
|
xpos += 4*fontWidth + 5;
|
2006-02-22 17:38:04 +00:00
|
|
|
myDecValue = new EditTextWidget(boss, font, xpos, ypos-2, 4*fontWidth,
|
|
|
|
lineHeight, "");
|
2005-08-30 17:51:26 +00:00
|
|
|
myDecValue->setEditable(false);
|
|
|
|
|
|
|
|
xpos += 4*fontWidth + 20;
|
2006-02-22 17:38:04 +00:00
|
|
|
new StaticTextWidget(boss, font, xpos, ypos, 4*fontWidth, fontHeight,
|
|
|
|
"Bin:", kTextAlignLeft);
|
2005-08-30 17:51:26 +00:00
|
|
|
xpos += 4*fontWidth + 5;
|
2006-02-22 17:38:04 +00:00
|
|
|
myBinValue = new EditTextWidget(boss, font, xpos, ypos-2, 9*fontWidth,
|
|
|
|
lineHeight, "");
|
2005-08-30 17:51:26 +00:00
|
|
|
myBinValue->setEditable(false);
|
|
|
|
|
2005-11-27 22:37:25 +00:00
|
|
|
// Calculate real dimensions
|
|
|
|
_w = lwidth + myRamGrid->getWidth();
|
|
|
|
_h = ypos + lineHeight - y;
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
// Inputbox which will pop up when searching RAM
|
2008-06-19 19:15:44 +00:00
|
|
|
StringList labels;
|
|
|
|
labels.push_back("Search: ");
|
|
|
|
myInputBox = new InputTextDialog(boss, font, labels);
|
2005-08-30 17:51:26 +00:00
|
|
|
myInputBox->setTarget(this);
|
|
|
|
|
|
|
|
// Start with these buttons disabled
|
|
|
|
myCompareButton->clearFlags(WIDGET_ENABLED);
|
|
|
|
myRestartButton->clearFlags(WIDGET_ENABLED);
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
RamWidget::~RamWidget()
|
|
|
|
{
|
2009-01-11 15:01:36 +00:00
|
|
|
delete myInputBox;
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RamWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
|
|
|
{
|
2009-06-03 14:49:42 +00:00
|
|
|
// We simply change the values in the DataGridWidget
|
2005-08-30 17:51:26 +00:00
|
|
|
// It will then send the 'kDGItemDataChangedCmd' signal to change the actual
|
|
|
|
// memory location
|
|
|
|
int addr, value;
|
|
|
|
|
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& dbg = instance().debugger().cartDebug();
|
|
|
|
const CartState& state = (CartState&) dbg.getState();
|
2005-08-30 17:51:26 +00:00
|
|
|
switch(cmd)
|
|
|
|
{
|
|
|
|
case kDGItemDataChangedCmd:
|
2009-06-04 09:54:18 +00:00
|
|
|
{
|
2005-08-30 17:51:26 +00:00
|
|
|
addr = myRamGrid->getSelectedAddr();
|
|
|
|
value = myRamGrid->getSelectedValue();
|
|
|
|
|
2009-06-04 09:54:18 +00:00
|
|
|
// Attempt the write, and revert if it didn't succeed
|
2010-06-03 12:41:49 +00:00
|
|
|
uInt8 oldval = dbg.peek(state.rport[addr]);
|
|
|
|
dbg.poke(state.wport[addr], value);
|
|
|
|
uInt8 newval = dbg.peek(state.rport[addr]);
|
2009-06-04 09:54:18 +00:00
|
|
|
if(value != newval)
|
|
|
|
{
|
|
|
|
myRamGrid->setValue(addr - myCurrentRamBank*128, newval, false);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
myUndoAddress = addr;
|
2009-06-04 09:54:18 +00:00
|
|
|
myUndoValue = oldval;
|
2005-08-30 17:51:26 +00:00
|
|
|
|
2008-06-13 13:14:52 +00:00
|
|
|
myDecValue->setEditString(instance().debugger().valueToString(value, kBASE_10));
|
|
|
|
myBinValue->setEditString(instance().debugger().valueToString(value, kBASE_2));
|
2005-08-30 17:51:26 +00:00
|
|
|
myRevertButton->setEnabled(true);
|
|
|
|
myUndoButton->setEnabled(true);
|
|
|
|
break;
|
2009-06-04 09:54:18 +00:00
|
|
|
}
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
case kDGSelectionChangedCmd:
|
2008-02-24 16:51:52 +00:00
|
|
|
{
|
2005-08-30 17:51:26 +00:00
|
|
|
addr = myRamGrid->getSelectedAddr();
|
|
|
|
value = myRamGrid->getSelectedValue();
|
|
|
|
|
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
|
|
|
myLabel->setEditString(dbg.getLabel(state.rport[addr], true));
|
2008-06-13 13:14:52 +00:00
|
|
|
myDecValue->setEditString(instance().debugger().valueToString(value, kBASE_10));
|
|
|
|
myBinValue->setEditString(instance().debugger().valueToString(value, kBASE_2));
|
2005-08-30 17:51:26 +00:00
|
|
|
break;
|
2008-02-24 16:51:52 +00:00
|
|
|
}
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
case kRevertCmd:
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
for(uInt32 i = 0; i < myOldValueList.size(); ++i)
|
2010-06-03 12:41:49 +00:00
|
|
|
dbg.poke(state.wport[i], myOldValueList[i]);
|
2005-08-30 17:51:26 +00:00
|
|
|
fillGrid(true);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kUndoCmd:
|
2010-06-03 12:41:49 +00:00
|
|
|
dbg.poke(state.wport[myUndoAddress], myUndoValue);
|
2005-08-30 17:51:26 +00:00
|
|
|
myUndoButton->setEnabled(false);
|
|
|
|
fillGrid(false);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kSearchCmd:
|
2008-06-19 19:15:44 +00:00
|
|
|
showInputBox(kSValEntered);
|
2005-08-30 17:51:26 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kCmpCmd:
|
2008-06-19 19:15:44 +00:00
|
|
|
showInputBox(kCValEntered);
|
2005-08-30 17:51:26 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kRestartCmd:
|
|
|
|
doRestart();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kSValEntered:
|
|
|
|
{
|
|
|
|
const string& result = doSearch(myInputBox->getResult());
|
|
|
|
if(result != "")
|
|
|
|
myInputBox->setTitle(result);
|
|
|
|
else
|
2008-06-13 13:14:52 +00:00
|
|
|
parent().removeDialog();
|
2005-08-30 17:51:26 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case kCValEntered:
|
|
|
|
{
|
|
|
|
const string& result = doCompare(myInputBox->getResult());
|
|
|
|
if(result != "")
|
|
|
|
myInputBox->setTitle(result);
|
|
|
|
else
|
2008-06-13 13:14:52 +00:00
|
|
|
parent().removeDialog();
|
2005-08-30 17:51:26 +00:00
|
|
|
break;
|
|
|
|
}
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
|
|
|
|
case kSetPositionCmd:
|
|
|
|
myCurrentRamBank = data;
|
|
|
|
showSearchResults();
|
|
|
|
fillGrid(false);
|
|
|
|
break;
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-18 18:39:57 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RamWidget::setOpsWidget(DataGridOpsWidget* w)
|
|
|
|
{
|
|
|
|
myRamGrid->setOpsWidget(w);
|
|
|
|
}
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RamWidget::loadConfig()
|
|
|
|
{
|
|
|
|
fillGrid(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RamWidget::fillGrid(bool updateOld)
|
|
|
|
{
|
|
|
|
IntArray alist;
|
|
|
|
IntArray vlist;
|
|
|
|
BoolArray changed;
|
|
|
|
|
|
|
|
if(updateOld) myOldValueList.clear();
|
|
|
|
|
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& dbg = instance().debugger().cartDebug();
|
2005-08-30 17:51:26 +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
|
|
|
const CartState& state = (CartState&) dbg.getState();
|
|
|
|
const CartState& oldstate = (CartState&) dbg.getOldState();
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
|
|
|
|
// Jump to the correct 128 byte 'window' in the RAM area
|
|
|
|
// This assumes that the RAM areas are aligned on 128 byte boundaries
|
|
|
|
// TODO - the boundary restriction may not always apply ...
|
|
|
|
uInt32 start = myCurrentRamBank * 128;
|
|
|
|
assert(start+128 <= state.ram.size());
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
if(updateOld) myOldValueList = state.ram;
|
|
|
|
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
for(uInt32 i = start; i < start + 16*8; ++i)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
|
|
|
alist.push_back(i);
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
vlist.push_back(state.ram[i]);
|
2005-08-30 17:51:26 +00:00
|
|
|
changed.push_back(state.ram[i] != oldstate.ram[i]);
|
|
|
|
}
|
|
|
|
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
myRamGrid->setNumRows(state.ram.size() / 128);
|
2005-08-30 17:51:26 +00:00
|
|
|
myRamGrid->setList(alist, vlist, changed);
|
|
|
|
if(updateOld)
|
|
|
|
{
|
|
|
|
myRevertButton->setEnabled(false);
|
|
|
|
myUndoButton->setEnabled(false);
|
|
|
|
}
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
|
|
|
|
// Update RAM labels
|
|
|
|
char buf[5];
|
|
|
|
sprintf(buf, "%04x", state.rport[start] & 0xff00);
|
|
|
|
buf[2] = buf[3] = 'x';
|
|
|
|
myRamStart->setLabel(buf);
|
|
|
|
for(uInt32 i = start, row = 0; i < start + 16*8; i += 16, ++row)
|
|
|
|
{
|
|
|
|
sprintf(buf, "%02x:", state.rport[i] & 0x00ff);
|
|
|
|
myRamLabels[row]->setLabel(buf);
|
|
|
|
}
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2008-06-19 19:15:44 +00:00
|
|
|
void RamWidget::showInputBox(int cmd)
|
|
|
|
{
|
|
|
|
// Add inputbox in the middle of the RAM widget
|
2008-12-23 18:54:05 +00:00
|
|
|
uInt32 x = getAbsX() + ((getWidth() - myInputBox->getWidth()) >> 1);
|
|
|
|
uInt32 y = getAbsY() + ((getHeight() - myInputBox->getHeight()) >> 1);
|
|
|
|
myInputBox->show(x, y);
|
2008-06-19 19:15:44 +00:00
|
|
|
myInputBox->setEditString("");
|
|
|
|
myInputBox->setTitle("");
|
|
|
|
myInputBox->setFocus(0);
|
|
|
|
myInputBox->setEmitSignal(cmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
string RamWidget::doSearch(const string& str)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
|
|
|
bool comparisonSearch = true;
|
|
|
|
|
|
|
|
if(str.length() == 0)
|
|
|
|
{
|
|
|
|
// An empty field means return all memory locations
|
|
|
|
comparisonSearch = false;
|
|
|
|
}
|
|
|
|
else if(str.find_first_of("+-", 0) != string::npos)
|
|
|
|
{
|
|
|
|
// Don't accept these characters here, only in compare
|
|
|
|
return "Invalid input +|-";
|
|
|
|
}
|
|
|
|
|
2008-06-13 13:14:52 +00:00
|
|
|
int searchVal = instance().debugger().stringToValue(str);
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
// Clear the search array of previous items
|
|
|
|
mySearchAddr.clear();
|
|
|
|
mySearchValue.clear();
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
mySearchState.clear();
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
// Now, search all memory locations for this value, and add it to the
|
|
|
|
// search array
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
bool hitfound = false;
|
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& dbg = instance().debugger().cartDebug();
|
|
|
|
const CartState& state = (CartState&) dbg.getState();
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
for(uInt32 addr = 0; addr < state.ram.size(); ++addr)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
int value = state.ram[addr];
|
2005-08-30 17:51:26 +00:00
|
|
|
if(comparisonSearch && searchVal != value)
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
{
|
|
|
|
mySearchState.push_back(false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
mySearchAddr.push_back(addr);
|
|
|
|
mySearchValue.push_back(value);
|
|
|
|
mySearchState.push_back(true);
|
|
|
|
hitfound = true;
|
|
|
|
}
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// If we have some hits, enable the comparison methods
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
if(hitfound)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
|
|
|
mySearchButton->setEnabled(false);
|
|
|
|
myCompareButton->setEnabled(true);
|
|
|
|
myRestartButton->setEnabled(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Finally, show the search results in the list
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
showSearchResults();
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2008-06-19 19:15:44 +00:00
|
|
|
string RamWidget::doCompare(const string& str)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
|
|
|
bool comparitiveSearch = false;
|
|
|
|
int searchVal = 0, offset = 0;
|
|
|
|
|
|
|
|
if(str.length() == 0)
|
|
|
|
return "Enter an absolute or comparitive value";
|
|
|
|
|
|
|
|
// Do some pre-processing on the string
|
|
|
|
string::size_type pos = str.find_first_of("+-", 0);
|
|
|
|
if(pos > 0 && pos != string::npos)
|
|
|
|
{
|
|
|
|
// Only accept '+' or '-' at the start of the string
|
|
|
|
return "Input must be [+|-]NUM";
|
|
|
|
}
|
|
|
|
|
|
|
|
// A comparitive search searches memory for locations that have changed by
|
|
|
|
// the specified amount, vs. for exact values
|
|
|
|
if(str[0] == '+' || str[0] == '-')
|
|
|
|
{
|
|
|
|
comparitiveSearch = true;
|
|
|
|
bool negative = false;
|
|
|
|
if(str[0] == '-')
|
|
|
|
negative = true;
|
|
|
|
|
|
|
|
string tmp = str;
|
|
|
|
tmp.erase(0, 1); // remove the operator
|
2008-06-13 13:14:52 +00:00
|
|
|
offset = instance().debugger().stringToValue(tmp);
|
2005-08-30 17:51:26 +00:00
|
|
|
if(negative)
|
|
|
|
offset = -offset;
|
|
|
|
}
|
|
|
|
else
|
2008-06-13 13:14:52 +00:00
|
|
|
searchVal = instance().debugger().stringToValue(str);
|
2005-08-30 17:51:26 +00:00
|
|
|
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
// Now, search all memory locations previously 'found' for this value
|
|
|
|
bool hitfound = false;
|
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& dbg = instance().debugger().cartDebug();
|
|
|
|
const CartState& state = (CartState&) dbg.getState();
|
2006-03-29 13:53:00 +00:00
|
|
|
IntArray tempAddrList, tempValueList;
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
mySearchState.clear();
|
|
|
|
for(uInt32 i = 0; i < state.rport.size(); ++i)
|
|
|
|
mySearchState.push_back(false);
|
|
|
|
|
2005-08-30 17:51:26 +00:00
|
|
|
for(unsigned int i = 0; i < mySearchAddr.size(); ++i)
|
|
|
|
{
|
|
|
|
if(comparitiveSearch)
|
|
|
|
{
|
|
|
|
searchVal = mySearchValue[i] + offset;
|
|
|
|
if(searchVal < 0 || searchVal > 255)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
int addr = mySearchAddr[i];
|
2010-06-03 12:41:49 +00:00
|
|
|
if(dbg.peek(state.rport[addr]) == searchVal)
|
2006-03-29 13:53:00 +00:00
|
|
|
{
|
|
|
|
tempAddrList.push_back(addr);
|
|
|
|
tempValueList.push_back(searchVal);
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
mySearchState[addr] = hitfound = true;
|
2006-03-29 13:53:00 +00:00
|
|
|
}
|
2005-08-30 17:51:26 +00:00
|
|
|
}
|
|
|
|
|
2006-03-29 13:53:00 +00:00
|
|
|
// Update the searchArray for the new addresses and data
|
|
|
|
mySearchAddr = tempAddrList;
|
|
|
|
mySearchValue = tempValueList;
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
// If we have some hits, enable the comparison methods
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
if(hitfound)
|
2005-08-30 17:51:26 +00:00
|
|
|
{
|
|
|
|
myCompareButton->setEnabled(true);
|
|
|
|
myRestartButton->setEnabled(true);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Finally, show the search results in the list
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
showSearchResults();
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RamWidget::doRestart()
|
|
|
|
{
|
|
|
|
// Erase all search buffers, reset to start mode
|
|
|
|
mySearchAddr.clear();
|
|
|
|
mySearchValue.clear();
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
mySearchState.clear();
|
|
|
|
showSearchResults();
|
2005-08-30 17:51:26 +00:00
|
|
|
|
|
|
|
mySearchButton->setEnabled(true);
|
|
|
|
myCompareButton->setEnabled(false);
|
|
|
|
myRestartButton->setEnabled(false);
|
|
|
|
}
|
Added support for accessing/modifying extended RAM (aka SuperChip) from
the debugger RAM UI. A scrollbar is now present, which can scroll
through each 128 byte 'bank'. Labels indicate the current readport,
so you can distinguish between different areas of RAM. For now,
F4SC, F6SC, F8SC, and FASC have been converted, but I'm looking into the
other schemes now.
The RAM UI takes care of all read/write port issues. From the POV of
the UI, the RAM can be treated as zero-page; translation is done
behind the scene. Searching/comparing and change-tracking are also
supported.
The 'ram' command in the debugger prompt now reflects all RAM, and
readport/writeport addresses are shown, making it easier to use the
command withot having to look up the offsets.
Debugger width has been bumped to 1050 pixels wide to accomodate the
new functionality. We'll see how much trouble this causes ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1747 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-06-02 17:25:14 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void RamWidget::showSearchResults()
|
|
|
|
{
|
|
|
|
// Only update the search results for the bank currently being shown
|
|
|
|
BoolArray temp;
|
|
|
|
uInt32 start = myCurrentRamBank * 128;
|
|
|
|
if(mySearchState.size() == 0 || start > mySearchState.size())
|
|
|
|
{
|
|
|
|
for(uInt32 i = 0; i < 128; ++i)
|
|
|
|
temp.push_back(false);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(uInt32 i = start; i < start + 128; ++i)
|
|
|
|
temp.push_back(mySearchState[i]);
|
|
|
|
}
|
|
|
|
myRamGrid->setHiliteList(temp);
|
|
|
|
}
|