mirror of https://github.com/stella-emu/stella.git
First pass at TiaInfoWidget, which uses the area to the right of
the TIA image to show frame/scanline related info. In the future, this area will also show a zoomed region of the current TIA image, as well as a small message window. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@689 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
a9e007ca24
commit
042977d4cf
|
@ -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: CpuDebug.hxx,v 1.7 2005-07-19 01:31:36 urchlay Exp $
|
||||
// $Id: CpuDebug.hxx,v 1.8 2005-07-21 19:29:59 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#ifndef CPU_DEBUG_HXX
|
||||
|
@ -53,7 +53,7 @@ class CpuDebug : public DebuggerSystem
|
|||
|
||||
int disassemble(int address, char* buffer, EquateList* equateList);
|
||||
int dPeek(int address);
|
||||
int getBank();
|
||||
int getBank();
|
||||
|
||||
int pc() { return mySystem->m6502().PC; }
|
||||
int sp() { return mySystem->m6502().SP; }
|
||||
|
@ -65,7 +65,7 @@ class CpuDebug : public DebuggerSystem
|
|||
int n() { return mySystem->m6502().N; }
|
||||
int v() { return mySystem->m6502().V; }
|
||||
int b() { return mySystem->m6502().B; }
|
||||
int d() { return mySystem->m6502().D; }
|
||||
int d() { return mySystem->m6502().D; }
|
||||
int i() { return mySystem->m6502().I; }
|
||||
int z() { return !mySystem->m6502().notZ; }
|
||||
int c() { return mySystem->m6502().C; }
|
||||
|
|
|
@ -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.74 2005-07-21 04:10:15 urchlay Exp $
|
||||
// $Id: Debugger.cxx,v 1.75 2005-07-21 19:30:14 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#include "bspf.hxx"
|
||||
|
@ -38,6 +38,7 @@
|
|||
#include "RamDebug.hxx"
|
||||
#include "TIADebug.hxx"
|
||||
|
||||
#include "TiaInfoWidget.hxx"
|
||||
#include "TiaOutputWidget.hxx"
|
||||
#include "Expression.hxx"
|
||||
|
||||
|
@ -54,6 +55,7 @@ Debugger::Debugger(OSystem* osystem)
|
|||
myCpuDebug(NULL),
|
||||
myRamDebug(NULL),
|
||||
myTiaDebug(NULL),
|
||||
myTiaInfo(NULL),
|
||||
myTiaOutput(NULL),
|
||||
equateList(NULL),
|
||||
breakPoints(NULL),
|
||||
|
@ -97,9 +99,10 @@ void Debugger::initialize()
|
|||
delete myBaseDialog;
|
||||
DebuggerDialog *dd = new DebuggerDialog(myOSystem, this,
|
||||
r.left, r.top, r.width(), r.height());
|
||||
myPrompt = dd->prompt();
|
||||
myBaseDialog = dd;
|
||||
|
||||
myPrompt = dd->prompt();
|
||||
myTiaInfo = dd->tiaInfo();
|
||||
myTiaOutput = dd->tiaOutput();
|
||||
|
||||
// set up any breakpoint that was on the command line
|
||||
|
@ -601,6 +604,8 @@ int Debugger::step()
|
|||
mySystem->m6502().execute(1);
|
||||
mySystem->lockDataBus();
|
||||
|
||||
myBaseDialog->loadConfig();
|
||||
|
||||
return mySystem->cycles() - cyc;
|
||||
}
|
||||
|
||||
|
@ -631,6 +636,7 @@ int Debugger::trace()
|
|||
mySystem->m6502().execute(1);
|
||||
|
||||
mySystem->lockDataBus();
|
||||
myBaseDialog->loadConfig();
|
||||
|
||||
return mySystem->cycles() - cyc;
|
||||
} else {
|
||||
|
@ -725,6 +731,7 @@ void Debugger::nextScanline(int lines) {
|
|||
mySystem->unlockDataBus();
|
||||
myTiaOutput->advanceScanline(lines);
|
||||
mySystem->lockDataBus();
|
||||
myBaseDialog->loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -733,6 +740,7 @@ void Debugger::nextFrame(int frames) {
|
|||
mySystem->unlockDataBus();
|
||||
myTiaOutput->advance(frames);
|
||||
mySystem->lockDataBus();
|
||||
myBaseDialog->loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -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.59 2005-07-21 03:26:58 urchlay Exp $
|
||||
// $Id: Debugger.hxx,v 1.60 2005-07-21 19:30:15 stephena Exp $
|
||||
//============================================================================
|
||||
|
||||
#ifndef DEBUGGER_HXX
|
||||
|
@ -25,6 +25,7 @@ class System;
|
|||
class CpuDebug;
|
||||
class RamDebug;
|
||||
class TIADebug;
|
||||
class TiaInfoWidget;
|
||||
class TiaOutputWidget;
|
||||
class Expression;
|
||||
|
||||
|
@ -73,7 +74,7 @@ typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)();
|
|||
for all debugging operations in Stella (parser, 6502 debugger, etc).
|
||||
|
||||
@author Stephen Anthony
|
||||
@version $Id: Debugger.hxx,v 1.59 2005-07-21 03:26:58 urchlay Exp $
|
||||
@version $Id: Debugger.hxx,v 1.60 2005-07-21 19:30:15 stephena Exp $
|
||||
*/
|
||||
class Debugger : public DialogContainer
|
||||
{
|
||||
|
@ -333,6 +334,7 @@ class Debugger : public DialogContainer
|
|||
RamDebug* myRamDebug;
|
||||
TIADebug* myTiaDebug;
|
||||
|
||||
TiaInfoWidget* myTiaInfo;
|
||||
TiaOutputWidget* myTiaOutput;
|
||||
|
||||
EquateList *equateList;
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
//============================================================================
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||
//
|
||||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: TiaInfoWidget.cxx,v 1.1 2005-07-21 19:30:15 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
//============================================================================
|
||||
|
||||
#include "OSystem.hxx"
|
||||
#include "FrameBuffer.hxx"
|
||||
#include "Debugger.hxx"
|
||||
#include "TIADebug.hxx"
|
||||
#include "Widget.hxx"
|
||||
#include "EditTextWidget.hxx"
|
||||
#include "GuiObject.hxx"
|
||||
|
||||
#include "TiaInfoWidget.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
TiaInfoWidget::TiaInfoWidget(GuiObject* boss, int x, int y, int w, int h)
|
||||
: Widget(boss, x, y, w, h),
|
||||
CommandSender(boss)
|
||||
{
|
||||
int xpos = x, ypos = y, lwidth = 45;
|
||||
const GUI::Font& font = instance()->consoleFont();
|
||||
|
||||
// Add frame info
|
||||
xpos = x + 10; ypos = y + 10;
|
||||
new StaticTextWidget(boss, xpos, ypos, lwidth, kLineHeight, "Frame:", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myFrameCount = new EditTextWidget(boss, xpos, ypos-2, 45, kLineHeight, "");
|
||||
myFrameCount->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myFrameCount->setFont(font);
|
||||
myFrameCount->setEditable(false);
|
||||
|
||||
xpos = x + 10; ypos += kLineHeight + 5;
|
||||
new StaticTextWidget(boss, xpos, ypos, lwidth, kLineHeight, "F. Cycles:", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myFrameCycles = new EditTextWidget(boss, xpos, ypos-2, 45, kLineHeight, "");
|
||||
myFrameCycles->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myFrameCycles->setFont(font);
|
||||
myFrameCycles->setEditable(false);
|
||||
|
||||
xpos = x + 20; ypos += kLineHeight + 5;
|
||||
myVSync = new CheckboxWidget(boss, xpos, ypos-3, 25, kLineHeight, "VSync", 0);
|
||||
myVSync->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myVSync->setEditable(false);
|
||||
|
||||
xpos = x + 20; ypos += kLineHeight + 5;
|
||||
myVBlank = new CheckboxWidget(boss, xpos, ypos-3, 30, kLineHeight, "VBlank", 0);
|
||||
myVBlank->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myVBlank->setEditable(false);
|
||||
|
||||
xpos = x + 10 + 100; ypos = y + 10;
|
||||
new StaticTextWidget(boss, xpos, ypos, lwidth, kLineHeight, "Scanline:", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myScanlineCount = new EditTextWidget(boss, xpos, ypos-2, 30, kLineHeight, "");
|
||||
myScanlineCount->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myScanlineCount->setFont(font);
|
||||
myScanlineCount->setEditable(false);
|
||||
|
||||
xpos = x + 10 + 100; ypos += kLineHeight + 5;
|
||||
new StaticTextWidget(boss, xpos, ypos, lwidth, kLineHeight, "S. Cycles:", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myScanlineCycles = new EditTextWidget(boss, xpos, ypos-2, 30, kLineHeight, "");
|
||||
myScanlineCycles->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myScanlineCycles->setFont(font);
|
||||
myScanlineCycles->setEditable(false);
|
||||
|
||||
xpos = x + 10 + 100; ypos += kLineHeight + 5;
|
||||
new StaticTextWidget(boss, xpos, ypos, lwidth, kLineHeight, "Pixel Pos:", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myPixelPosition = new EditTextWidget(boss, xpos, ypos-2, 30, kLineHeight, "");
|
||||
myPixelPosition->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myPixelPosition->setFont(font);
|
||||
myPixelPosition->setEditable(false);
|
||||
|
||||
xpos = x + 10 + 100; ypos += kLineHeight + 5;
|
||||
new StaticTextWidget(boss, xpos, ypos, lwidth, kLineHeight, "Color Clk:", kTextAlignLeft);
|
||||
xpos += lwidth;
|
||||
myColorClocks = new EditTextWidget(boss, xpos, ypos-2, 30, kLineHeight, "");
|
||||
myColorClocks->clearFlags(WIDGET_TAB_NAVIGATE);
|
||||
myColorClocks->setFont(font);
|
||||
myColorClocks->setEditable(false);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
TiaInfoWidget::~TiaInfoWidget()
|
||||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TiaInfoWidget::handleMouseDown(int x, int y, int button, int clickCount)
|
||||
{
|
||||
cerr << "TiaInfoWidget button press: x = " << x << ", y = " << y << endl;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TiaInfoWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
||||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void TiaInfoWidget::loadConfig()
|
||||
{
|
||||
Debugger& dbg = instance()->debugger();
|
||||
TIADebug& tia = dbg.tiaDebug();
|
||||
|
||||
myFrameCount->setEditString(dbg.valueToString(tia.frameCount(), kBASE_10));
|
||||
myFrameCycles->setEditString(dbg.valueToString(dbg.cycles(), kBASE_10));
|
||||
|
||||
myVSync->setState(tia.vsync());
|
||||
myVBlank->setState(tia.vblank());
|
||||
|
||||
int clk = tia.clocksThisLine();
|
||||
myScanlineCount->setEditString(dbg.valueToString(tia.scanlines(), kBASE_10));
|
||||
myScanlineCycles->setEditString(dbg.valueToString(clk/3, kBASE_10));
|
||||
myPixelPosition->setEditString(dbg.valueToString(clk-68, kBASE_10));
|
||||
myColorClocks->setEditString(dbg.valueToString(clk, kBASE_10));
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
//============================================================================
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
|
||||
//
|
||||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: TiaInfoWidget.hxx,v 1.1 2005-07-21 19:30:15 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
//============================================================================
|
||||
|
||||
#ifndef TIA_INFO_WIDGET_HXX
|
||||
#define TIA_INFO_WIDGET_HXX
|
||||
|
||||
class GuiObject;
|
||||
class EditTextWidget;
|
||||
|
||||
#include "Widget.hxx"
|
||||
#include "Command.hxx"
|
||||
|
||||
|
||||
class TiaInfoWidget : public Widget, public CommandSender
|
||||
{
|
||||
public:
|
||||
TiaInfoWidget(GuiObject *boss, int x, int y, int w, int h);
|
||||
virtual ~TiaInfoWidget();
|
||||
|
||||
void loadConfig();
|
||||
|
||||
protected:
|
||||
void handleMouseDown(int x, int y, int button, int clickCount);
|
||||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||
|
||||
private:
|
||||
EditTextWidget* myFrameCount;
|
||||
EditTextWidget* myFrameCycles;
|
||||
|
||||
EditTextWidget* myScanlineCount;
|
||||
EditTextWidget* myScanlineCycles;
|
||||
EditTextWidget* myPixelPosition;
|
||||
EditTextWidget* myColorClocks;
|
||||
|
||||
CheckboxWidget* myVSync;
|
||||
CheckboxWidget* myVBlank;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -40,6 +40,7 @@ MODULE_OBJS := \
|
|||
src/debugger/CpuDebug.o \
|
||||
src/debugger/RamDebug.o \
|
||||
src/debugger/TIADebug.o \
|
||||
src/debugger/TiaInfoWidget.o \
|
||||
src/debugger/TiaOutputWidget.o
|
||||
|
||||
MODULE_DIRS += \
|
||||
|
|
|
@ -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: DebuggerDialog.cxx,v 1.26 2005-07-19 17:59:59 stephena Exp $
|
||||
// $Id: DebuggerDialog.cxx,v 1.27 2005-07-21 19:30:16 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -23,6 +23,7 @@
|
|||
#include "Dialog.hxx"
|
||||
#include "TabWidget.hxx"
|
||||
#include "TiaOutputWidget.hxx"
|
||||
#include "TiaInfoWidget.hxx"
|
||||
#include "PromptWidget.hxx"
|
||||
#include "CpuWidget.hxx"
|
||||
#include "RamWidget.hxx"
|
||||
|
@ -61,6 +62,7 @@ DebuggerDialog::~DebuggerDialog()
|
|||
void DebuggerDialog::loadConfig()
|
||||
{
|
||||
myTab->loadConfig();
|
||||
myTiaInfo->loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -194,37 +196,31 @@ void DebuggerDialog::addTabArea()
|
|||
void DebuggerDialog::addStatusArea()
|
||||
{
|
||||
GUI::Rect r = instance()->debugger().getStatusBounds();
|
||||
|
||||
new StaticTextWidget(this, r.left, r.top, 100, kLineHeight,
|
||||
"Just a test", kTextAlignLeft);
|
||||
myTiaInfo = new TiaInfoWidget(this, r.left, r.top, r.width(), r.height());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DebuggerDialog::doStep()
|
||||
{
|
||||
instance()->debugger().step();
|
||||
myTab->loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DebuggerDialog::doTrace()
|
||||
{
|
||||
instance()->debugger().trace();
|
||||
myTab->loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DebuggerDialog::doAdvance()
|
||||
{
|
||||
instance()->debugger().nextFrame(1);
|
||||
myTab->loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void DebuggerDialog::doScanlineAdvance()
|
||||
{
|
||||
instance()->debugger().nextScanline(1);
|
||||
myTab->loadConfig();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -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: DebuggerDialog.hxx,v 1.13 2005-07-19 17:59:59 stephena Exp $
|
||||
// $Id: DebuggerDialog.hxx,v 1.14 2005-07-21 19:30:16 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -26,6 +26,7 @@ class Debugger;
|
|||
class OSystem;
|
||||
class DialogContainer;
|
||||
class TabWidget;
|
||||
class TiaInfoWidget;
|
||||
class TiaOutputWidget;
|
||||
|
||||
#include "Dialog.hxx"
|
||||
|
@ -38,7 +39,8 @@ class DebuggerDialog : public Dialog
|
|||
int x, int y, int w, int h);
|
||||
~DebuggerDialog();
|
||||
|
||||
PromptWidget* prompt() { return myPrompt; }
|
||||
PromptWidget* prompt() { return myPrompt; }
|
||||
TiaInfoWidget* tiaInfo() { return myTiaInfo; }
|
||||
TiaOutputWidget* tiaOutput() { return myTiaOutput; }
|
||||
|
||||
virtual void loadConfig();
|
||||
|
@ -47,8 +49,10 @@ class DebuggerDialog : public Dialog
|
|||
|
||||
protected:
|
||||
TabWidget* myTab;
|
||||
|
||||
PromptWidget* myPrompt;
|
||||
TiaInfoWidget* myTiaInfo;
|
||||
TiaOutputWidget* myTiaOutput;
|
||||
PromptWidget *myPrompt;
|
||||
|
||||
private:
|
||||
void addTiaArea();
|
||||
|
|
|
@ -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.11 2005-07-14 23:47:17 stephena Exp $
|
||||
// $Id: TiaWidget.cxx,v 1.12 2005-07-21 19:30:17 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -105,27 +105,6 @@ 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;
|
||||
|
@ -267,11 +246,6 @@ void TiaWidget::fillGrid()
|
|||
}
|
||||
myRamGrid->setList(alist, vlist, changed);
|
||||
|
||||
// Scanline and VSync/VBlank
|
||||
myScanlines->setEditString(dbg.valueToString(tia.scanlines(), kBASE_10));
|
||||
myVSync->setState(tia.vsync());
|
||||
myVBlank->setState(tia.vblank());
|
||||
|
||||
// Color registers
|
||||
alist.clear(); vlist.clear(); changed.clear();
|
||||
for(unsigned int i = 0; i < 4; i++)
|
||||
|
|
|
@ -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.6 2005-07-14 23:47:17 stephena Exp $
|
||||
// $Id: TiaWidget.hxx,v 1.7 2005-07-21 19:30:17 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -56,10 +56,6 @@ class TiaWidget : public Widget, public CommandSender
|
|||
EditTextWidget* myDecValue;
|
||||
EditTextWidget* myLabel;
|
||||
|
||||
EditTextWidget* myScanlines;
|
||||
CheckboxWidget* myVSync;
|
||||
CheckboxWidget* myVBlank;
|
||||
|
||||
DataGridWidget* myColorRegs;
|
||||
|
||||
ColorWidget* myCOLUP0Color;
|
||||
|
|
|
@ -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: Widget.cxx,v 1.24 2005-07-14 18:28:36 stephena Exp $
|
||||
// $Id: Widget.cxx,v 1.25 2005-07-21 19:30:17 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -387,7 +387,8 @@ static unsigned int checked_img[8] =
|
|||
CheckboxWidget::CheckboxWidget(GuiObject *boss, int x, int y, int w, int h,
|
||||
const string& label, int cmd, uInt8 hotkey)
|
||||
: ButtonWidget(boss, x, y, w, h, label, cmd, hotkey),
|
||||
_state(false)
|
||||
_state(false),
|
||||
_editable(true)
|
||||
{
|
||||
_flags = WIDGET_ENABLED;
|
||||
_type = kCheckboxWidget;
|
||||
|
@ -396,7 +397,7 @@ CheckboxWidget::CheckboxWidget(GuiObject *boss, int x, int y, int w, int h,
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CheckboxWidget::handleMouseUp(int x, int y, int button, int clickCount)
|
||||
{
|
||||
if(isEnabled() && x >= 0 && x < _w && y >= 0 && y < _h)
|
||||
if(isEnabled() && _editable && x >= 0 && x < _w && y >= 0 && y < _h)
|
||||
{
|
||||
toggleState();
|
||||
|
||||
|
|
|
@ -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: Widget.hxx,v 1.24 2005-07-14 23:47:17 stephena Exp $
|
||||
// $Id: Widget.hxx,v 1.25 2005-07-21 19:30:17 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -69,7 +69,7 @@ enum {
|
|||
This is the base class for all widgets.
|
||||
|
||||
@author Stephen Anthony
|
||||
@version $Id: Widget.hxx,v 1.24 2005-07-14 23:47:17 stephena Exp $
|
||||
@version $Id: Widget.hxx,v 1.25 2005-07-21 19:30:17 stephena Exp $
|
||||
*/
|
||||
class Widget : public GuiObject
|
||||
{
|
||||
|
@ -221,6 +221,8 @@ class CheckboxWidget : public ButtonWidget
|
|||
virtual void handleMouseEntered(int button) {}
|
||||
virtual void handleMouseLeft(int button) {}
|
||||
|
||||
void setEditable(bool editable) { _editable = editable; }
|
||||
|
||||
void setState(bool state);
|
||||
void toggleState() { setState(!_state); }
|
||||
bool getState() const { return _state; }
|
||||
|
@ -230,6 +232,7 @@ class CheckboxWidget : public ButtonWidget
|
|||
|
||||
protected:
|
||||
bool _state;
|
||||
bool _editable;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue