mirror of https://github.com/stella-emu/stella.git
added Joy 2B+ support (resolves #909)
This commit is contained in:
parent
e01d49e485
commit
73ffb94d43
122
docs/index.html
122
docs/index.html
|
@ -273,10 +273,11 @@
|
|||
Atari 2600 FPGA project, including cycle-exact audio, analog interference
|
||||
from mixing of audio channels, as well as stereo sound support; dynamic
|
||||
sound resampling is also included</li>
|
||||
<li>Emulates the Atari 2600 Joystick, Paddle, Driving, CBS Booster Grip, Sega Genesis, QuadTari controllers using your computer's keyboard,
|
||||
joysticks or mouse</li>
|
||||
<li>Emulates CX22/CX80 style Trak-Balls, Amiga/Atari mouse, MindLink controller and the Light Gun using your
|
||||
computer's mouse</li>
|
||||
<li>Emulates the Atari 2600 Joystick, Paddle, Driving, CBS Booster Grip,
|
||||
Sega Genesis, <a href="https://github.com/ascrnet/Joy2Bplus">Joy 2B+</a>,
|
||||
QuadTari controllers using your computer's keyboard, joysticks or mouse</li>
|
||||
<li>Emulates CX22/CX80 style Trak-Balls, Amiga/Atari mouse, MindLink controller
|
||||
and the Light Gun using your computer's mouse</li>
|
||||
<li>Emulates the Atari 2600 Keyboard controllers using your computer's keyboard</li>
|
||||
<li>Emulates <a href="https://en.wikipedia.org/wiki/CompuMate">Spectravideo CompuMate</a> system using your computer's keyboard,
|
||||
including mapping of CompuMate 'Backspace', 'Space' and 'Enter' functionality to
|
||||
|
@ -992,6 +993,108 @@
|
|||
</tr>
|
||||
</table>
|
||||
|
||||
<p><b>Joy 2B+ Controller (cannot be remapped, always associated with joystick and Booster Grip controllers)</b></p>
|
||||
|
||||
<table style="border: hidden">
|
||||
<tr>
|
||||
<td style="padding: 0px">
|
||||
<table>
|
||||
<tr>
|
||||
<th colspan=2>Left Pad</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Function</th>
|
||||
<th>Key</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Up</td>
|
||||
<td>Same as Left Joystick 'Up'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Down</td>
|
||||
<td>Same as Left Joystick 'Down'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Left</td>
|
||||
<td>Same as Left Joystick 'Left'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Right</td>
|
||||
<td>Same as Left Joystick 'Right'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Button 'B'</td>
|
||||
<td>Same as Left Joystick 'Fire'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Button 'C'</td>
|
||||
<td>Same as Left Joystick 'Top Booster Button'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Button '3'</td>
|
||||
<td>Same as Left Joystick 'Handle Grip Trigger'</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<td style="border: hidden"></td>
|
||||
<td style="padding: 0px">
|
||||
<table>
|
||||
<tr>
|
||||
<th colspan=2>Right Pad</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>Function</th>
|
||||
<th>Key</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Up</td>
|
||||
<td>Same as Right Joystick 'Up'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Down</td>
|
||||
<td>Same as Right Joystick 'Down'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Left</td>
|
||||
<td>Same as Right Joystick 'Left'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Pad Right</td>
|
||||
<td>Same as Right Joystick 'Right'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Button 'B'</td>
|
||||
<td>Same as Right Joystick 'Fire'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Button 'C'</td>
|
||||
<td>Same as Right Joystick 'Top Booster Button'</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>Button '3'</td>
|
||||
<td>Same as Right Joystick 'Handle Grip Trigger'</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</br>
|
||||
<p><b>Driving Controller (can be remapped)</b></p>
|
||||
|
||||
|
@ -2556,7 +2659,7 @@
|
|||
<tr>
|
||||
<th> Booster Grip</th>
|
||||
<td> ✓</td>
|
||||
<td> ✓</td>
|
||||
<td> ✓ (+ extra)</td>
|
||||
<td> ✓ (+ extra)</td>
|
||||
<td> ✕</td>
|
||||
<td> ✓ (+ extra)</td>
|
||||
|
@ -2569,6 +2672,14 @@
|
|||
<td> ✕</td>
|
||||
<td> ✕</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> Joy 2B+</th>
|
||||
<td> ✓</td>
|
||||
<td> ✓ (+ extra)</td>
|
||||
<td> ✓ (+ extra)</td>
|
||||
<td> ✕</td>
|
||||
<td> ✕ (+ extra)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> Keyboard</th>
|
||||
<td> ✓</td>
|
||||
|
@ -5260,6 +5371,7 @@ Ms Pac-Man (Stella extended codes):
|
|||
<tr><td><a href="https://atariage.com/store/index.php?l=product_detail&p=1045">AtariVox ¹</a></td><td>A SpeakJet based unlimited-vocabulary speech/sound synthesizer with 32K EEPROM.</td></tr>
|
||||
<tr><td>SaveKey</td><td>A 32K EEPROM for saving high scores, etc. (the EEPROM portion of an AtariVox).</td></tr>
|
||||
<tr><td>Genesis </td><td>Sega Genesis controller, which can be used similar to a Booster Grip, giving an extra button.</td></tr>
|
||||
<tr><td>Joy2B+ </td><td><a href="https://github.com/ascrnet/Joy2Bplus">Joy 2B+</a> controller, which can be used similar to a Booster Grip, giving two extra buttons.</td></tr>
|
||||
<tr><td>CompuMate ¹</td><td>Spectravideo CompuMate (if either left or right is set, CompuMate is used for both).</td></tr>
|
||||
<tr><td>Lightgun</td><td>Atari XG-1 compatible Light Gun.</td></tr>
|
||||
<tr><td>MindLink ¹</td><td>MindLink controller.</td></tr>
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
//============================================================================
|
||||
//
|
||||
// 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-2022 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.
|
||||
//============================================================================
|
||||
|
||||
#ifndef JOY2BPLUS_WIDGET_HXX
|
||||
#define JOY2BPLUS_WIDGET_HXX
|
||||
|
||||
#include "Control.hxx"
|
||||
#include "ControllerWidget.hxx"
|
||||
|
||||
class Joy2BPlusWidget : public ControllerWidget
|
||||
{
|
||||
public:
|
||||
Joy2BPlusWidget(GuiObject* boss, const GUI::Font& font, int x, int y,
|
||||
Controller& controller);
|
||||
~Joy2BPlusWidget() override = default;
|
||||
|
||||
private:
|
||||
enum { kJUp = 0, kJDown, kJLeft, kJRight, kJButtonB, kJButtonC, kJButton3 };
|
||||
|
||||
std::array<CheckboxWidget*, 7> myPins{nullptr};
|
||||
static constexpr std::array<Controller::DigitalPin, 5> ourPinNo = {{
|
||||
Controller::DigitalPin::One, Controller::DigitalPin::Two,
|
||||
Controller::DigitalPin::Three, Controller::DigitalPin::Four,
|
||||
Controller::DigitalPin::Six
|
||||
}};
|
||||
|
||||
private:
|
||||
void loadConfig() override;
|
||||
void handleCommand(CommandSender* sender, int cmd, int data, int id) override;
|
||||
|
||||
// Following constructors and assignment operators not supported
|
||||
Joy2BPlusWidget() = delete;
|
||||
Joy2BPlusWidget(const Joy2BPlusWidget&) = delete;
|
||||
Joy2BPlusWidget(Joy2BPlusWidget&&) = delete;
|
||||
Joy2BPlusWidget& operator=(const Joy2BPlusWidget&) = delete;
|
||||
Joy2BPlusWidget& operator=(Joy2BPlusWidget&&) = delete;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -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-2022 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.
|
||||
//============================================================================
|
||||
|
||||
#include "Joy2BPlusWidget.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Joy2BPlusWidget::Joy2BPlusWidget(GuiObject* boss, const GUI::Font& font,
|
||||
int x, int y, Controller& controller)
|
||||
: ControllerWidget(boss, font, x, y, controller)
|
||||
{
|
||||
const string& label = isLeftPort() ? "Left (Joy 2B+)" : "Right (Joy 2B+)";
|
||||
|
||||
const int fontHeight = font.getFontHeight();
|
||||
int xpos = x, ypos = y, lwidth = font.getStringWidth("Right (Joy 2B+)");
|
||||
StaticTextWidget* t;
|
||||
|
||||
t = new StaticTextWidget(boss, font, xpos, ypos+2, lwidth,
|
||||
fontHeight, label, TextAlign::Left);
|
||||
xpos += t->getWidth()/2 - 5; ypos += t->getHeight() + 10;
|
||||
myPins[kJUp] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJUp]->setID(kJUp);
|
||||
myPins[kJUp]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJUp]->getHeight() * 2 + 10;
|
||||
myPins[kJDown] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJDown]->setID(kJDown);
|
||||
myPins[kJDown]->setTarget(this);
|
||||
|
||||
xpos -= myPins[kJUp]->getWidth() + 5;
|
||||
ypos -= myPins[kJUp]->getHeight() + 5;
|
||||
myPins[kJLeft] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJLeft]->setID(kJLeft);
|
||||
myPins[kJLeft]->setTarget(this);
|
||||
|
||||
xpos += (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
myPins[kJRight] = new CheckboxWidget(boss, font, xpos, ypos, "",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJRight]->setID(kJRight);
|
||||
myPins[kJRight]->setTarget(this);
|
||||
|
||||
xpos -= (myPins[kJUp]->getWidth() + 5) * 2;
|
||||
ypos = 20 + (myPins[kJUp]->getHeight() + 10) * 3;
|
||||
myPins[kJButtonB] = new CheckboxWidget(boss, font, xpos, ypos, "Button B",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJButtonB]->setID(kJButtonB);
|
||||
myPins[kJButtonB]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJButtonB]->getHeight() + 5;
|
||||
myPins[kJButtonC] = new CheckboxWidget(boss, font, xpos, ypos, "Button C",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJButtonC]->setID(kJButtonC);
|
||||
myPins[kJButtonC]->setTarget(this);
|
||||
|
||||
ypos += myPins[kJButtonC]->getHeight() + 5;
|
||||
myPins[kJButton3] = new CheckboxWidget(boss, font, xpos, ypos, "Button 3",
|
||||
CheckboxWidget::kCheckActionCmd);
|
||||
myPins[kJButton3]->setID(kJButton3);
|
||||
myPins[kJButton3]->setTarget(this);
|
||||
|
||||
addFocusWidget(myPins[kJUp]);
|
||||
addFocusWidget(myPins[kJLeft]);
|
||||
addFocusWidget(myPins[kJRight]);
|
||||
addFocusWidget(myPins[kJDown]);
|
||||
addFocusWidget(myPins[kJButtonB]);
|
||||
addFocusWidget(myPins[kJButtonC]);
|
||||
addFocusWidget(myPins[kJButton3]);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Joy2BPlusWidget::loadConfig()
|
||||
{
|
||||
myPins[kJUp]->setState(!getPin(ourPinNo[kJUp]));
|
||||
myPins[kJDown]->setState(!getPin(ourPinNo[kJDown]));
|
||||
myPins[kJLeft]->setState(!getPin(ourPinNo[kJLeft]));
|
||||
myPins[kJRight]->setState(!getPin(ourPinNo[kJRight]));
|
||||
myPins[kJButtonB]->setState(!getPin(ourPinNo[kJButtonB]));
|
||||
|
||||
myPins[kJButton3]->setState(
|
||||
getPin(Controller::AnalogPin::Five) == AnalogReadout::connectToGround());
|
||||
myPins[kJButtonC]->setState(
|
||||
getPin(Controller::AnalogPin::Nine) == AnalogReadout::connectToGround());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Joy2BPlusWidget::handleCommand(
|
||||
CommandSender* sender, int cmd, int data, int id)
|
||||
{
|
||||
if(cmd == CheckboxWidget::kCheckActionCmd)
|
||||
{
|
||||
switch(id)
|
||||
{
|
||||
case kJUp:
|
||||
case kJDown:
|
||||
case kJLeft:
|
||||
case kJRight:
|
||||
case kJButtonB:
|
||||
setPin(ourPinNo[id], !myPins[id]->getState());
|
||||
break;
|
||||
case kJButtonC:
|
||||
setPin(Controller::AnalogPin::Nine,
|
||||
myPins[id]->getState() ? AnalogReadout::connectToGround()
|
||||
: AnalogReadout::connectToVcc());
|
||||
break;
|
||||
case kJButton3:
|
||||
setPin(Controller::AnalogPin::Five,
|
||||
myPins[id]->getState() ? AnalogReadout::connectToGround()
|
||||
: AnalogReadout::connectToVcc());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
constexpr std::array<Controller::DigitalPin, 5> Joy2BPlusWidget::ourPinNo;
|
|
@ -40,6 +40,7 @@
|
|||
#include "AtariMouseWidget.hxx"
|
||||
#include "TrakBallWidget.hxx"
|
||||
#include "QuadTariWidget.hxx"
|
||||
#include "Joy2BPlusWidget.hxx"
|
||||
|
||||
#include "RiotWidget.hxx"
|
||||
|
||||
|
@ -537,6 +538,8 @@ ControllerWidget* RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font&
|
|||
return new DrivingWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::Genesis:
|
||||
return new GenesisWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::Joy2BPlus:
|
||||
return new Joy2BPlusWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::Joystick:
|
||||
return new JoystickWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::Keyboard:
|
||||
|
@ -544,14 +547,14 @@ ControllerWidget* RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font&
|
|||
// case Controller::Type::KidVid: // TODO - implement this
|
||||
// case Controller::Type::MindLink: // TODO - implement this
|
||||
// case Controller::Type::Lightgun: // TODO - implement this
|
||||
case Controller::Type::QuadTari:
|
||||
return new QuadTariWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::Paddles:
|
||||
return new PaddleWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::SaveKey:
|
||||
return new SaveKeyWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::TrakBall:
|
||||
return new TrakBallWidget(boss, font, x, y, controller);
|
||||
case Controller::Type::QuadTari:
|
||||
return new QuadTariWidget(boss, font, x, y, controller);
|
||||
default:
|
||||
return new NullControlWidget(boss, font, x, y, controller);
|
||||
}
|
||||
|
|
|
@ -56,13 +56,14 @@ MODULE_OBJS := \
|
|||
src/debugger/gui/CartDebugWidget.o \
|
||||
src/debugger/gui/CpuWidget.o \
|
||||
src/debugger/gui/DataGridOpsWidget.o \
|
||||
src/debugger/gui/DataGridRamWidget.o \
|
||||
src/debugger/gui/DataGridRamWidget.o \
|
||||
src/debugger/gui/DataGridWidget.o \
|
||||
src/debugger/gui/DebuggerDialog.o \
|
||||
src/debugger/gui/DelayQueueWidget.o \
|
||||
src/debugger/gui/DrivingWidget.o \
|
||||
src/debugger/gui/FlashWidget.o \
|
||||
src/debugger/gui/GenesisWidget.o \
|
||||
src/debugger/gui/Joy2BPlusWidget.o \
|
||||
src/debugger/gui/JoystickWidget.o \
|
||||
src/debugger/gui/KeyboardWidget.o \
|
||||
src/debugger/gui/PaddleWidget.o \
|
||||
|
|
|
@ -23,13 +23,13 @@ BoosterGrip::BoosterGrip(Jack jack, const Event& event, const System& system)
|
|||
{
|
||||
if(myJack == Jack::Left)
|
||||
{
|
||||
myTriggerEvent = Event::LeftJoystickFire5;
|
||||
myBoosterEvent = Event::LeftJoystickFire9;
|
||||
myBoosterEvent = Event::LeftJoystickFire5;
|
||||
myTriggerEvent = Event::LeftJoystickFire9;
|
||||
}
|
||||
else
|
||||
{
|
||||
myTriggerEvent = Event::RightJoystickFire5;
|
||||
myBoosterEvent = Event::RightJoystickFire9;
|
||||
myBoosterEvent = Event::RightJoystickFire5;
|
||||
myTriggerEvent = Event::RightJoystickFire9;
|
||||
}
|
||||
|
||||
setPin(AnalogPin::Five, AnalogReadout::disconnect());
|
||||
|
@ -48,6 +48,6 @@ void BoosterGrip::updateButtons()
|
|||
updateMouseButtons(firePressed, boosterPressed);
|
||||
|
||||
setPin(DigitalPin::Six, !getAutoFireState(firePressed));
|
||||
setPin(AnalogPin::Five, triggerPressed ? AnalogReadout::connectToVcc() : AnalogReadout::disconnect());
|
||||
setPin(AnalogPin::Nine, boosterPressed ? AnalogReadout::connectToVcc() : AnalogReadout::disconnect());
|
||||
setPin(AnalogPin::Five, boosterPressed ? AnalogReadout::connectToVcc() : AnalogReadout::disconnect());
|
||||
setPin(AnalogPin::Nine, triggerPressed ? AnalogReadout::connectToVcc() : AnalogReadout::disconnect());
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "TrakBall.hxx"
|
||||
#include "Lightgun.hxx"
|
||||
#include "QuadTari.hxx"
|
||||
#include "Joy2BPlus.hxx"
|
||||
#include "M6502.hxx"
|
||||
#include "M6532.hxx"
|
||||
#include "TIA.hxx"
|
||||
|
@ -1015,6 +1016,10 @@ unique_ptr<Controller> Console::getControllerPort(const Controller::Type type,
|
|||
controller = make_unique<QuadTari>(port, myOSystem, *mySystem, myProperties);
|
||||
break;
|
||||
|
||||
case Controller::Type::Joy2BPlus:
|
||||
controller = make_unique<Joy2BPlus>(port, myEvent, *mySystem);
|
||||
break;
|
||||
|
||||
default:
|
||||
// What else can we do?
|
||||
// always create because it may have been changed by user dialog
|
||||
|
|
|
@ -111,7 +111,7 @@ string Controller::getName(const Type type)
|
|||
"Amiga mouse", "Atari mouse", "AtariVox", "Booster Grip", "CompuMate",
|
||||
"Driving", "Sega Genesis", "Joystick", "Keyboard", "Kid Vid", "MindLink",
|
||||
"Paddles", "Paddles_IAxis", "Paddles_IAxDr", "SaveKey", "Trak-Ball",
|
||||
"Light Gun", "QuadTari"
|
||||
"Light Gun", "QuadTari", "Joy 2B+"
|
||||
};
|
||||
|
||||
return NAMES[static_cast<int>(type)];
|
||||
|
@ -126,7 +126,7 @@ string Controller::getPropName(const Type type)
|
|||
"AMIGAMOUSE", "ATARIMOUSE", "ATARIVOX", "BOOSTERGRIP", "COMPUMATE",
|
||||
"DRIVING", "GENESIS", "JOYSTICK", "KEYBOARD", "KIDVID", "MINDLINK",
|
||||
"PADDLES", "PADDLES_IAXIS", "PADDLES_IAXDR", "SAVEKEY", "TRAKBALL",
|
||||
"LIGHTGUN", "QUADTARI"
|
||||
"LIGHTGUN", "QUADTARI", "JOY2B+"
|
||||
};
|
||||
|
||||
return PROP_NAMES[static_cast<int>(type)];
|
||||
|
|
|
@ -102,7 +102,7 @@ class Controller : public Serializable
|
|||
AmigaMouse, AtariMouse, AtariVox, BoosterGrip, CompuMate,
|
||||
Driving, Genesis, Joystick, Keyboard, KidVid, MindLink,
|
||||
Paddles, PaddlesIAxis, PaddlesIAxDr, SaveKey, TrakBall,
|
||||
Lightgun, QuadTari,
|
||||
Lightgun, QuadTari, Joy2BPlus,
|
||||
LastType
|
||||
};
|
||||
|
||||
|
|
|
@ -71,8 +71,10 @@ Controller::Type ControllerDetector::autodetectPort(
|
|||
type = Controller::Type::AtariMouse;
|
||||
else if(isProbablyAmigaMouse(image, size))
|
||||
type = Controller::Type::AmigaMouse;
|
||||
else if(usesKeyboard(image, size, port) && !usesJoystickDirections(image, size))
|
||||
type = Controller::Type::Keyboard;
|
||||
else if(usesKeyboard(image, size, port)) // must be detected before Genesis!
|
||||
type = usesJoystickDirections(image, size)
|
||||
? Controller::Type::Joy2BPlus
|
||||
: Controller::Type::Keyboard;
|
||||
else if(usesGenesisButton(image, size, port))
|
||||
type = Controller::Type::Genesis;
|
||||
else if(isProbablyLightGun(image, size, port))
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
//============================================================================
|
||||
//
|
||||
// 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-2022 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.
|
||||
//============================================================================
|
||||
|
||||
#include "Joy2BPlus.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Joy2BPlus::Joy2BPlus(Jack jack, const Event& event, const System& system)
|
||||
: Joystick(jack, event, system, Controller::Type::Joy2BPlus)
|
||||
{
|
||||
if(myJack == Jack::Left)
|
||||
{
|
||||
myButtonCEvent = Event::LeftJoystickFire5;
|
||||
myButton3Event = Event::LeftJoystickFire9;
|
||||
}
|
||||
else
|
||||
{
|
||||
myButtonCEvent = Event::RightJoystickFire5;
|
||||
myButton3Event = Event::RightJoystickFire9;
|
||||
}
|
||||
|
||||
setPin(AnalogPin::Five, AnalogReadout::connectToVcc());
|
||||
setPin(AnalogPin::Nine, AnalogReadout::connectToVcc());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Joy2BPlus::updateButtons()
|
||||
{
|
||||
bool firePressed = myEvent.get(myFireEvent) != 0;
|
||||
// The Joy 2B+ has two more buttons on it. These buttons are
|
||||
// connected to the inputs usually used by paddles.
|
||||
bool buttonCPressed = myEvent.get(myButtonCEvent) != 0;
|
||||
const bool button3Pressed = myEvent.get(myButton3Event) != 0;
|
||||
|
||||
updateMouseButtons(firePressed, buttonCPressed);
|
||||
|
||||
setPin(DigitalPin::Six, !getAutoFireState(firePressed));
|
||||
setPin(AnalogPin::Five, buttonCPressed ? AnalogReadout::connectToGround() : AnalogReadout::connectToVcc());
|
||||
setPin(AnalogPin::Nine, button3Pressed ? AnalogReadout::connectToGround() : AnalogReadout::connectToVcc());
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
//============================================================================
|
||||
//
|
||||
// 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-2022 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.
|
||||
//============================================================================
|
||||
|
||||
#ifndef JOY2BPLUS_HXX
|
||||
#define JOY2BPLUS_HXX
|
||||
|
||||
#include "Joystick.hxx"
|
||||
|
||||
/**
|
||||
The Joy 2B+ controller works with the 2600 console for joystick directions
|
||||
and some of the buttons. Button 'B' corresponds to the normal fire button
|
||||
(joy0fire), while button 'C' is read through INPT1 (analog pin 5) and
|
||||
button '3' through INPT0 (analog pin 9).
|
||||
|
||||
@author Thomas Jentzsch
|
||||
*/
|
||||
class Joy2BPlus : public Joystick
|
||||
{
|
||||
public:
|
||||
/**
|
||||
Create a new Joy 2B+ joystick plugged into the specified jack
|
||||
|
||||
@param jack The jack the controller is plugged into
|
||||
@param event The event object to use for events
|
||||
@param system The system using this controller
|
||||
*/
|
||||
Joy2BPlus(Jack jack, const Event& event, const System& system);
|
||||
~Joy2BPlus() override = default;
|
||||
|
||||
public:
|
||||
/**
|
||||
Returns the name of this controller.
|
||||
*/
|
||||
string name() const override { return "Joy 2B+"; }
|
||||
|
||||
private:
|
||||
/**
|
||||
Update the button pin states.
|
||||
*/
|
||||
void updateButtons() override;
|
||||
|
||||
private:
|
||||
// Pre-compute the events we care about based on given port
|
||||
// This will eliminate test for left or right port in update()
|
||||
Event::Type myButton3Event, myButtonCEvent;
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
Joy2BPlus() = delete;
|
||||
Joy2BPlus(const Joy2BPlus&) = delete;
|
||||
Joy2BPlus(Joy2BPlus&&) = delete;
|
||||
Joy2BPlus& operator=(const Joy2BPlus&) = delete;
|
||||
Joy2BPlus& operator=(Joy2BPlus&&) = delete;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -67,7 +67,8 @@ MODULE_OBJS := \
|
|||
src/emucore/FSNode.o \
|
||||
src/emucore/Genesis.o \
|
||||
src/emucore/GlobalKeyHandler.o \
|
||||
src/emucore/Joystick.o \
|
||||
src/emucore/Joy2BPlus.o \
|
||||
src/emucore/Joystick.o \
|
||||
src/emucore/Keyboard.o \
|
||||
src/emucore/KidVid.o \
|
||||
src/emucore/Lightgun.o \
|
||||
|
|
|
@ -294,6 +294,7 @@ void GameInfoDialog::addControllersTab()
|
|||
VarList::push_back(items, "AtariVox", "ATARIVOX");
|
||||
VarList::push_back(items, "SaveKey", "SAVEKEY");
|
||||
VarList::push_back(items, "Sega Genesis", "GENESIS");
|
||||
VarList::push_back(items, "Joy2B+", "JOY_2B+");
|
||||
VarList::push_back(items, "Kid Vid", "KIDVID");
|
||||
VarList::push_back(items, "Light Gun", "LIGHTGUN");
|
||||
VarList::push_back(items, "MindLink", "MINDLINK");
|
||||
|
|
|
@ -55,6 +55,7 @@ QuadTariDialog::QuadTariDialog(GuiObject* boss, const GUI::Font& font, int max_w
|
|||
VarList::push_back(ctrls, "AtariVox", "ATARIVOX");
|
||||
VarList::push_back(ctrls, "SaveKey", "SAVEKEY");
|
||||
//VarList::push_back(ctrls, "Sega Genesis", "GENESIS");
|
||||
//VarList::push_back(items, "Joy2B+", "JOY_2B+");
|
||||
//VarList::push_back(ctrls, "Kid Vid", "KIDVID");
|
||||
//VarList::push_back(ctrls, "Light Gun", "LIGHTGUN");
|
||||
//VarList::push_back(ctrls, "MindLink", "MINDLINK");
|
||||
|
|
|
@ -193,6 +193,7 @@ void StellaSettingsDialog::addGameOptions(WidgetArray& wid, int xpos, int& ypos)
|
|||
VarList::push_back(ctrls, "Atari mouse", "ATARIMOUSE");
|
||||
VarList::push_back(ctrls, "Trak-Ball", "TRAKBALL");
|
||||
VarList::push_back(ctrls, "Sega Genesis", "GENESIS");
|
||||
VarList::push_back(ctrls, "Joy2B+", "JOY_2B+"); // TODO: should work, but needs testing with real hardware
|
||||
VarList::push_back(ctrls, "QuadTari", "QUADTARI");
|
||||
|
||||
int pwidth = _font.getStringWidth("Sega Genesis");
|
||||
|
|
|
@ -107,6 +107,7 @@ SOURCES_CXX := \
|
|||
$(CORE_DIR)/emucore/FSNode.cxx \
|
||||
$(CORE_DIR)/emucore/Genesis.cxx \
|
||||
$(CORE_DIR)/emucore/GlobalKeyHandler.cxx \
|
||||
$(CORE_DIR)/emucore/Joy2BPlus.cxx \
|
||||
$(CORE_DIR)/emucore/Joystick.cxx \
|
||||
$(CORE_DIR)/emucore/Keyboard.cxx \
|
||||
$(CORE_DIR)/emucore/KidVid.cxx \
|
||||
|
|
|
@ -259,6 +259,7 @@
|
|||
<ClCompile Include="..\emucore\FSNode.cxx" />
|
||||
<ClCompile Include="..\emucore\Genesis.cxx" />
|
||||
<ClCompile Include="..\emucore\GlobalKeyHandler.cxx" />
|
||||
<ClCompile Include="..\emucore\Joy2BPlus.cxx" />
|
||||
<ClCompile Include="..\emucore\Joystick.cxx" />
|
||||
<ClCompile Include="..\emucore\Keyboard.cxx" />
|
||||
<ClCompile Include="..\emucore\KidVid.cxx" />
|
||||
|
|
|
@ -827,6 +827,7 @@
|
|||
<ClCompile Include="..\debugger\gui\GenesisWidget.cxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\debugger\gui\Joy2PlusWidget.cxx" />
|
||||
<ClCompile Include="..\debugger\gui\JoystickWidget.cxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
|
@ -885,6 +886,7 @@
|
|||
<ClCompile Include="..\emucore\EmulationWorker.cxx" />
|
||||
<ClCompile Include="..\emucore\FBSurface.cxx" />
|
||||
<ClCompile Include="..\emucore\GlobalKeyHandler.cxx" />
|
||||
<ClCompile Include="..\emucore\Joy2BPlus.cxx" />
|
||||
<ClCompile Include="..\emucore\Lightgun.cxx" />
|
||||
<ClCompile Include="..\emucore\MindLink.cxx" />
|
||||
<ClCompile Include="..\emucore\OSystemStandalone.cxx" />
|
||||
|
@ -2013,6 +2015,7 @@
|
|||
<ClInclude Include="..\debugger\gui\GenesisWidget.hxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\debugger\gui\Joy2BPlusWidget.hxx" />
|
||||
<ClInclude Include="..\debugger\gui\JoystickWidget.hxx">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
|
@ -2087,6 +2090,7 @@
|
|||
<ClInclude Include="..\emucore\FBSurface.hxx" />
|
||||
<ClInclude Include="..\emucore\FrameBufferConstants.hxx" />
|
||||
<ClInclude Include="..\emucore\GlobalKeyHandler.hxx" />
|
||||
<ClInclude Include="..\emucore\Joy2BPlus.hxx" />
|
||||
<ClInclude Include="..\emucore\Lightgun.hxx" />
|
||||
<ClInclude Include="..\emucore\MindLink.hxx" />
|
||||
<ClInclude Include="..\emucore\OSystemStandalone.hxx" />
|
||||
|
|
|
@ -1140,6 +1140,12 @@
|
|||
<ClCompile Include="..\debugger\gui\CartBUSInfoWidget.cxx">
|
||||
<Filter>Source Files\debugger</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\emucore\Joy2BPlus.cxx">
|
||||
<Filter>Source Files\emucore</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\debugger\gui\Joy2PlusWidget.cxx">
|
||||
<Filter>Source Files\debugger</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\common\bspf.hxx">
|
||||
|
@ -2360,6 +2366,12 @@
|
|||
<ClInclude Include="..\debugger\gui\CartBUSInfoWidget.hxx">
|
||||
<Filter>Header Files\debugger</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\emucore\Joy2BPlus.hxx">
|
||||
<Filter>Header Files\emucore</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\debugger\gui\Joy2BPlusWidget.hxx">
|
||||
<Filter>Header Files\debugger</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="stella.ico">
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue