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
|
|
|
//============================================================================
|
|
|
|
|
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-06-17 14:42:49 +00:00
|
|
|
#include "Debugger.hxx"
|
2005-09-15 19:43:36 +00:00
|
|
|
#include "DebuggerParser.hxx"
|
2013-08-12 15:02:38 +00:00
|
|
|
#include "ConsoleFont.hxx"
|
|
|
|
#include "ConsoleMediumFont.hxx"
|
|
|
|
#include "StellaMediumFont.hxx"
|
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),
|
2013-08-12 15:02:38 +00:00
|
|
|
myFont(NULL),
|
2011-05-26 16:14:46 +00:00
|
|
|
myFatalError(NULL)
|
2005-06-03 17:52:06 +00:00
|
|
|
{
|
2013-08-13 16:44:23 +00:00
|
|
|
createFont(); // Font is sized according to available space
|
2013-08-12 15:02:38 +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
|
|
|
|
2013-08-19 15:23:33 +00:00
|
|
|
// Inform the TIA output widget about its associated zoom widget
|
2005-08-31 22:34:43 +00:00
|
|
|
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
|
|
|
{
|
2013-08-12 15:02:38 +00:00
|
|
|
delete myFont;
|
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
|
|
|
|
2013-05-29 16:27:12 +00:00
|
|
|
myMessageBox->setText("");
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-15 16:07:58 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doStep()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("step");
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doTrace()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("trace");
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doAdvance()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("frame #1");
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doScanlineAdvance()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("scanline #1");
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doRewind()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("rewind");
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doExitDebugger()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("run");
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::doExitRom()
|
|
|
|
{
|
|
|
|
instance().debugger().parser().run("exitrom");
|
|
|
|
}
|
2013-08-12 15:02:38 +00:00
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::createFont()
|
|
|
|
{
|
|
|
|
// For now, these sizes are hardcoded based on actual font size
|
|
|
|
if(_w >= kLargeFontMinW && _h >= kLargeFontMinH)
|
|
|
|
myFont = new GUI::Font(GUI::stellaMediumDesc);
|
|
|
|
else if(_w >= kMediumFontMinW && _h >= kMediumFontMinH)
|
|
|
|
myFont = new GUI::Font(GUI::consoleMediumDesc);
|
|
|
|
else
|
|
|
|
myFont = new GUI::Font(GUI::consoleDesc);
|
|
|
|
}
|
|
|
|
|
2011-05-26 16:14:46 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::showFatalMessage(const string& msg)
|
|
|
|
{
|
|
|
|
delete myFatalError;
|
|
|
|
myFatalError =
|
2013-08-12 15:02:38 +00:00
|
|
|
new GUI::MessageBox(this, *myFont, msg,
|
2013-08-19 15:23:33 +00:00
|
|
|
_w*0.5, _h*0.5, kDDExitFatalCmd,
|
2013-02-10 22:26:06 +00:00
|
|
|
"Exit ROM", "Continue");
|
2011-05-26 16:14:46 +00:00
|
|
|
myFatalError->show();
|
|
|
|
}
|
|
|
|
|
2005-07-19 17:59:59 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void DebuggerDialog::addTiaArea()
|
|
|
|
{
|
2013-08-13 16:44:23 +00:00
|
|
|
const GUI::Rect& r = getTiaBounds();
|
2005-07-19 17:59:59 +00:00
|
|
|
|
2013-08-12 15:02:38 +00:00
|
|
|
myTiaOutput = new TiaOutputWidget(this, *myFont,
|
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()
|
|
|
|
{
|
2013-08-13 16:44:23 +00:00
|
|
|
const GUI::Rect& r = 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
|
2013-08-12 15:02:38 +00:00
|
|
|
myTab = new TabWidget(this, *myFont, 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
|
2013-06-29 00:02:49 +00:00
|
|
|
tabID = myTab->addTab(" Prompt ");
|
2013-08-12 15:02:38 +00:00
|
|
|
myPrompt = new PromptWidget(myTab, *myFont,
|
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");
|
2013-08-12 15:02:38 +00:00
|
|
|
TiaWidget* tia = new TiaWidget(myTab, *myFont,
|
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");
|
2013-08-12 15:02:38 +00:00
|
|
|
RiotWidget* riot = new RiotWidget(myTab, *myFont,
|
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");
|
2013-08-12 15:02:38 +00:00
|
|
|
AudioWidget* aud = new AudioWidget(myTab, *myFont,
|
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()
|
|
|
|
{
|
2013-08-12 15:02:38 +00:00
|
|
|
const GUI::Font& font = *myFont;
|
2007-08-14 19:49:21 +00:00
|
|
|
const int lineHeight = font.getLineHeight();
|
2013-08-13 16:44:23 +00:00
|
|
|
const GUI::Rect& r = getStatusBounds();
|
2005-08-31 19:15:10 +00:00
|
|
|
int xpos, ypos;
|
|
|
|
|
|
|
|
xpos = r.left; ypos = r.top;
|
2013-08-12 15:02:38 +00:00
|
|
|
myTiaInfo = new TiaInfoWidget(this, *myFont, xpos, ypos);
|
2005-08-31 19:15:10 +00:00
|
|
|
|
|
|
|
ypos += myTiaInfo->getHeight() + 10;
|
2013-08-12 15:02:38 +00:00
|
|
|
myTiaZoom = new TiaZoomWidget(this, *myFont, 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;
|
2013-08-12 15:02:38 +00:00
|
|
|
myMessageBox = new EditTextWidget(this, *myFont,
|
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()
|
|
|
|
{
|
2013-08-13 16:44:23 +00:00
|
|
|
const GUI::Rect& r = 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;
|
|
|
|
|
2013-08-12 15:02:38 +00:00
|
|
|
int bwidth = myFont->getStringWidth("Frame +1 "),
|
|
|
|
bheight = myFont->getLineHeight() + 2;
|
2006-03-23 16:16:33 +00:00
|
|
|
int buttonX = r.right - bwidth - 5, buttonY = r.top + 5;
|
2013-08-12 15:02:38 +00:00
|
|
|
new ButtonWidget(this, *myFont, buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Step", kDDStepCmd);
|
|
|
|
buttonY += bheight + 4;
|
2013-08-12 15:02:38 +00:00
|
|
|
new ButtonWidget(this, *myFont, buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Trace", kDDTraceCmd);
|
|
|
|
buttonY += bheight + 4;
|
2013-08-12 15:02:38 +00:00
|
|
|
new ButtonWidget(this, *myFont, buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Scan +1", kDDSAdvCmd);
|
|
|
|
buttonY += bheight + 4;
|
2013-08-12 15:02:38 +00:00
|
|
|
new ButtonWidget(this, *myFont, buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Frame +1", kDDAdvCmd);
|
|
|
|
buttonY += bheight + 4;
|
2013-08-12 15:02:38 +00:00
|
|
|
new ButtonWidget(this, *myFont, buttonX, buttonY,
|
2006-03-23 16:16:33 +00:00
|
|
|
bwidth, bheight, "Exit", kDDExitCmd);
|
2009-08-25 12:46:56 +00:00
|
|
|
|
2013-08-12 15:02:38 +00:00
|
|
|
bwidth = myFont->getStringWidth("< ") + 4;
|
2009-08-25 12:46:56 +00:00
|
|
|
bheight = bheight * 5 + 4*4;
|
|
|
|
buttonX -= (bwidth + 5);
|
|
|
|
buttonY = r.top + 5;
|
|
|
|
myRewindButton =
|
2013-08-12 15:02:38 +00:00
|
|
|
new ButtonWidget(this, *myFont, buttonX, buttonY,
|
2009-08-25 12:46:56 +00:00
|
|
|
bwidth, bheight, "<", kDDRewindCmd);
|
|
|
|
myRewindButton->clearFlags(WIDGET_ENABLED);
|
2005-08-22 13:53:23 +00:00
|
|
|
|
2013-08-19 17:45:17 +00:00
|
|
|
int xpos = buttonX - 8*myFont->getMaxCharWidth() - 20, ypos = 20;
|
|
|
|
DataGridOpsWidget* ops = new DataGridOpsWidget(this, *myFont, xpos, ypos);
|
|
|
|
|
|
|
|
int max_w = xpos - r.left - 10;
|
|
|
|
xpos = r.left + 10; ypos = 10;
|
|
|
|
myCpu = new CpuWidget(this, *myFont, xpos, ypos, max_w);
|
|
|
|
addToFocusList(myCpu->getFocusList());
|
|
|
|
|
|
|
|
xpos = r.left + 10; ypos += myCpu->getHeight() + 10;
|
|
|
|
myRam = new RamWidget(this, *myFont, xpos, ypos);
|
|
|
|
addToFocusList(myRam->getFocusList());
|
|
|
|
|
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;
|
2013-05-01 16:56:43 +00:00
|
|
|
const int tabWidth = r.width() - vBorder - 1;
|
|
|
|
const int tabHeight = r.height() - ypos - 1;
|
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
|
|
|
int tabID;
|
|
|
|
|
|
|
|
// Since there are two tab widgets in this dialog, we specifically
|
|
|
|
// assign an ID of 1
|
|
|
|
myRomTab = new TabWidget(
|
2013-08-12 15:02:38 +00:00
|
|
|
this, *myFont, xpos, ypos, tabWidth, tabHeight);
|
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->setID(1);
|
|
|
|
addTabWidget(myRomTab);
|
|
|
|
|
|
|
|
// The main disassembly tab
|
|
|
|
tabID = myRomTab->addTab(" Disassembly ");
|
2013-08-12 15:02:38 +00:00
|
|
|
myRom = new RomWidget(myRomTab, *myFont,
|
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
|
|
|
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(
|
2013-08-12 15:02:38 +00:00
|
|
|
myRomTab, *myFont, 2, 2, tabWidth - 1,
|
2013-04-04 21:38:22 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2013-08-13 16:44:23 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
GUI::Rect DebuggerDialog::getTiaBounds() const
|
|
|
|
{
|
|
|
|
// The area showing the TIA image (NTSC and PAL supported, up to 260 lines)
|
2013-08-19 15:23:33 +00:00
|
|
|
GUI::Rect r(0, 0, 320, BSPF_max(260, (int)(_h * 0.35)));
|
2013-08-13 16:44:23 +00:00
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
GUI::Rect DebuggerDialog::getRomBounds() const
|
|
|
|
{
|
|
|
|
// The ROM area is the full area to the right of the tabs
|
|
|
|
const GUI::Rect& status = getStatusBounds();
|
2013-08-19 15:23:33 +00:00
|
|
|
GUI::Rect r(status.right + 1, 0, _w, _h);
|
2013-08-13 16:44:23 +00:00
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
GUI::Rect DebuggerDialog::getStatusBounds() const
|
|
|
|
{
|
|
|
|
// The status area is the full area to the right of the TIA image
|
|
|
|
// extending as far as necessary
|
|
|
|
// 30% of any space above 1030 pixels will be allocated to this area
|
|
|
|
const GUI::Rect& tia = getTiaBounds();
|
|
|
|
|
|
|
|
int x1 = tia.right + 1;
|
|
|
|
int y1 = 0;
|
2013-08-19 15:23:33 +00:00
|
|
|
int x2 = tia.right + 225 + (_w > 1030 ? (int) (0.35 * (_w - 1030)) : 0);
|
2013-08-13 16:44:23 +00:00
|
|
|
int y2 = tia.bottom;
|
|
|
|
GUI::Rect r(x1, y1, x2, y2);
|
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
GUI::Rect DebuggerDialog::getTabBounds() const
|
|
|
|
{
|
|
|
|
// The tab area is the full area below the TIA image
|
|
|
|
const GUI::Rect& tia = getTiaBounds();
|
|
|
|
const GUI::Rect& status = getStatusBounds();
|
2013-08-19 15:23:33 +00:00
|
|
|
GUI::Rect r(0, tia.bottom + 1, status.right + 1, _h);
|
2013-08-13 16:44:23 +00:00
|
|
|
|
|
|
|
return r;
|
|
|
|
}
|