2005-06-03 17:52:06 +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
|
|
|
|
//
|
2013-01-04 19:49:01 +00:00
|
|
|
// Copyright (c) 1995-2013 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2005-06-03 17:52:06 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2005-06-03 17:52:06 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2005-06-03 17:52:06 +00:00
|
|
|
//
|
|
|
|
// Based on code from ScummVM - Scumm Interpreter
|
|
|
|
// Copyright (C) 2002-2004 The ScummVM project
|
|
|
|
//============================================================================
|
|
|
|
|
2005-06-17 14:42:49 +00:00
|
|
|
#include "Widget.hxx"
|
|
|
|
#include "Dialog.hxx"
|
2005-06-10 17:46:07 +00:00
|
|
|
#include "TabWidget.hxx"
|
2005-07-21 19:30:17 +00:00
|
|
|
#include "TiaInfoWidget.hxx"
|
2005-08-31 19:15:10 +00:00
|
|
|
#include "TiaOutputWidget.hxx"
|
|
|
|
#include "TiaZoomWidget.hxx"
|
2005-10-13 18:53:07 +00:00
|
|
|
#include "AudioWidget.hxx"
|
2005-06-10 17:46:07 +00:00
|
|
|
#include "PromptWidget.hxx"
|
2005-06-20 18:32:12 +00:00
|
|
|
#include "CpuWidget.hxx"
|
2005-06-16 18:40:17 +00:00
|
|
|
#include "RamWidget.hxx"
|
2008-04-29 15:13:16 +00:00
|
|
|
#include "RiotWidget.hxx"
|
2005-08-22 13:53:23 +00:00
|
|
|
#include "RomWidget.hxx"
|
2005-07-06 15:09:16 +00:00
|
|
|
#include "TiaWidget.hxx"
|
2013-04-04 21:38:22 +00:00
|
|
|
#include "CartDebugWidget.hxx"
|
2005-08-10 18:44:37 +00:00
|
|
|
#include "DataGridOpsWidget.hxx"
|
2005-09-20 19:09:10 +00:00
|
|
|
#include "EditTextWidget.hxx"
|
2011-05-26 16:14:46 +00:00
|
|
|
#include "MessageBox.hxx"
|
2005-07-19 17:59:59 +00:00
|
|
|
#include "Rect.hxx"
|
2005-06-17 14:42:49 +00:00
|
|
|
#include "Debugger.hxx"
|
2005-09-15 19:43:36 +00:00
|
|
|
#include "DebuggerParser.hxx"
|
2005-06-12 20:12:10 +00:00
|
|
|
|
2005-06-03 17:52:06 +00:00
|
|
|
#include "DebuggerDialog.hxx"
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-06-07 01:14:39 +00:00
|
|
|
DebuggerDialog::DebuggerDialog(OSystem* osystem, DialogContainer* parent,
|
|
|
|
int x, int y, int w, int h)
|
2008-06-13 13:14:52 +00:00
|
|
|
: Dialog(osystem, parent, x, y, w, h, true), // use base surface
|
2011-05-26 16:14:46 +00:00
|
|
|
myTab(NULL),
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
myRomTab(NULL),
|
2011-05-26 16:14:46 +00:00
|
|
|
myFatalError(NULL)
|
2005-06-03 17:52:06 +00:00
|
|
|
{
|
2005-07-19 17:59:59 +00:00
|
|
|
addTiaArea();
|
|
|
|
addTabArea();
|
|
|
|
addStatusArea();
|
2005-08-04 22:59:54 +00:00
|
|
|
addRomArea();
|
2005-08-31 22:34:43 +00:00
|
|
|
|
|
|
|
// Inform the output widget about its associated zoom widget
|
|
|
|
myTiaOutput->setZoomWidget(myTiaZoom);
|
2005-06-03 17:52:06 +00:00
|
|
|
}
|
|
|
|
|
2005-06-09 19:04:59 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-06-10 17:46:07 +00:00
|
|
|
DebuggerDialog::~DebuggerDialog()
|
2005-06-09 19:04:59 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2005-06-07 01:27:06 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::loadConfig()
|
|
|
|
{
|
2005-06-17 14:42:49 +00:00
|
|
|
myTab->loadConfig();
|
2005-07-21 19:30:17 +00:00
|
|
|
myTiaInfo->loadConfig();
|
2005-08-03 13:26:02 +00:00
|
|
|
myTiaOutput->loadConfig();
|
2005-08-31 19:15:10 +00:00
|
|
|
myTiaZoom->loadConfig();
|
2005-08-10 12:23:42 +00:00
|
|
|
myCpu->loadConfig();
|
2005-08-10 14:44:01 +00:00
|
|
|
myRam->loadConfig();
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
myRomTab->loadConfig();
|
2005-09-20 19:09:10 +00:00
|
|
|
|
|
|
|
myMessageBox->setEditString("");
|
2005-06-07 01:27:06 +00:00
|
|
|
}
|
|
|
|
|
2005-06-03 17:52:06 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2012-01-14 22:00:54 +00:00
|
|
|
void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, char ascii)
|
2005-06-03 17:52:06 +00:00
|
|
|
{
|
2012-01-14 22:00:54 +00:00
|
|
|
bool handled = instance().eventHandler().kbdAlt(mod);
|
2006-05-29 22:31:20 +00:00
|
|
|
if(handled)
|
2005-06-24 12:01:27 +00:00
|
|
|
{
|
2012-01-14 22:00:54 +00:00
|
|
|
switch(ascii)
|
2005-12-20 19:05:16 +00:00
|
|
|
{
|
|
|
|
case 's':
|
|
|
|
doStep();
|
|
|
|
break;
|
|
|
|
case 't':
|
|
|
|
doTrace();
|
|
|
|
break;
|
|
|
|
case 'f':
|
|
|
|
doAdvance();
|
|
|
|
break;
|
|
|
|
case 'l':
|
|
|
|
doScanlineAdvance();
|
|
|
|
break;
|
OK, this looks like a huge update, but it's only because of some Serializer
class reworking. Serializer class now handles read/write of state from
files as well as in-memory streams. As a result, Deserializer class has
been removed.
Added state rewinding to the debugger. For now, this is limited to 100
levels of undo, with a new state generated each time a step/trace/frame/
scanline advance is performed. The undo level is 'rolling', in that it
remembers the last 100 levels (so you lose the oldest states when you
start adding more than 100). For now, this is tied to the 'Alt-r' key
in the debugger. Still TODO is add a button for it, and clean up some
TIA output issues when rewinding.
Added support for 6K version of Supercharger ROMs (this fixes issues
with the 6K version of Cubis).
Cleaned up the Serializable infrastructure, making sure that all
classes that need to implement it actually do so now.
Fixed issue with editable widgets in the UI, where pressing Enter
on the keypad wasn't actually being registered.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1849 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-08-05 16:05:34 +00:00
|
|
|
case 'r':
|
|
|
|
doRewind();
|
|
|
|
break;
|
2006-05-29 22:31:20 +00:00
|
|
|
default:
|
|
|
|
handled = false;
|
|
|
|
break;
|
2005-12-20 19:05:16 +00:00
|
|
|
}
|
2005-06-24 12:01:27 +00:00
|
|
|
}
|
2006-05-29 22:31:20 +00:00
|
|
|
if(!handled)
|
2012-01-14 22:00:54 +00:00
|
|
|
Dialog::handleKeyDown(key, mod, ascii);
|
2005-06-03 17:52:06 +00:00
|
|
|
}
|
2005-06-17 03:49:10 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-07-05 15:25:45 +00:00
|
|
|
void DebuggerDialog::handleCommand(CommandSender* sender, int cmd,
|
|
|
|
int data, int id)
|
2005-06-17 14:42:49 +00:00
|
|
|
{
|
2005-06-17 17:34:01 +00:00
|
|
|
// We reload the tabs in the cases where the actions could possibly
|
|
|
|
// change their contents
|
2005-06-17 14:42:49 +00:00
|
|
|
switch(cmd)
|
|
|
|
{
|
|
|
|
case kDDStepCmd:
|
2005-06-24 12:01:27 +00:00
|
|
|
doStep();
|
2005-06-17 14:42:49 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDDTraceCmd:
|
2005-06-24 12:01:27 +00:00
|
|
|
doTrace();
|
2005-06-17 17:34:01 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
case kDDAdvCmd:
|
2005-06-24 12:01:27 +00:00
|
|
|
doAdvance();
|
2005-06-17 17:34:01 +00:00
|
|
|
break;
|
|
|
|
|
2005-07-15 15:27:29 +00:00
|
|
|
case kDDSAdvCmd:
|
|
|
|
doScanlineAdvance();
|
|
|
|
break;
|
|
|
|
|
OK, this looks like a huge update, but it's only because of some Serializer
class reworking. Serializer class now handles read/write of state from
files as well as in-memory streams. As a result, Deserializer class has
been removed.
Added state rewinding to the debugger. For now, this is limited to 100
levels of undo, with a new state generated each time a step/trace/frame/
scanline advance is performed. The undo level is 'rolling', in that it
remembers the last 100 levels (so you lose the oldest states when you
start adding more than 100). For now, this is tied to the 'Alt-r' key
in the debugger. Still TODO is add a button for it, and clean up some
TIA output issues when rewinding.
Added support for 6K version of Supercharger ROMs (this fixes issues
with the 6K version of Cubis).
Cleaned up the Serializable infrastructure, making sure that all
classes that need to implement it actually do so now.
Fixed issue with editable widgets in the UI, where pressing Enter
on the keypad wasn't actually being registered.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1849 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-08-05 16:05:34 +00:00
|
|
|
case kDDRewindCmd:
|
|
|
|
doRewind();
|
|
|
|
break;
|
|
|
|
|
2005-06-17 17:34:01 +00:00
|
|
|
case kDDExitCmd:
|
2011-05-26 16:14:46 +00:00
|
|
|
doExitDebugger();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case kDDExitFatalCmd:
|
|
|
|
doExitRom();
|
2005-06-17 14:42:49 +00:00
|
|
|
break;
|
|
|
|
|
2013-04-20 22:23:42 +00:00
|
|
|
case RomWidget::kInvalidateListing:
|
|
|
|
myRom->invalidate();
|
|
|
|
break;
|
|
|
|
|
2005-06-17 14:42:49 +00:00
|
|
|
default:
|
2005-08-11 21:57:30 +00:00
|
|
|
Dialog::handleCommand(sender, cmd, data, id);
|
2005-06-17 14:42:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-05-26 16:14:46 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::showFatalMessage(const string& msg)
|
|
|
|
{
|
|
|
|
const GUI::Rect& r = instance().debugger().getDialogBounds();
|
|
|
|
|
|
|
|
delete myFatalError;
|
|
|
|
myFatalError =
|
2013-02-10 22:26:06 +00:00
|
|
|
new GUI::MessageBox(this, instance().consoleFont(), msg,
|
|
|
|
r.width(), r.height(), kDDExitFatalCmd,
|
|
|
|
"Exit ROM", "Continue");
|
2011-05-26 16:14:46 +00:00
|
|
|
myFatalError->show();
|
|
|
|
}
|
|
|
|
|
2005-07-19 17:59:59 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::addTiaArea()
|
|
|
|
{
|
2011-05-26 16:14:46 +00:00
|
|
|
const GUI::Rect& r = instance().debugger().getTiaBounds();
|
2005-07-19 17:59:59 +00:00
|
|
|
|
2008-06-13 13:14:52 +00:00
|
|
|
myTiaOutput = new TiaOutputWidget(this, instance().consoleFont(),
|
2006-02-22 17:38:04 +00:00
|
|
|
r.left, r.top, r.width(), r.height());
|
2005-07-19 17:59:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::addTabArea()
|
|
|
|
{
|
2011-05-26 16:14:46 +00:00
|
|
|
const GUI::Rect& r = instance().debugger().getTabBounds();
|
2005-08-04 22:59:54 +00:00
|
|
|
const int vBorder = 4;
|
|
|
|
|
2005-07-19 17:59:59 +00:00
|
|
|
// The tab widget
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
// Since there are two tab widgets in this dialog, we specifically
|
|
|
|
// assign an ID of 0
|
2008-06-13 13:14:52 +00:00
|
|
|
myTab = new TabWidget(this, instance().consoleFont(), r.left, r.top + vBorder,
|
2005-08-10 12:23:42 +00:00
|
|
|
r.width(), r.height() - vBorder);
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
myTab->setID(0);
|
2005-08-10 12:23:42 +00:00
|
|
|
addTabWidget(myTab);
|
2005-07-19 17:59:59 +00:00
|
|
|
|
2006-02-22 17:38:04 +00:00
|
|
|
const int widWidth = r.width() - vBorder;
|
|
|
|
const int widHeight = r.height() - myTab->getTabHeight() - vBorder - 4;
|
|
|
|
int tabID;
|
|
|
|
|
2005-08-10 12:23:42 +00:00
|
|
|
// The Prompt/console tab
|
|
|
|
tabID = myTab->addTab("Prompt");
|
2008-06-13 13:14:52 +00:00
|
|
|
myPrompt = new PromptWidget(myTab, instance().consoleFont(),
|
2006-02-22 17:38:04 +00:00
|
|
|
2, 2, widWidth, widHeight);
|
2005-08-10 12:23:42 +00:00
|
|
|
myTab->setParentWidget(tabID, myPrompt);
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
addToFocusList(myPrompt->getFocusList(), myTab, tabID);
|
2005-07-19 17:59:59 +00:00
|
|
|
|
2005-08-10 12:23:42 +00:00
|
|
|
// The TIA tab
|
|
|
|
tabID = myTab->addTab("TIA");
|
2008-06-13 13:14:52 +00:00
|
|
|
TiaWidget* tia = new TiaWidget(myTab, instance().consoleFont(),
|
2006-02-22 17:38:04 +00:00
|
|
|
2, 2, widWidth, widHeight);
|
2005-08-10 12:23:42 +00:00
|
|
|
myTab->setParentWidget(tabID, tia);
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
addToFocusList(tia->getFocusList(), myTab, tabID);
|
2005-07-19 17:59:59 +00:00
|
|
|
|
2008-04-29 15:13:16 +00:00
|
|
|
// The input/output tab (includes RIOT and INPTx from TIA)
|
|
|
|
tabID = myTab->addTab("I/O");
|
2008-06-13 13:14:52 +00:00
|
|
|
RiotWidget* riot = new RiotWidget(myTab, instance().consoleFont(),
|
2008-04-29 15:13:16 +00:00
|
|
|
2, 2, widWidth, widHeight);
|
|
|
|
myTab->setParentWidget(tabID, riot);
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
addToFocusList(riot->getFocusList(), myTab, tabID);
|
2008-04-29 15:13:16 +00:00
|
|
|
|
2005-10-13 18:53:07 +00:00
|
|
|
// The Audio tab
|
|
|
|
tabID = myTab->addTab("Audio");
|
2008-06-13 13:14:52 +00:00
|
|
|
AudioWidget* aud = new AudioWidget(myTab, instance().consoleFont(),
|
2006-02-22 17:38:04 +00:00
|
|
|
2, 2, widWidth, widHeight);
|
2005-10-13 18:53:07 +00:00
|
|
|
myTab->setParentWidget(tabID, aud);
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
addToFocusList(aud->getFocusList(), myTab, tabID);
|
2005-10-13 18:53:07 +00:00
|
|
|
|
2005-07-19 17:59:59 +00:00
|
|
|
myTab->setActiveTab(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::addStatusArea()
|
|
|
|
{
|
2008-06-13 13:14:52 +00:00
|
|
|
const GUI::Font& font = instance().consoleFont();
|
2007-08-14 19:49:21 +00:00
|
|
|
const int lineHeight = font.getLineHeight();
|
2011-05-26 16:14:46 +00:00
|
|
|
const GUI::Rect& r = instance().debugger().getStatusBounds();
|
2005-08-31 19:15:10 +00:00
|
|
|
int xpos, ypos;
|
|
|
|
|
|
|
|
xpos = r.left; ypos = r.top;
|
2008-06-13 13:14:52 +00:00
|
|
|
myTiaInfo = new TiaInfoWidget(this, instance().consoleFont(), xpos, ypos);
|
2005-08-31 19:15:10 +00:00
|
|
|
|
|
|
|
ypos += myTiaInfo->getHeight() + 10;
|
2008-06-13 13:14:52 +00:00
|
|
|
myTiaZoom = new TiaZoomWidget(this, instance().consoleFont(), xpos+10, ypos,
|
2007-08-14 19:49:21 +00:00
|
|
|
r.width()-10, r.height()-lineHeight-ypos-10);
|
2005-08-31 19:15:10 +00:00
|
|
|
addToFocusList(myTiaZoom->getFocusList());
|
2005-09-20 19:09:10 +00:00
|
|
|
|
2007-08-14 19:49:21 +00:00
|
|
|
xpos += 10; ypos += myTiaZoom->getHeight() + 10;
|
2008-06-13 13:14:52 +00:00
|
|
|
myMessageBox = new EditTextWidget(this, instance().consoleFont(),
|
2006-02-22 17:38:04 +00:00
|
|
|
xpos, ypos, myTiaZoom->getWidth(),
|
2005-09-20 19:09:10 +00:00
|
|
|
font.getLineHeight(), "");
|
|
|
|
myMessageBox->setEditable(false);
|
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
|
|
|
myMessageBox->clearFlags(WIDGET_RETAIN_FOCUS);
|
2007-08-06 20:16:51 +00:00
|
|
|
myMessageBox->setTextColor(kTextColorEm);
|
2005-07-19 17:59:59 +00:00
|
|
|
}
|
|
|
|
|
2005-08-04 22:59:54 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::addRomArea()
|
|
|
|
{
|
2011-05-26 16:14:46 +00:00
|
|
|
const GUI::Rect& r = instance().debugger().getRomBounds();
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
const int vBorder = 4;
|
|
|
|
|
2005-08-10 12:23:42 +00:00
|
|
|
int xpos, ypos;
|
|
|
|
|
2005-08-22 13:53:23 +00:00
|
|
|
xpos = r.left + 10; ypos = 10;
|
2008-06-13 13:14:52 +00:00
|
|
|
myCpu = new CpuWidget(this, instance().consoleFont(), xpos, ypos);
|
2005-08-10 12:23:42 +00:00
|
|
|
addToFocusList(myCpu->getFocusList());
|
2005-08-04 22:59:54 +00:00
|
|
|
|
2005-08-22 13:53:23 +00:00
|
|
|
xpos = r.left + 10; ypos += myCpu->getHeight() + 10;
|
2008-06-13 13:14:52 +00:00
|
|
|
myRam = new RamWidget(this, instance().consoleFont(), xpos, ypos);
|
2005-08-10 14:44:01 +00:00
|
|
|
addToFocusList(myRam->getFocusList());
|
|
|
|
|
2006-11-06 00:52:04 +00:00
|
|
|
xpos = r.left + 10 + myCpu->getWidth() + 5;
|
2008-06-13 13:14:52 +00:00
|
|
|
DataGridOpsWidget* ops = new DataGridOpsWidget(this, instance().consoleFont(),
|
2006-02-22 17:38:04 +00:00
|
|
|
xpos, 20);
|
2005-08-10 18:44:37 +00:00
|
|
|
|
2009-08-25 12:46:56 +00:00
|
|
|
int bwidth = instance().consoleFont().getStringWidth("Frame +1 "),
|
|
|
|
bheight = instance().consoleFont().getLineHeight() + 2;
|
2006-03-23 16:16:33 +00:00
|
|
|
int buttonX = r.right - bwidth - 5, buttonY = r.top + 5;
|
2008-06-13 13:14:52 +00:00
|
|
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Step", kDDStepCmd);
|
|
|
|
buttonY += bheight + 4;
|
2008-06-13 13:14:52 +00:00
|
|
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Trace", kDDTraceCmd);
|
|
|
|
buttonY += bheight + 4;
|
2008-06-13 13:14:52 +00:00
|
|
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Scan +1", kDDSAdvCmd);
|
|
|
|
buttonY += bheight + 4;
|
2008-06-13 13:14:52 +00:00
|
|
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Frame +1", kDDAdvCmd);
|
|
|
|
buttonY += bheight + 4;
|
2008-06-13 13:14:52 +00:00
|
|
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Exit", kDDExitCmd);
|
2009-08-25 12:46:56 +00:00
|
|
|
|
|
|
|
bwidth = instance().consoleFont().getStringWidth("< ") + 4;
|
|
|
|
bheight = bheight * 5 + 4*4;
|
|
|
|
buttonX -= (bwidth + 5);
|
|
|
|
buttonY = r.top + 5;
|
|
|
|
myRewindButton =
|
|
|
|
new ButtonWidget(this, instance().consoleFont(), buttonX, buttonY,
|
|
|
|
bwidth, bheight, "<", kDDRewindCmd);
|
|
|
|
myRewindButton->clearFlags(WIDGET_ENABLED);
|
2005-08-22 13:53:23 +00:00
|
|
|
|
2005-08-10 18:44:37 +00:00
|
|
|
// Add the DataGridOpsWidget to any widgets which contain a
|
|
|
|
// DataGridWidget which we want controlled
|
|
|
|
myCpu->setOpsWidget(ops);
|
|
|
|
myRam->setOpsWidget(ops);
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
// Disassembly area
|
|
|
|
|
|
|
|
xpos = r.left + vBorder; ypos += myRam->getHeight() + 5;
|
|
|
|
const int tabWidth = r.width() - vBorder;
|
|
|
|
const int tabHeight = r.height() - ypos;
|
|
|
|
int tabID;
|
|
|
|
|
|
|
|
// Since there are two tab widgets in this dialog, we specifically
|
|
|
|
// assign an ID of 1
|
|
|
|
myRomTab = new TabWidget(
|
|
|
|
this, instance().consoleFont(), xpos, ypos, tabWidth, tabHeight);
|
|
|
|
myRomTab->setID(1);
|
|
|
|
addTabWidget(myRomTab);
|
|
|
|
|
|
|
|
// The main disassembly tab
|
|
|
|
tabID = myRomTab->addTab(" Disassembly ");
|
|
|
|
myRom = new RomWidget(myRomTab, instance().consoleFont(),
|
|
|
|
2, 2, tabWidth - 1,
|
|
|
|
tabHeight - myRomTab->getTabHeight() - 2);
|
|
|
|
myRomTab->setParentWidget(tabID, myRom);
|
|
|
|
addToFocusList(myRom->getFocusList(), myRomTab, tabID);
|
|
|
|
|
|
|
|
// The 'cart-specific' information tab
|
|
|
|
tabID = myRomTab->addTab(instance().console().cartridge().name());
|
2013-04-04 21:38:22 +00:00
|
|
|
myCartDebug = instance().console().cartridge().debugWidget(
|
|
|
|
myRomTab, instance().consoleFont(), 2, 2, tabWidth - 1,
|
|
|
|
tabHeight - myRomTab->getTabHeight() - 2);
|
|
|
|
if(myCartDebug) // TODO - make this always non-null
|
|
|
|
{
|
|
|
|
myRomTab->setParentWidget(tabID, myCartDebug);
|
|
|
|
addToFocusList(myCartDebug->getFocusList(), myRomTab, tabID);
|
|
|
|
}
|
First pass at adding a cart-specific bankswitch/info tab to the
debugger. In the process, I had to spend several days extending
the UI/dialog class to actually contain multiple tabs. This was
harder than expected, and it still isn't quite finished. In many
ways, we're beginning to reach the limits of the current code; it
was never designed for a full-fledged, graphically rich UI.
For now the tab is empty, but eventually it will contain general
info about the ROM bankswitch type (size, virtual layout, etc),
but also cart-specific info, including the ability to change
banks, which can be vary greatly among the different schemes.
Eventually, it may even allow to see/modify very cart-specific
info (like display RAM in DPC, etc).
Better handle errors in opening the serial port (AtariVox support)
for Windows and OSX.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2678 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2013-03-31 00:10:05 +00:00
|
|
|
|
|
|
|
myRomTab->setActiveTab(0);
|
2005-08-04 22:59:54 +00:00
|
|
|
}
|
|
|
|
|
2005-06-24 12:01:27 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doStep()
|
|
|
|
{
|
2008-06-13 13:14:52 +00:00
|
|
|
instance().debugger().parser().run("step");
|
2005-06-24 12:01:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doTrace()
|
|
|
|
{
|
2008-06-13 13:14:52 +00:00
|
|
|
instance().debugger().parser().run("trace");
|
2005-06-24 12:01:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doAdvance()
|
|
|
|
{
|
2008-06-13 13:14:52 +00:00
|
|
|
instance().debugger().parser().run("frame #1");
|
2005-06-24 12:01:27 +00:00
|
|
|
}
|
|
|
|
|
2005-07-15 15:27:29 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doScanlineAdvance()
|
|
|
|
{
|
2008-06-13 13:14:52 +00:00
|
|
|
instance().debugger().parser().run("scanline #1");
|
2005-07-15 15:27:29 +00:00
|
|
|
}
|
|
|
|
|
OK, this looks like a huge update, but it's only because of some Serializer
class reworking. Serializer class now handles read/write of state from
files as well as in-memory streams. As a result, Deserializer class has
been removed.
Added state rewinding to the debugger. For now, this is limited to 100
levels of undo, with a new state generated each time a step/trace/frame/
scanline advance is performed. The undo level is 'rolling', in that it
remembers the last 100 levels (so you lose the oldest states when you
start adding more than 100). For now, this is tied to the 'Alt-r' key
in the debugger. Still TODO is add a button for it, and clean up some
TIA output issues when rewinding.
Added support for 6K version of Supercharger ROMs (this fixes issues
with the 6K version of Cubis).
Cleaned up the Serializable infrastructure, making sure that all
classes that need to implement it actually do so now.
Fixed issue with editable widgets in the UI, where pressing Enter
on the keypad wasn't actually being registered.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1849 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-08-05 16:05:34 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doRewind()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("rewind");
|
|
|
|
}
|
|
|
|
|
2005-06-24 12:01:27 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2011-05-26 16:14:46 +00:00
|
|
|
void DebuggerDialog::doExitDebugger()
|
2005-06-24 12:01:27 +00:00
|
|
|
{
|
2008-06-13 13:14:52 +00:00
|
|
|
instance().debugger().parser().run("run");
|
2005-06-24 12:01:27 +00:00
|
|
|
}
|
2011-05-26 16:14:46 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doExitRom()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("exitrom");
|
|
|
|
}
|