More additions to the TiaWidget, but none of it is functional yet :)

Increased debugger window width to 639 pixels.  We've already passed the
512x384 mark, so it's no use restricting width to 512 anymore.  Besides,
the extra width will come in handy for the TiaWidget, and maybe the
PromptWidget can now use one less line in the state() display.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@613 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-07-06 19:09:26 +00:00
parent 1b81357126
commit d0534cb746
7 changed files with 136 additions and 27 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Debugger.cxx,v 1.50 2005-07-03 08:15:31 urchlay Exp $
// $Id: Debugger.cxx,v 1.51 2005-07-06 19:09:24 stephena Exp $
//============================================================================
#include "bspf.hxx"
@ -404,7 +404,7 @@ void Debugger::writeRAM(uInt16 offset, uInt8 value)
/* Element 0 of args is the address. The remaining elements are the data
to poke, starting at the given address.
*/
const string Debugger::setRAM(IntArray args) {
const string Debugger::setRAM(IntArray& args) {
char buf[10];
int count = args.size();

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Debugger.hxx,v 1.40 2005-07-03 08:15:31 urchlay Exp $
// $Id: Debugger.hxx,v 1.41 2005-07-06 19:09:25 stephena Exp $
//============================================================================
#ifndef DEBUGGER_HXX
@ -35,7 +35,7 @@ class D6502;
#include "bspf.hxx"
enum {
kDebuggerWidth = 511,
kDebuggerWidth = 639,
kDebuggerLineHeight = 12, // based on the height of the console font
kDebuggerLines = 15,
};
@ -51,7 +51,7 @@ enum {
for all debugging operations in Stella (parser, 6502 debugger, etc).
@author Stephen Anthony
@version $Id: Debugger.hxx,v 1.40 2005-07-03 08:15:31 urchlay Exp $
@version $Id: Debugger.hxx,v 1.41 2005-07-06 19:09:25 stephena Exp $
*/
class Debugger : public DialogContainer
{
@ -185,7 +185,7 @@ class Debugger : public DialogContainer
void writeRAM(uInt16 addr, uInt8 value);
// set a bunch of RAM locations at once
const string setRAM(IntArray args);
const string setRAM(IntArray& args);
bool start();
void quit();

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: CpuWidget.cxx,v 1.11 2005-07-05 18:00:05 stephena Exp $
// $Id: CpuWidget.cxx,v 1.12 2005-07-06 19:09:26 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -127,6 +127,8 @@ CpuWidget::CpuWidget(GuiObject* boss, int x, int y, int w, int h)
on.push_back(onstr[i]);
}
myPSRegister->setList(off, on);
loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: GuiUtils.hxx,v 1.12 2005-07-02 01:28:43 stephena Exp $
// $Id: GuiUtils.hxx,v 1.13 2005-07-06 19:09:26 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -29,7 +29,7 @@
Probably not very neat, but at least it works ...
@author Stephen Anthony
@version $Id: GuiUtils.hxx,v 1.12 2005-07-02 01:28:43 stephena Exp $
@version $Id: GuiUtils.hxx,v 1.13 2005-07-06 19:09:26 stephena Exp $
*/
#define kLineHeight 12
@ -55,6 +55,7 @@ enum {
kDefaultsCmd = 'DEFA',
kSetPositionCmd = 'SETP',
kActiveWidgetCmd = 'ACTW',
kCheckActionCmd = 'CBAC',
kRendererChanged,
kAspectRatioChanged,
kFrameRateChanged,

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: RamWidget.cxx,v 1.15 2005-07-05 18:00:05 stephena Exp $
// $Id: RamWidget.cxx,v 1.16 2005-07-06 19:09:26 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -136,6 +136,8 @@ RamWidget::RamWidget(GuiObject* boss, int x, int y, int w, int h)
ypos += 16 + space;
b = new ButtonWidget(boss, xpos, ypos, buttonw, 16, ">>", kDGShiftRCmd, 0);
b->setTarget(myRamGrid);
loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: TiaWidget.cxx,v 1.3 2005-07-06 15:09:16 stephena Exp $
// $Id: TiaWidget.cxx,v 1.4 2005-07-06 19:09:26 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -34,10 +34,17 @@
// We need ID's, since there are more than one of several types of widgets
enum {
kRamID,
kCOLUP0ID,
kCOLUP1ID,
kCOLUBKID,
kCOLUPFID
kColorRegsID,
kVSyncID,
kVBlankID
};
// Color registers
enum {
kCOLUP0Addr,
kCOLUP1Addr,
kCOLUBKAddr,
kCOLUPFAddr
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -97,6 +104,43 @@ TiaWidget::TiaWidget(GuiObject* boss, int x, int y, int w, int h)
myBinValue->setFont(font);
myBinValue->setEditable(false);
// Scanline count and VSync/VBlank toggles
xpos = 10; ypos += 2 * kLineHeight;
new StaticTextWidget(boss, xpos, ypos, 40, kLineHeight, "Scanline: ", kTextAlignLeft);
xpos += 40;
myScanlines = new EditTextWidget(boss, xpos, ypos-2, 40, kLineHeight, "");
myScanlines->clearFlags(WIDGET_TAB_NAVIGATE);
myScanlines->setFont(font);
myScanlines->setEditable(false);
xpos += 55; ypos -= 3;
myVSync = new CheckboxWidget(boss, xpos, ypos, 25, kLineHeight, "VSync",
kCheckActionCmd);
myVSync->setTarget(this);
myVSync->setID(kVSyncID);
myVSync->setFlags(WIDGET_TAB_NAVIGATE);
xpos += 60;
myVBlank = new CheckboxWidget(boss, xpos, ypos, 30, kLineHeight, "VBlank",
kCheckActionCmd);
myVBlank->setTarget(this);
myVBlank->setID(kVBlankID);
myVBlank->setFlags(WIDGET_TAB_NAVIGATE);
// Color registers
const char* regNames[] = { "COLUP0", "COLUP1", "COLUPF", "COLUBK" };
xpos = 10; ypos += 2* kLineHeight;
for(int row = 0; row < 4; ++row)
{
StaticTextWidget* t = new StaticTextWidget(boss, xpos, ypos + row*kLineHeight + 2,
40, kLineHeight,
regNames[row] + string(":"),
kTextAlignLeft);
}
xpos += 40;
myColorRegs = new DataGridWidget(boss, xpos, ypos-1, 1, 4, 2, 8, kBASE_16);
myColorRegs->setTarget(this);
myColorRegs->setID(kColorRegsID);
/*
// Add some buttons for common actions
ButtonWidget* b;
@ -109,6 +153,7 @@ TiaWidget::TiaWidget(GuiObject* boss, int x, int y, int w, int h)
// b = new ButtonWidget(boss, xpos, ypos, buttonw, 16, "", kRCmd, 0);
// b->setTarget(this);
*/
loadConfig();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -136,6 +181,10 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
changeRam();
break;
case kColorRegsID:
changeColorRegs();
break;
default:
cerr << "TiaWidget DG changed\n";
break;
@ -145,17 +194,33 @@ void TiaWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
break;
case kDGSelectionChangedCmd:
// FIXME - for now, only the RAM has multiple cells, so it's the only one
// that can receive this signal
addr = myRamGrid->getSelectedAddr();
value = myRamGrid->getSelectedValue();
switch(id)
{
case kRamID:
addr = myRamGrid->getSelectedAddr();
value = myRamGrid->getSelectedValue();
buf = instance()->debugger().equates()->getLabel(addr);
if(buf) myLabel->setEditString(buf);
else myLabel->setEditString("");
buf = instance()->debugger().equates()->getLabel(addr);
if(buf) myLabel->setEditString(buf);
else myLabel->setEditString("");
myDecValue->setEditString(instance()->debugger().valueToString(value, kBASE_10));
myBinValue->setEditString(instance()->debugger().valueToString(value, kBASE_2));
myDecValue->setEditString(instance()->debugger().valueToString(value, kBASE_10));
myBinValue->setEditString(instance()->debugger().valueToString(value, kBASE_2));
break;
}
break;
case kCheckActionCmd:
switch(id)
{
case kVSyncID:
cerr << "vsync toggled\n";
break;
case kVBlankID:
cerr << "vblank toggled\n";
break;
}
break;
}
@ -172,12 +237,14 @@ void TiaWidget::loadConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TiaWidget::fillGrid()
{
// FIXME - have these widget get correct values from TIADebug
Debugger& dbg = instance()->debugger();
AddrList alist;
ValueList vlist;
BoolArray changed;
// FIXME - have this actually talk to TIADebug
Debugger& dbg = instance()->debugger();
// TIA RAM
alist.clear(); vlist.clear(); changed.clear();
for(unsigned int i = 0; i < 16; i++)
{
alist.push_back(i);
@ -185,11 +252,25 @@ void TiaWidget::fillGrid()
changed.push_back(false);
}
myRamGrid->setList(alist, vlist, changed);
// Scanline and VSync/VBlank
// FIXME
// Color registers
alist.clear(); vlist.clear(); changed.clear();
for(unsigned int i = 0; i < 4; i++)
{
alist.push_back(i);
vlist.push_back(i);
changed.push_back(false);
}
myColorRegs->setList(alist, vlist, changed);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TiaWidget::changeRam()
{
cerr << "TiaWidget::changeRam()\n";
int addr = myRamGrid->getSelectedAddr();
int value = myRamGrid->getSelectedValue();
@ -197,3 +278,13 @@ void TiaWidget::changeRam()
myDecValue->setEditString(instance()->debugger().valueToString(value, kBASE_10));
myBinValue->setEditString(instance()->debugger().valueToString(value, kBASE_2));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void TiaWidget::changeColorRegs()
{
cerr << "TiaWidget::changeColorRegs()\n";
int addr = myColorRegs->getSelectedAddr();
int value = myColorRegs->getSelectedValue();
//FIXME instance()->debugger().writeRAM(addr - kRamStart, value);
}

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: TiaWidget.hxx,v 1.3 2005-07-06 15:09:16 stephena Exp $
// $Id: TiaWidget.hxx,v 1.4 2005-07-06 19:09:26 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -47,6 +47,7 @@ class TiaWidget : public Widget, public CommandSender
private:
void fillGrid();
void changeRam();
void changeColorRegs();
private:
Widget* myActiveWidget;
@ -55,6 +56,18 @@ class TiaWidget : public Widget, public CommandSender
EditTextWidget* myBinValue;
EditTextWidget* myDecValue;
EditTextWidget* myLabel;
EditTextWidget* myScanlines;
CheckboxWidget* myVSync;
CheckboxWidget* myVBlank;
DataGridWidget* myColorRegs;
/* FIXME - add widget for this, with ability to show color wheel or something
PaletteWidget* myCOLUP0Color;
PaletteWidget* myCOLUP1Color;
PaletteWidget* myCOLUPFColor;
PaletteWidget* myCOLUBKColor;
*/
};
#endif