mirror of https://github.com/stella-emu/stella.git
First pass at adding controller-specific UI items to the
I/O tab in the debugger. For now, only joystick is partly implemented. Eventually, all Stella controllers will have UI items (where it makes sense), allowing to completely control input devices from within the debugger. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2334 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
0138086583
commit
b10720321a
|
@ -207,25 +207,9 @@ Int32 RiotDebug::timClocks()
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void RiotDebug::setP0Pins(bool Pin1, bool Pin2, bool Pin3, bool Pin4, bool Pin6)
|
Controller& RiotDebug::controller(Controller::Jack jack) const
|
||||||
{
|
{
|
||||||
Controller& port0 = myConsole.controller(Controller::Left);
|
return myConsole.controller(jack);
|
||||||
port0.myDigitalPinState[Controller::One] = Pin1;
|
|
||||||
port0.myDigitalPinState[Controller::Two] = Pin2;
|
|
||||||
port0.myDigitalPinState[Controller::Three] = Pin3;
|
|
||||||
port0.myDigitalPinState[Controller::Four] = Pin4;
|
|
||||||
port0.myDigitalPinState[Controller::Six] = Pin6;
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
void RiotDebug::setP1Pins(bool Pin1, bool Pin2, bool Pin3, bool Pin4, bool Pin6)
|
|
||||||
{
|
|
||||||
Controller& port1 = myConsole.controller(Controller::Right);
|
|
||||||
port1.myDigitalPinState[Controller::One] = Pin1;
|
|
||||||
port1.myDigitalPinState[Controller::Two] = Pin2;
|
|
||||||
port1.myDigitalPinState[Controller::Three] = Pin3;
|
|
||||||
port1.myDigitalPinState[Controller::Four] = Pin4;
|
|
||||||
port1.myDigitalPinState[Controller::Six] = Pin6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -70,13 +70,8 @@ class RiotDebug : public DebuggerSystem
|
||||||
uInt8 timint();
|
uInt8 timint();
|
||||||
Int32 timClocks();
|
Int32 timClocks();
|
||||||
|
|
||||||
/* Controller pins, from the POV of 'outside' the system
|
/* Controller ports */
|
||||||
(ie, state is determined by what the controller sends to the RIOT)
|
Controller& controller(Controller::Jack jack) const;
|
||||||
Setting a pin to false is the same as if the external controller
|
|
||||||
pulled the pin low
|
|
||||||
*/
|
|
||||||
void setP0Pins(bool Pin1, bool Pin2, bool Pin3, bool Pin4, bool Pin6);
|
|
||||||
void setP1Pins(bool Pin1, bool Pin2, bool Pin3, bool Pin4, bool Pin6);
|
|
||||||
|
|
||||||
/* Console switches */
|
/* Console switches */
|
||||||
bool diffP0(int newVal = -1);
|
bool diffP0(int newVal = -1);
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// 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-2012 by Bradford W. Mott, Stephen Anthony
|
||||||
|
// and the Stella Team
|
||||||
|
//
|
||||||
|
// See the file "License.txt" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef CONTROLLER_WIDGET_HXX
|
||||||
|
#define CONTROLLER_WIDGET_HXX
|
||||||
|
|
||||||
|
class GuiObject;
|
||||||
|
class ButtonWidget;
|
||||||
|
|
||||||
|
#include "Widget.hxx"
|
||||||
|
#include "Command.hxx"
|
||||||
|
|
||||||
|
class ControllerWidget : public Widget, public CommandSender
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ControllerWidget(GuiObject* boss, const GUI::Font& font, int x, int y,
|
||||||
|
Controller& controller)
|
||||||
|
: Widget(boss, font, x, y, 16, 16),
|
||||||
|
CommandSender(boss),
|
||||||
|
_controller(controller)
|
||||||
|
{
|
||||||
|
_type = kControllerWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual ~ControllerWidget() { };
|
||||||
|
|
||||||
|
virtual void loadConfig() { };
|
||||||
|
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id) { };
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Controller& _controller;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,107 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// 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-2012 by Bradford W. Mott, Stephen Anthony
|
||||||
|
// and the Stella Team
|
||||||
|
//
|
||||||
|
// See the file "License.txt" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#include "OSystem.hxx"
|
||||||
|
#include "EventHandler.hxx"
|
||||||
|
#include "JoystickWidget.hxx"
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
JoystickWidget::JoystickWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
|
int x, int y, Controller& controller)
|
||||||
|
: ControllerWidget(boss, font, x, y, controller)
|
||||||
|
{
|
||||||
|
bool leftport = _controller.jack() == Controller::Left;
|
||||||
|
if(leftport)
|
||||||
|
{
|
||||||
|
myPinEvent[kJUp] = Event::JoystickZeroUp;
|
||||||
|
myPinEvent[kJDown] = Event::JoystickZeroDown;
|
||||||
|
myPinEvent[kJLeft] = Event::JoystickZeroLeft;
|
||||||
|
myPinEvent[kJRight] = Event::JoystickZeroRight;
|
||||||
|
myPinEvent[kJFire] = Event::JoystickZeroFire1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
myPinEvent[kJUp] = Event::JoystickOneUp;
|
||||||
|
myPinEvent[kJDown] = Event::JoystickOneDown;
|
||||||
|
myPinEvent[kJLeft] = Event::JoystickOneLeft;
|
||||||
|
myPinEvent[kJRight] = Event::JoystickOneRight;
|
||||||
|
myPinEvent[kJFire] = Event::JoystickOneFire1;
|
||||||
|
}
|
||||||
|
const string& label = leftport ? "Left (Joystick):" : "Right (Joystick):";
|
||||||
|
|
||||||
|
const int fontWidth = font.getMaxCharWidth(),
|
||||||
|
fontHeight = font.getFontHeight(),
|
||||||
|
lineHeight = font.getLineHeight();
|
||||||
|
int xpos = x, ypos = y, lwidth = font.getStringWidth("Right (Joystick):");
|
||||||
|
StaticTextWidget* t;
|
||||||
|
|
||||||
|
t = new StaticTextWidget(boss, font, xpos, ypos+2, lwidth,
|
||||||
|
fontHeight, label, kTextAlignLeft);
|
||||||
|
xpos += t->getWidth()/2 - 5; ypos += t->getHeight() + 5;
|
||||||
|
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||||
|
myPins[kJUp]->setID(kJUp);
|
||||||
|
myPins[kJUp]->setTarget(this);
|
||||||
|
addFocusWidget(myPins[kJUp]);
|
||||||
|
|
||||||
|
ypos += myPins[kJUp]->getHeight() * 2 + 10;
|
||||||
|
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||||
|
myPins[kJDown]->setID(kJDown);
|
||||||
|
myPins[kJDown]->setTarget(this);
|
||||||
|
addFocusWidget(myPins[kJDown]);
|
||||||
|
|
||||||
|
xpos -= myPins[kJUp]->getWidth() + 5;
|
||||||
|
ypos -= myPins[kJUp]->getHeight() + 5;
|
||||||
|
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||||
|
myPins[kJLeft]->setID(kJLeft);
|
||||||
|
myPins[kJLeft]->setTarget(this);
|
||||||
|
addFocusWidget(myPins[kJLeft]);
|
||||||
|
|
||||||
|
_w = xpos;
|
||||||
|
|
||||||
|
xpos += (myPins[kJUp]->getWidth() + 5) * 2;
|
||||||
|
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "", kCheckActionCmd);
|
||||||
|
myPins[kJRight]->setID(kJRight);
|
||||||
|
myPins[kJRight]->setTarget(this);
|
||||||
|
addFocusWidget(myPins[kJRight]);
|
||||||
|
|
||||||
|
xpos -= (myPins[kJUp]->getWidth() + 5) * 2;
|
||||||
|
ypos = 20 + (myPins[kJUp]->getHeight() + 10) * 3;
|
||||||
|
myPins[kJFire] = new CheckboxWidget(boss, font, xpos, ypos, "Fire", kCheckActionCmd);
|
||||||
|
myPins[kJFire]->setID(kJFire);
|
||||||
|
myPins[kJFire]->setTarget(this);
|
||||||
|
addFocusWidget(myPins[kJFire]);
|
||||||
|
|
||||||
|
_h = ypos;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
JoystickWidget::~JoystickWidget()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void JoystickWidget::loadConfig()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void JoystickWidget::handleCommand(
|
||||||
|
CommandSender* sender, int cmd, int data, int id)
|
||||||
|
{
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
//============================================================================
|
||||||
|
//
|
||||||
|
// 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-2012 by Bradford W. Mott, Stephen Anthony
|
||||||
|
// and the Stella Team
|
||||||
|
//
|
||||||
|
// See the file "License.txt" for information on usage and redistribution of
|
||||||
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
|
//
|
||||||
|
// $Id$
|
||||||
|
//============================================================================
|
||||||
|
|
||||||
|
#ifndef JOYSTICK_WIDGET_HXX
|
||||||
|
#define JOYSTICK_WIDGET_HXX
|
||||||
|
|
||||||
|
#include "Control.hxx"
|
||||||
|
#include "Event.hxx"
|
||||||
|
#include "ControllerWidget.hxx"
|
||||||
|
|
||||||
|
class JoystickWidget : public ControllerWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
JoystickWidget(GuiObject* boss, const GUI::Font& font, int x, int y,
|
||||||
|
Controller& controller);
|
||||||
|
virtual ~JoystickWidget();
|
||||||
|
|
||||||
|
void loadConfig();
|
||||||
|
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||||
|
|
||||||
|
private:
|
||||||
|
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJFire };
|
||||||
|
|
||||||
|
CheckboxWidget* myPins[5];
|
||||||
|
Event::Type myPinEvent[5];
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -30,6 +30,9 @@
|
||||||
#include "ToggleBitWidget.hxx"
|
#include "ToggleBitWidget.hxx"
|
||||||
#include "Widget.hxx"
|
#include "Widget.hxx"
|
||||||
|
|
||||||
|
#include "ControllerWidget.hxx"
|
||||||
|
#include "JoystickWidget.hxx"
|
||||||
|
|
||||||
#include "RiotWidget.hxx"
|
#include "RiotWidget.hxx"
|
||||||
|
|
||||||
#define CREATE_IO_REGS(desc, bits, bitsID) \
|
#define CREATE_IO_REGS(desc, bits, bitsID) \
|
||||||
|
@ -43,42 +46,6 @@
|
||||||
xpos += bits->getWidth() + 5; \
|
xpos += bits->getWidth() + 5; \
|
||||||
bits->setList(off, on);
|
bits->setList(off, on);
|
||||||
|
|
||||||
#define CREATE_PORT_PINS(label, pins, pinsID) \
|
|
||||||
t = new StaticTextWidget(boss, font, xpos, ypos+2, 14*fontWidth, \
|
|
||||||
fontHeight, label, kTextAlignLeft); \
|
|
||||||
xpos += t->getWidth()/2 - 5; ypos += t->getHeight() + 5; \
|
|
||||||
pins[0] = new CheckboxWidget(boss, font, xpos, ypos, "", \
|
|
||||||
kCheckActionCmd); \
|
|
||||||
pins[0]->setID(pinsID); \
|
|
||||||
pins[0]->setTarget(this); \
|
|
||||||
addFocusWidget(pins[0]); \
|
|
||||||
ypos += pins[0]->getHeight() * 2 + 10; \
|
|
||||||
pins[1] = new CheckboxWidget(boss, font, xpos, ypos, "", \
|
|
||||||
kCheckActionCmd); \
|
|
||||||
pins[1]->setID(pinsID); \
|
|
||||||
pins[1]->setTarget(this); \
|
|
||||||
addFocusWidget(pins[1]); \
|
|
||||||
xpos -= pins[0]->getWidth() + 5; \
|
|
||||||
ypos -= pins[0]->getHeight() + 5; \
|
|
||||||
pins[2] = new CheckboxWidget(boss, font, xpos, ypos, "", \
|
|
||||||
kCheckActionCmd); \
|
|
||||||
pins[2]->setID(pinsID); \
|
|
||||||
pins[2]->setTarget(this); \
|
|
||||||
addFocusWidget(pins[2]); \
|
|
||||||
xpos += (pins[0]->getWidth() + 5) * 2; \
|
|
||||||
pins[3] = new CheckboxWidget(boss, font, xpos, ypos, "", \
|
|
||||||
kCheckActionCmd); \
|
|
||||||
pins[3]->setID(pinsID); \
|
|
||||||
pins[3]->setTarget(this); \
|
|
||||||
addFocusWidget(pins[3]); \
|
|
||||||
xpos -= (pins[0]->getWidth() + 5) * 2; \
|
|
||||||
ypos = 20 + (pins[0]->getHeight() + 10) * 3; \
|
|
||||||
pins[4] = new CheckboxWidget(boss, font, xpos, ypos, "Fire", \
|
|
||||||
kCheckActionCmd); \
|
|
||||||
pins[4]->setID(pinsID); \
|
|
||||||
pins[4]->setTarget(this); \
|
|
||||||
addFocusWidget(pins[4]);
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& font,
|
RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h)
|
||||||
|
@ -157,16 +124,20 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
myTimRead->setEditable(false);
|
myTimRead->setEditable(false);
|
||||||
addFocusWidget(myTimRead);
|
addFocusWidget(myTimRead);
|
||||||
|
|
||||||
// Controller port pins (for now, only the latched pins)
|
// Controller ports
|
||||||
|
const RiotDebug& riot = instance().debugger().riotDebug();
|
||||||
xpos = col; ypos = 10;
|
xpos = col; ypos = 10;
|
||||||
CREATE_PORT_PINS("P0 Controller:", myP0Pins, kP0PinsID);
|
myLeftControl = addControlWidget(boss, font, xpos, ypos,
|
||||||
xpos = col + font.getStringWidth("P0 Controller:") + 20; ypos = 10;
|
riot.controller(Controller::Left));
|
||||||
CREATE_PORT_PINS("P1 Controller:", myP1Pins, kP1PinsID);
|
xpos += col + myLeftControl->getWidth() + 15;
|
||||||
|
myRightControl = addControlWidget(boss, font, xpos, ypos,
|
||||||
|
riot.controller(Controller::Right));
|
||||||
|
//FIXME - add focus to these widget??
|
||||||
|
|
||||||
// PO & P1 difficulty switches
|
// PO & P1 difficulty switches
|
||||||
int pwidth = font.getStringWidth("B/easy");
|
int pwidth = font.getStringWidth("B/easy");
|
||||||
lwidth = font.getStringWidth("P0 Diff: ");
|
lwidth = font.getStringWidth("P0 Diff: ");
|
||||||
xpos = col; ypos += 3 * lineHeight;
|
xpos = col; ypos += myLeftControl->getHeight() + 2 * lineHeight;
|
||||||
items.clear();
|
items.clear();
|
||||||
items.push_back("B/easy", "b");
|
items.push_back("B/easy", "b");
|
||||||
items.push_back("A/hard", "a");
|
items.push_back("A/hard", "a");
|
||||||
|
@ -270,21 +241,8 @@ void RiotWidget::loadConfig()
|
||||||
changed.push_back(state.TIMCLKS != oldstate.TIMCLKS);
|
changed.push_back(state.TIMCLKS != oldstate.TIMCLKS);
|
||||||
myTimRead->setList(alist, vlist, changed);
|
myTimRead->setList(alist, vlist, changed);
|
||||||
|
|
||||||
// Update port pins
|
// Console switches (inverted, since 'selected' in the UI
|
||||||
// We invert the booleans, since in the UI it makes more sense that
|
// means 'grounded' in the system)
|
||||||
// if, for example, the 'up' checkbox is set, it means 'go up'
|
|
||||||
myP0Pins[0]->setState(!state.P0_PIN1);
|
|
||||||
myP0Pins[1]->setState(!state.P0_PIN2);
|
|
||||||
myP0Pins[2]->setState(!state.P0_PIN3);
|
|
||||||
myP0Pins[3]->setState(!state.P0_PIN4);
|
|
||||||
myP0Pins[4]->setState(!state.P0_PIN6);
|
|
||||||
myP1Pins[0]->setState(!state.P1_PIN1);
|
|
||||||
myP1Pins[1]->setState(!state.P1_PIN2);
|
|
||||||
myP1Pins[2]->setState(!state.P1_PIN3);
|
|
||||||
myP1Pins[3]->setState(!state.P1_PIN4);
|
|
||||||
myP1Pins[4]->setState(!state.P1_PIN6);
|
|
||||||
|
|
||||||
// Console switches (invert reset/select for same reason as the pins)
|
|
||||||
myP0Diff->setSelected((int)riot.diffP0());
|
myP0Diff->setSelected((int)riot.diffP0());
|
||||||
myP1Diff->setSelected((int)riot.diffP1());
|
myP1Diff->setSelected((int)riot.diffP1());
|
||||||
myTVType->setSelected((int)riot.tvType());
|
myTVType->setSelected((int)riot.tvType());
|
||||||
|
@ -348,16 +306,6 @@ void RiotWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
||||||
case kCheckActionCmd:
|
case kCheckActionCmd:
|
||||||
switch(id)
|
switch(id)
|
||||||
{
|
{
|
||||||
case kP0PinsID:
|
|
||||||
riot.setP0Pins(!myP0Pins[0]->getState(), !myP0Pins[1]->getState(),
|
|
||||||
!myP0Pins[2]->getState(), !myP0Pins[3]->getState(),
|
|
||||||
!myP0Pins[4]->getState());
|
|
||||||
break;
|
|
||||||
case kP1PinsID:
|
|
||||||
riot.setP1Pins(!myP1Pins[0]->getState(), !myP1Pins[1]->getState(),
|
|
||||||
!myP1Pins[2]->getState(), !myP1Pins[3]->getState(),
|
|
||||||
!myP1Pins[4]->getState());
|
|
||||||
break;
|
|
||||||
case kSelectID:
|
case kSelectID:
|
||||||
riot.select(!mySelect->getState());
|
riot.select(!mySelect->getState());
|
||||||
break;
|
break;
|
||||||
|
@ -380,3 +328,16 @@ void RiotWidget::handleCommand(CommandSender* sender, int cmd, int data, int id)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
ControllerWidget* RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
|
int x, int y, Controller& controller)
|
||||||
|
{
|
||||||
|
switch(controller.type())
|
||||||
|
{
|
||||||
|
case Controller::Joystick:
|
||||||
|
return new JoystickWidget(boss, font, x, y, controller);
|
||||||
|
default:
|
||||||
|
return new ControllerWidget(boss, font, x, y, controller);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -28,8 +28,10 @@ class ButtonWidget;
|
||||||
class DataGridWidget;
|
class DataGridWidget;
|
||||||
class PopUpWidget;
|
class PopUpWidget;
|
||||||
class ToggleBitWidget;
|
class ToggleBitWidget;
|
||||||
|
class ControllerWidget;
|
||||||
|
|
||||||
#include "Array.hxx"
|
#include "Array.hxx"
|
||||||
|
#include "Control.hxx"
|
||||||
#include "Command.hxx"
|
#include "Command.hxx"
|
||||||
|
|
||||||
class RiotWidget : public Widget, public CommandSender
|
class RiotWidget : public Widget, public CommandSender
|
||||||
|
@ -43,6 +45,8 @@ class RiotWidget : public Widget, public CommandSender
|
||||||
void loadConfig();
|
void loadConfig();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
ControllerWidget* addControlWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
|
int x, int y, Controller& controller);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ToggleBitWidget* mySWCHAReadBits;
|
ToggleBitWidget* mySWCHAReadBits;
|
||||||
|
@ -55,8 +59,7 @@ class RiotWidget : public Widget, public CommandSender
|
||||||
DataGridWidget* myTimWrite;
|
DataGridWidget* myTimWrite;
|
||||||
DataGridWidget* myTimRead;
|
DataGridWidget* myTimRead;
|
||||||
|
|
||||||
CheckboxWidget* myP0Pins[5], *myP1Pins[5];
|
ControllerWidget *myLeftControl, *myRightControl;
|
||||||
|
|
||||||
PopUpWidget *myP0Diff, *myP1Diff;
|
PopUpWidget *myP0Diff, *myP1Diff;
|
||||||
PopUpWidget *myTVType;
|
PopUpWidget *myTVType;
|
||||||
CheckboxWidget* mySelect;
|
CheckboxWidget* mySelect;
|
||||||
|
@ -67,7 +70,6 @@ class RiotWidget : public Widget, public CommandSender
|
||||||
enum {
|
enum {
|
||||||
kTim1TID, kTim8TID, kTim64TID, kTim1024TID, kTimWriteID,
|
kTim1TID, kTim8TID, kTim64TID, kTim1024TID, kTimWriteID,
|
||||||
kSWCHABitsID, kSWACNTBitsID, kSWCHBBitsID, kSWBCNTBitsID,
|
kSWCHABitsID, kSWACNTBitsID, kSWCHBBitsID, kSWBCNTBitsID,
|
||||||
kP0PinsID, kP1PinsID,
|
|
||||||
kP0DiffChanged, kP1DiffChanged, kTVTypeChanged, kSelectID, kResetID
|
kP0DiffChanged, kP1DiffChanged, kTVTypeChanged, kSelectID, kResetID
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -18,7 +18,8 @@ MODULE_OBJS := \
|
||||||
src/debugger/gui/DebuggerDialog.o \
|
src/debugger/gui/DebuggerDialog.o \
|
||||||
src/debugger/gui/ToggleBitWidget.o \
|
src/debugger/gui/ToggleBitWidget.o \
|
||||||
src/debugger/gui/TogglePixelWidget.o \
|
src/debugger/gui/TogglePixelWidget.o \
|
||||||
src/debugger/gui/ToggleWidget.o
|
src/debugger/gui/ToggleWidget.o \
|
||||||
|
src/debugger/gui/JoystickWidget.o
|
||||||
|
|
||||||
MODULE_DIRS += \
|
MODULE_DIRS += \
|
||||||
src/debugger/gui
|
src/debugger/gui
|
||||||
|
|
|
@ -91,12 +91,6 @@ Controller::~Controller()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
const Controller::Type Controller::type() const
|
|
||||||
{
|
|
||||||
return myType;
|
|
||||||
}
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
uInt8 Controller::read()
|
uInt8 Controller::read()
|
||||||
{
|
{
|
||||||
|
|
|
@ -119,10 +119,15 @@ class Controller : public Serializable
|
||||||
*/
|
*/
|
||||||
virtual ~Controller();
|
virtual ~Controller();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Returns the jack that this controller is plugged into.
|
||||||
|
*/
|
||||||
|
const Jack jack() const { return myJack; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Returns the type of this controller.
|
Returns the type of this controller.
|
||||||
*/
|
*/
|
||||||
const Type type() const;
|
const Type type() const { return myType; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Read the entire state of all digital pins for this controller.
|
Read the entire state of all digital pins for this controller.
|
||||||
|
|
|
@ -77,7 +77,8 @@ enum {
|
||||||
kTiaZoomWidget = 'TIAZ',
|
kTiaZoomWidget = 'TIAZ',
|
||||||
kToggleBitWidget = 'TGLB',
|
kToggleBitWidget = 'TGLB',
|
||||||
kTogglePixelWidget = 'TGLP',
|
kTogglePixelWidget = 'TGLP',
|
||||||
kToggleWidget = 'TOGL'
|
kToggleWidget = 'TOGL',
|
||||||
|
kControllerWidget = 'CTRL'
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -323,6 +323,9 @@
|
||||||
DCC527DB10B9DA6A005E1287 /* bspf.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527D810B9DA6A005E1287 /* bspf.hxx */; };
|
DCC527DB10B9DA6A005E1287 /* bspf.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527D810B9DA6A005E1287 /* bspf.hxx */; };
|
||||||
DCC527DC10B9DA6A005E1287 /* Snapshot.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCC527D910B9DA6A005E1287 /* Snapshot.cxx */; };
|
DCC527DC10B9DA6A005E1287 /* Snapshot.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCC527D910B9DA6A005E1287 /* Snapshot.cxx */; };
|
||||||
DCC527DD10B9DA6A005E1287 /* Snapshot.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527DA10B9DA6A005E1287 /* Snapshot.hxx */; };
|
DCC527DD10B9DA6A005E1287 /* Snapshot.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCC527DA10B9DA6A005E1287 /* Snapshot.hxx */; };
|
||||||
|
DCCF47DE14B60DEE00814FAB /* ControllerWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCCF47DB14B60DEE00814FAB /* ControllerWidget.hxx */; };
|
||||||
|
DCCF47DF14B60DEE00814FAB /* JoystickWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCCF47DC14B60DEE00814FAB /* JoystickWidget.cxx */; };
|
||||||
|
DCCF47E014B60DEE00814FAB /* JoystickWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCCF47DD14B60DEE00814FAB /* JoystickWidget.hxx */; };
|
||||||
DCD2839812E39F1200A808DC /* Thumbulator.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD2839612E39F1200A808DC /* Thumbulator.cxx */; };
|
DCD2839812E39F1200A808DC /* Thumbulator.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD2839612E39F1200A808DC /* Thumbulator.cxx */; };
|
||||||
DCD2839912E39F1200A808DC /* Thumbulator.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCD2839712E39F1200A808DC /* Thumbulator.hxx */; };
|
DCD2839912E39F1200A808DC /* Thumbulator.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCD2839712E39F1200A808DC /* Thumbulator.hxx */; };
|
||||||
DCD3F7C511340AAF00DBA3AE /* Genesis.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD3F7C311340AAF00DBA3AE /* Genesis.cxx */; };
|
DCD3F7C511340AAF00DBA3AE /* Genesis.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD3F7C311340AAF00DBA3AE /* Genesis.cxx */; };
|
||||||
|
@ -741,6 +744,9 @@
|
||||||
DCC527D810B9DA6A005E1287 /* bspf.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = bspf.hxx; path = ../common/bspf.hxx; sourceTree = SOURCE_ROOT; };
|
DCC527D810B9DA6A005E1287 /* bspf.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = bspf.hxx; path = ../common/bspf.hxx; sourceTree = SOURCE_ROOT; };
|
||||||
DCC527D910B9DA6A005E1287 /* Snapshot.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Snapshot.cxx; path = ../common/Snapshot.cxx; sourceTree = SOURCE_ROOT; };
|
DCC527D910B9DA6A005E1287 /* Snapshot.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Snapshot.cxx; path = ../common/Snapshot.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
DCC527DA10B9DA6A005E1287 /* Snapshot.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Snapshot.hxx; path = ../common/Snapshot.hxx; sourceTree = SOURCE_ROOT; };
|
DCC527DA10B9DA6A005E1287 /* Snapshot.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Snapshot.hxx; path = ../common/Snapshot.hxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
DCCF47DB14B60DEE00814FAB /* ControllerWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ControllerWidget.hxx; path = ../debugger/gui/ControllerWidget.hxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
DCCF47DC14B60DEE00814FAB /* JoystickWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JoystickWidget.cxx; path = ../debugger/gui/JoystickWidget.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
DCCF47DD14B60DEE00814FAB /* JoystickWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = JoystickWidget.hxx; path = ../debugger/gui/JoystickWidget.hxx; sourceTree = SOURCE_ROOT; };
|
||||||
DCD2839612E39F1200A808DC /* Thumbulator.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Thumbulator.cxx; path = ../emucore/Thumbulator.cxx; sourceTree = SOURCE_ROOT; };
|
DCD2839612E39F1200A808DC /* Thumbulator.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Thumbulator.cxx; path = ../emucore/Thumbulator.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
DCD2839712E39F1200A808DC /* Thumbulator.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Thumbulator.hxx; path = ../emucore/Thumbulator.hxx; sourceTree = SOURCE_ROOT; };
|
DCD2839712E39F1200A808DC /* Thumbulator.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = Thumbulator.hxx; path = ../emucore/Thumbulator.hxx; sourceTree = SOURCE_ROOT; };
|
||||||
DCD3F7C311340AAF00DBA3AE /* Genesis.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Genesis.cxx; path = ../emucore/Genesis.cxx; sourceTree = SOURCE_ROOT; };
|
DCD3F7C311340AAF00DBA3AE /* Genesis.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Genesis.cxx; path = ../emucore/Genesis.cxx; sourceTree = SOURCE_ROOT; };
|
||||||
|
@ -908,6 +914,7 @@
|
||||||
2D2331900900B5EF00613B1F /* AudioWidget.hxx */,
|
2D2331900900B5EF00613B1F /* AudioWidget.hxx */,
|
||||||
2D20F9E408C603EC00A73076 /* ColorWidget.cxx */,
|
2D20F9E408C603EC00A73076 /* ColorWidget.cxx */,
|
||||||
2D20F9E508C603EC00A73076 /* ColorWidget.hxx */,
|
2D20F9E508C603EC00A73076 /* ColorWidget.hxx */,
|
||||||
|
DCCF47DB14B60DEE00814FAB /* ControllerWidget.hxx */,
|
||||||
2D20F9E608C603EC00A73076 /* CpuWidget.cxx */,
|
2D20F9E608C603EC00A73076 /* CpuWidget.cxx */,
|
||||||
2D20F9E708C603EC00A73076 /* CpuWidget.hxx */,
|
2D20F9E708C603EC00A73076 /* CpuWidget.hxx */,
|
||||||
2D20F9E808C603EC00A73076 /* DataGridOpsWidget.cxx */,
|
2D20F9E808C603EC00A73076 /* DataGridOpsWidget.cxx */,
|
||||||
|
@ -916,6 +923,8 @@
|
||||||
2D20F9EB08C603EC00A73076 /* DataGridWidget.hxx */,
|
2D20F9EB08C603EC00A73076 /* DataGridWidget.hxx */,
|
||||||
2D20F9EC08C603EC00A73076 /* DebuggerDialog.cxx */,
|
2D20F9EC08C603EC00A73076 /* DebuggerDialog.cxx */,
|
||||||
2D20F9ED08C603EC00A73076 /* DebuggerDialog.hxx */,
|
2D20F9ED08C603EC00A73076 /* DebuggerDialog.hxx */,
|
||||||
|
DCCF47DC14B60DEE00814FAB /* JoystickWidget.cxx */,
|
||||||
|
DCCF47DD14B60DEE00814FAB /* JoystickWidget.hxx */,
|
||||||
2D20F9EE08C603EC00A73076 /* PromptWidget.cxx */,
|
2D20F9EE08C603EC00A73076 /* PromptWidget.cxx */,
|
||||||
2D20F9EF08C603EC00A73076 /* PromptWidget.hxx */,
|
2D20F9EF08C603EC00A73076 /* PromptWidget.hxx */,
|
||||||
2D20F9F008C603EC00A73076 /* RamWidget.cxx */,
|
2D20F9F008C603EC00A73076 /* RamWidget.cxx */,
|
||||||
|
@ -1511,6 +1520,8 @@
|
||||||
DC8C1BAE14B25DE7006440EE /* CartCM.hxx in Headers */,
|
DC8C1BAE14B25DE7006440EE /* CartCM.hxx in Headers */,
|
||||||
DC8C1BB014B25DE7006440EE /* CompuMate.hxx in Headers */,
|
DC8C1BB014B25DE7006440EE /* CompuMate.hxx in Headers */,
|
||||||
DC8C1BB214B25DE7006440EE /* MindLink.hxx in Headers */,
|
DC8C1BB214B25DE7006440EE /* MindLink.hxx in Headers */,
|
||||||
|
DCCF47DE14B60DEE00814FAB /* ControllerWidget.hxx in Headers */,
|
||||||
|
DCCF47E014B60DEE00814FAB /* JoystickWidget.hxx in Headers */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
@ -1776,6 +1787,7 @@
|
||||||
DC8C1BAD14B25DE7006440EE /* CartCM.cxx in Sources */,
|
DC8C1BAD14B25DE7006440EE /* CartCM.cxx in Sources */,
|
||||||
DC8C1BAF14B25DE7006440EE /* CompuMate.cxx in Sources */,
|
DC8C1BAF14B25DE7006440EE /* CompuMate.cxx in Sources */,
|
||||||
DC8C1BB114B25DE7006440EE /* MindLink.cxx in Sources */,
|
DC8C1BB114B25DE7006440EE /* MindLink.cxx in Sources */,
|
||||||
|
DCCF47DF14B60DEE00814FAB /* JoystickWidget.cxx in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue