mirror of https://github.com/stella-emu/stella.git
Merge branch 'master' into feature/sdl3-conversion
This commit is contained in:
commit
878851ab61
|
@ -1017,6 +1017,8 @@ PhysicalKeyboardHandler::DefaultPaddleMapping = {
|
|||
{Event::LeftPaddleAFire, KBDK_SPACE},
|
||||
{Event::LeftPaddleAFire, KBDK_LCTRL},
|
||||
{Event::LeftPaddleAFire, KBDK_KP_5},
|
||||
{Event::LeftPaddleAButton1, KBDK_UP, KBDM_SHIFT},
|
||||
{Event::LeftPaddleAButton2, KBDK_DOWN, KBDM_SHIFT},
|
||||
|
||||
{Event::LeftPaddleBDecrease, KBDK_DOWN},
|
||||
{Event::LeftPaddleBIncrease, KBDK_UP},
|
||||
|
@ -1026,6 +1028,8 @@ PhysicalKeyboardHandler::DefaultPaddleMapping = {
|
|||
{Event::RightPaddleADecrease, KBDK_J},
|
||||
{Event::RightPaddleAIncrease, KBDK_G},
|
||||
{Event::RightPaddleAFire, KBDK_F},
|
||||
{Event::RightPaddleAButton1, KBDK_Y, KBDM_SHIFT},
|
||||
{Event::RightPaddleAButton2, KBDK_H, KBDM_SHIFT},
|
||||
|
||||
{Event::RightPaddleBDecrease, KBDK_H},
|
||||
{Event::RightPaddleBIncrease, KBDK_Y},
|
||||
|
@ -1077,10 +1081,16 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultDrivi
|
|||
{Event::LeftDrivingFire, KBDK_SPACE},
|
||||
{Event::LeftDrivingFire, KBDK_LCTRL},
|
||||
{Event::LeftDrivingFire, KBDK_KP_5},
|
||||
{Event::LeftDrivingButton1, KBDK_UP},
|
||||
{Event::LeftDrivingButton2, KBDK_DOWN},
|
||||
{Event::LeftDrivingButton1, KBDK_KP_8},
|
||||
{Event::LeftDrivingButton2, KBDK_KP_2},
|
||||
|
||||
{Event::RightDrivingCCW, KBDK_G},
|
||||
{Event::RightDrivingCW, KBDK_J},
|
||||
{Event::RightDrivingFire, KBDK_F},
|
||||
{Event::RightDrivingButton1, KBDK_Y},
|
||||
{Event::RightDrivingButton2, KBDK_H},
|
||||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -113,6 +113,8 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
|
|||
{Event::LeftPaddleAIncrease, "LeftPaddleAIncrease"},
|
||||
{Event::LeftPaddleAAnalog, "LeftPaddleAAnalog"},
|
||||
{Event::LeftPaddleAFire, "LeftPaddleAFire"},
|
||||
{Event::LeftPaddleAButton1, "LeftPaddleAButton1"},
|
||||
{Event::LeftPaddleAButton2, "LeftPaddleAButton2"},
|
||||
{Event::LeftPaddleBDecrease, "LeftPaddleBDecrease"},
|
||||
{Event::LeftPaddleBIncrease, "LeftPaddleBIncrease"},
|
||||
{Event::LeftPaddleBAnalog, "LeftPaddleBAnalog"},
|
||||
|
@ -121,6 +123,8 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
|
|||
{Event::RightPaddleAIncrease, "RightPaddleAIncrease"},
|
||||
{Event::RightPaddleAAnalog, "RightPaddleAAnalog"},
|
||||
{Event::RightPaddleAFire, "RightPaddleAFire"},
|
||||
{Event::RightPaddleAButton1, "RightPaddleAButton1"},
|
||||
{Event::RightPaddleAButton2, "RightPaddleAButton2"},
|
||||
{Event::RightPaddleBDecrease, "RightPaddleBDecrease"},
|
||||
{Event::RightPaddleBIncrease, "RightPaddleBIncrease"},
|
||||
{Event::RightPaddleBAnalog, "RightPaddleBAnalog"},
|
||||
|
@ -156,10 +160,14 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
|
|||
{Event::LeftDrivingCCW, "LeftDrivingCCW"},
|
||||
{Event::LeftDrivingCW, "LeftDrivingCW"},
|
||||
{Event::LeftDrivingFire, "LeftDrivingFire"},
|
||||
{Event::LeftDrivingButton1, "LeftDrivingButton1"},
|
||||
{Event::LeftDrivingButton2, "LeftDrivingButton2"},
|
||||
{Event::LeftDrivingAnalog, "LeftDrivingAnalog"},
|
||||
{Event::RightDrivingCCW, "RightDrivingCCW"},
|
||||
{Event::RightDrivingCW, "RightDrivingCW"},
|
||||
{Event::RightDrivingFire, "RightDrivingFire"},
|
||||
{Event::RightDrivingButton1, "RightDrivingButton1"},
|
||||
{Event::RightDrivingButton2, "RightDrivingButton2"},
|
||||
{Event::RightDrivingAnalog, "RightDrivingAnalog"},
|
||||
{Event::CompuMateFunc, "CompuMateFunc"},
|
||||
{Event::CompuMateShift, "CompuMateShift"},
|
||||
|
|
|
@ -25,16 +25,18 @@ Driving::Driving(Jack jack, const Event& event, const System& system, bool altma
|
|||
{
|
||||
if(!altmap)
|
||||
{
|
||||
myCCWEvent = Event::LeftDrivingCCW;
|
||||
myCWEvent = Event::LeftDrivingCW;
|
||||
myFireEvent = Event::LeftDrivingFire;
|
||||
myAnalogEvent = Event::LeftDrivingAnalog;
|
||||
myCCWEvent = Event::LeftDrivingCCW;
|
||||
myCWEvent = Event::LeftDrivingCW;
|
||||
myFireEvent = Event::LeftDrivingFire;
|
||||
myButton1Event = Event::LeftDrivingButton1;
|
||||
myButton2Event = Event::LeftDrivingButton2;
|
||||
myAnalogEvent = Event::LeftDrivingAnalog;
|
||||
}
|
||||
else
|
||||
{
|
||||
myCCWEvent = Event::QTJoystickThreeLeft;
|
||||
myCWEvent = Event::QTJoystickThreeRight;
|
||||
myFireEvent = Event::QTJoystickThreeFire;
|
||||
myCCWEvent = Event::QTJoystickThreeLeft;
|
||||
myCWEvent = Event::QTJoystickThreeRight;
|
||||
myFireEvent = Event::QTJoystickThreeFire;
|
||||
}
|
||||
myXAxisValue = Event::SALeftAxis0Value; // joystick input
|
||||
myYAxisValue = Event::SALeftAxis1Value; // driving controller input
|
||||
|
@ -43,10 +45,12 @@ Driving::Driving(Jack jack, const Event& event, const System& system, bool altma
|
|||
{
|
||||
if(!altmap)
|
||||
{
|
||||
myCCWEvent = Event::RightDrivingCCW;
|
||||
myCWEvent = Event::RightDrivingCW;
|
||||
myFireEvent = Event::RightDrivingFire;
|
||||
myAnalogEvent = Event::RightDrivingAnalog;
|
||||
myCCWEvent = Event::RightDrivingCCW;
|
||||
myCWEvent = Event::RightDrivingCW;
|
||||
myFireEvent = Event::RightDrivingFire;
|
||||
myButton1Event = Event::RightDrivingButton1;
|
||||
myButton2Event = Event::RightDrivingButton2;
|
||||
myAnalogEvent = Event::RightDrivingAnalog;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -58,9 +62,9 @@ Driving::Driving(Jack jack, const Event& event, const System& system, bool altma
|
|||
myYAxisValue = Event::SARightAxis1Value; // driving controller input
|
||||
}
|
||||
|
||||
// Digital pins 3 and 4 are not connected
|
||||
setPin(DigitalPin::Three, true);
|
||||
setPin(DigitalPin::Four, true);
|
||||
//// Digital pins 3 and 4 are not connected
|
||||
//setPin(DigitalPin::Three, true);
|
||||
//setPin(DigitalPin::Four, true);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -90,6 +94,9 @@ void Driving::updateButtons()
|
|||
updateMouseButtons(firePressed);
|
||||
|
||||
setPin(DigitalPin::Six, !getAutoFireState(firePressed));
|
||||
// Joystick left/right pins when using a splitter:
|
||||
setPin(DigitalPin::Three, myEvent.get(myButton1Event) == 0);
|
||||
setPin(DigitalPin::Four, myEvent.get(myButton2Event) == 0);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -113,7 +113,7 @@ class Driving : public Controller
|
|||
// Pre-compute the events we care about based on given port
|
||||
// This will eliminate test for left or right port in update()
|
||||
Event::Type myCWEvent{}, myCCWEvent{}, myFireEvent{}, myAnalogEvent{},
|
||||
myXAxisValue{}, myYAxisValue{};
|
||||
myXAxisValue{}, myYAxisValue{}, myButton1Event{}, myButton2Event{};
|
||||
|
||||
// Controller to emulate in normal mouse axis mode
|
||||
int myControlID{-1};
|
||||
|
|
|
@ -47,9 +47,12 @@ class Event
|
|||
RightJoystickUp, RightJoystickDown, RightJoystickLeft, RightJoystickRight,
|
||||
RightJoystickFire, RightJoystickFire5, RightJoystickFire9,
|
||||
|
||||
LeftPaddleADecrease, LeftPaddleAIncrease, LeftPaddleAAnalog, LeftPaddleAFire,
|
||||
LeftPaddleBDecrease, LeftPaddleBIncrease, LeftPaddleBAnalog, LeftPaddleBFire,
|
||||
RightPaddleADecrease, RightPaddleAIncrease, RightPaddleAAnalog, RightPaddleAFire,
|
||||
LeftPaddleADecrease, LeftPaddleAIncrease, LeftPaddleAAnalog,
|
||||
LeftPaddleAFire, LeftPaddleAButton1, LeftPaddleAButton2,
|
||||
LeftPaddleBDecrease, LeftPaddleBIncrease, LeftPaddleBAnalog,
|
||||
LeftPaddleBFire, RightPaddleAButton1, RightPaddleAButton2,
|
||||
RightPaddleADecrease, RightPaddleAIncrease, RightPaddleAAnalog,
|
||||
RightPaddleAFire,
|
||||
RightPaddleBDecrease, RightPaddleBIncrease, RightPaddleBAnalog, RightPaddleBFire,
|
||||
|
||||
LeftKeyboard1, LeftKeyboard2, LeftKeyboard3,
|
||||
|
@ -63,7 +66,9 @@ class Event
|
|||
RightKeyboardStar, RightKeyboard0, RightKeyboardPound,
|
||||
|
||||
LeftDrivingCCW, LeftDrivingCW, LeftDrivingFire, LeftDrivingAnalog,
|
||||
LeftDrivingButton1, LeftDrivingButton2,
|
||||
RightDrivingCCW, RightDrivingCW, RightDrivingFire, RightDrivingAnalog,
|
||||
RightDrivingButton1, RightDrivingButton2,
|
||||
|
||||
CompuMateFunc, CompuMateShift,
|
||||
CompuMate0, CompuMate1, CompuMate2, CompuMate3, CompuMate4,
|
||||
|
@ -290,8 +295,10 @@ static const Event::EventSet QTJoystick4Events = {
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
static const Event::EventSet LeftPaddlesEvents = {
|
||||
Event::LeftPaddleADecrease, Event::LeftPaddleAIncrease, Event::LeftPaddleAAnalog, Event::LeftPaddleAFire,
|
||||
Event::LeftPaddleBDecrease, Event::LeftPaddleBIncrease, Event::LeftPaddleBAnalog, Event::LeftPaddleBFire,
|
||||
Event::LeftPaddleADecrease, Event::LeftPaddleAIncrease, Event::LeftPaddleAAnalog,
|
||||
Event::LeftPaddleAFire, Event::LeftPaddleAButton1, Event::LeftPaddleAButton2,
|
||||
Event::LeftPaddleBDecrease, Event::LeftPaddleBIncrease, Event::LeftPaddleBAnalog,
|
||||
Event::LeftPaddleBFire,
|
||||
};
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
static const Event::EventSet QTPaddles3Events = {
|
||||
|
@ -301,8 +308,10 @@ static const Event::EventSet QTPaddles3Events = {
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
static const Event::EventSet RightPaddlesEvents = {
|
||||
Event::RightPaddleADecrease, Event::RightPaddleAIncrease, Event::RightPaddleAAnalog, Event::RightPaddleAFire,
|
||||
Event::RightPaddleBDecrease, Event::RightPaddleBIncrease, Event::RightPaddleBAnalog, Event::RightPaddleBFire,
|
||||
Event::RightPaddleADecrease, Event::RightPaddleAIncrease, Event::RightPaddleAAnalog,
|
||||
Event::RightPaddleAFire, Event::RightPaddleAButton1, Event::RightPaddleAButton2,
|
||||
Event::RightPaddleBDecrease, Event::RightPaddleBIncrease, Event::RightPaddleBAnalog,
|
||||
Event::RightPaddleBFire,
|
||||
};
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
static const Event::EventSet QTPaddles4Events = {
|
||||
|
@ -328,14 +337,14 @@ static const Event::EventSet RightKeyboardEvents = {
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
static const Event::EventSet LeftDrivingEvents = {
|
||||
Event::LeftDrivingAnalog, Event::LeftDrivingCCW,
|
||||
Event::LeftDrivingCW, Event::LeftDrivingFire,
|
||||
Event::LeftDrivingAnalog, Event::LeftDrivingCCW, Event::LeftDrivingCW,
|
||||
Event::LeftDrivingFire, Event::LeftDrivingButton1, Event::LeftDrivingButton2,
|
||||
};
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
static const Event::EventSet RightDrivingEvents = {
|
||||
Event::RightDrivingAnalog, Event::RightDrivingCCW,
|
||||
Event::RightDrivingCW, Event::RightDrivingFire,
|
||||
Event::RightDrivingAnalog, Event::RightDrivingCCW, Event::RightDrivingCW,
|
||||
Event::RightDrivingFire, Event::RightDrivingButton1, Event::RightDrivingButton2,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -2900,6 +2900,8 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
|
|||
{ Event::LeftPaddleAIncrease, "Left Paddle A Turn Left" },
|
||||
{ Event::LeftPaddleADecrease, "Left Paddle A Turn Right" },
|
||||
{ Event::LeftPaddleAFire, "Left Paddle A Fire" },
|
||||
{ Event::LeftPaddleAButton1, "Left Paddle A Button 1" },
|
||||
{ Event::LeftPaddleAButton2, "Left Paddle A Button 2" },
|
||||
|
||||
{ Event::LeftPaddleBAnalog, "Left Paddle B Analog" },
|
||||
{ Event::LeftPaddleBIncrease, "Left Paddle B Turn Left" },
|
||||
|
@ -2910,6 +2912,8 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
|
|||
{ Event::RightPaddleAIncrease, "Right Paddle A Turn Left" },
|
||||
{ Event::RightPaddleADecrease, "Right Paddle A Turn Right" },
|
||||
{ Event::RightPaddleAFire, "Right Paddle A Fire" },
|
||||
{ Event::RightPaddleAButton1, "Right Paddle A Button 1" },
|
||||
{ Event::RightPaddleAButton2, "Right Paddle A Button 2" },
|
||||
|
||||
{ Event::RightPaddleBAnalog, "Right Paddle B Analog" },
|
||||
{ Event::RightPaddleBIncrease, "Right Paddle B Turn Left" },
|
||||
|
@ -2951,11 +2955,15 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
|
|||
{ Event::LeftDrivingCCW, "Left Driving Turn Left" },
|
||||
{ Event::LeftDrivingCW, "Left Driving Turn Right" },
|
||||
{ Event::LeftDrivingFire, "Left Driving Fire" },
|
||||
{ Event::LeftDrivingButton1, "Left Driving Button 1" },
|
||||
{ Event::LeftDrivingButton2, "Left Driving Button 2" },
|
||||
|
||||
{ Event::RightDrivingAnalog, "Right Driving Analog" },
|
||||
{ Event::RightDrivingCCW, "Right Driving Turn Left" },
|
||||
{ Event::RightDrivingCW, "Right Driving Turn Right" },
|
||||
{ Event::RightDrivingFire, "Right Driving Fire" },
|
||||
{ Event::RightDrivingButton1, "Right Driving Button 1" },
|
||||
{ Event::RightDrivingButton2, "Right Driving Button 2" },
|
||||
|
||||
// Video
|
||||
{ Event::ToggleInter, "Toggle display interpolation" },
|
||||
|
@ -3215,10 +3223,14 @@ const Event::EventSet EventHandler::JoystickEvents = {
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const Event::EventSet EventHandler::PaddlesEvents = {
|
||||
Event::LeftPaddleADecrease, Event::LeftPaddleAIncrease, Event::LeftPaddleAAnalog, Event::LeftPaddleAFire,
|
||||
Event::LeftPaddleBDecrease, Event::LeftPaddleBIncrease, Event::LeftPaddleBAnalog, Event::LeftPaddleBFire,
|
||||
Event::RightPaddleADecrease, Event::RightPaddleAIncrease, Event::RightPaddleAAnalog, Event::RightPaddleAFire,
|
||||
Event::RightPaddleBDecrease, Event::RightPaddleBIncrease, Event::RightPaddleBAnalog, Event::RightPaddleBFire,
|
||||
Event::LeftPaddleADecrease, Event::LeftPaddleAIncrease, Event::LeftPaddleAAnalog,
|
||||
Event::LeftPaddleAFire, Event::LeftPaddleAButton1, Event::LeftPaddleAButton2,
|
||||
Event::LeftPaddleBDecrease, Event::LeftPaddleBIncrease, Event::LeftPaddleBAnalog,
|
||||
Event::LeftPaddleBFire,
|
||||
Event::RightPaddleADecrease, Event::RightPaddleAIncrease, Event::RightPaddleAAnalog,
|
||||
Event::RightPaddleAFire, Event::RightPaddleAButton1, Event::RightPaddleAButton2,
|
||||
Event::RightPaddleBDecrease, Event::RightPaddleBIncrease, Event::RightPaddleBAnalog,
|
||||
Event::RightPaddleBFire,
|
||||
Event::QTPaddle3AFire, Event::QTPaddle3BFire,Event::QTPaddle4AFire,Event::QTPaddle4BFire,
|
||||
};
|
||||
|
||||
|
@ -3236,8 +3248,9 @@ const Event::EventSet EventHandler::KeyboardEvents = {
|
|||
|
||||
const Event::EventSet EventHandler::DrivingEvents = {
|
||||
Event::LeftDrivingAnalog, Event::LeftDrivingCCW, Event::LeftDrivingCW,
|
||||
Event::LeftDrivingFire, Event::RightDrivingAnalog, Event::RightDrivingCCW,
|
||||
Event::RightDrivingCW, Event::RightDrivingFire,
|
||||
Event::LeftDrivingFire, Event::LeftDrivingButton1, Event::LeftDrivingButton2,
|
||||
Event::RightDrivingAnalog, Event::RightDrivingCCW, Event::RightDrivingCW,
|
||||
Event::RightDrivingFire, Event::RightDrivingButton1, Event::RightDrivingButton2
|
||||
};
|
||||
|
||||
const Event::EventSet EventHandler::DevicesEvents = {
|
||||
|
|
|
@ -545,7 +545,7 @@ class EventHandler
|
|||
#else
|
||||
REFRESH_SIZE = 0,
|
||||
#endif
|
||||
EMUL_ACTIONLIST_SIZE = 234 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
|
||||
EMUL_ACTIONLIST_SIZE = 242 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
|
||||
MENU_ACTIONLIST_SIZE = 20
|
||||
;
|
||||
|
||||
|
|
|
@ -44,32 +44,37 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system,
|
|||
// As much as possible, precompute which events we care about for
|
||||
// a given port; this will speed up processing in update()
|
||||
|
||||
// Clear some potentially unused events:
|
||||
myAAxisValue = myBAxisValue =
|
||||
myADecEvent = myAIncEvent =
|
||||
myAButton1Event = myAButton2Event =
|
||||
myBDecEvent = myBIncEvent = Event::NoType;
|
||||
|
||||
// Consider whether this is the left or right port
|
||||
if(myJack == Jack::Left)
|
||||
{
|
||||
if(!altmap)
|
||||
{
|
||||
// First paddle is left A, second is left B
|
||||
myAAxisValue = Event::LeftPaddleAAnalog;
|
||||
myBAxisValue = Event::LeftPaddleBAnalog;
|
||||
myLeftAFireEvent = Event::LeftPaddleAFire;
|
||||
myLeftBFireEvent = Event::LeftPaddleBFire;
|
||||
myAAxisValue = Event::LeftPaddleAAnalog;
|
||||
myBAxisValue = Event::LeftPaddleBAnalog;
|
||||
myAFireEvent = Event::LeftPaddleAFire;
|
||||
myAButton1Event = Event::LeftPaddleAButton1;
|
||||
myAButton2Event = Event::LeftPaddleAButton2;
|
||||
|
||||
myBFireEvent = Event::LeftPaddleBFire;
|
||||
|
||||
// These can be affected by changes in axis orientation
|
||||
myLeftADecEvent = Event::LeftPaddleADecrease;
|
||||
myLeftAIncEvent = Event::LeftPaddleAIncrease;
|
||||
myLeftBDecEvent = Event::LeftPaddleBDecrease;
|
||||
myLeftBIncEvent = Event::LeftPaddleBIncrease;
|
||||
myAIncEvent = Event::LeftPaddleAIncrease;
|
||||
myBDecEvent = Event::LeftPaddleBDecrease;
|
||||
myBIncEvent = Event::LeftPaddleBIncrease;
|
||||
myADecEvent = Event::LeftPaddleADecrease;
|
||||
}
|
||||
else
|
||||
{
|
||||
// First paddle is QT 3A, second is QT 3B (fire buttons only)
|
||||
myLeftAFireEvent = Event::QTPaddle3AFire;
|
||||
myLeftBFireEvent = Event::QTPaddle3BFire;
|
||||
|
||||
myAAxisValue = myBAxisValue =
|
||||
myLeftADecEvent = myLeftAIncEvent =
|
||||
myLeftBDecEvent = myLeftBIncEvent = Event::NoType;
|
||||
myAFireEvent = Event::QTPaddle3AFire;
|
||||
myBFireEvent = Event::QTPaddle3BFire;
|
||||
}
|
||||
}
|
||||
else // Jack is right port
|
||||
|
@ -77,26 +82,25 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system,
|
|||
if(!altmap)
|
||||
{
|
||||
// First paddle is right A, second is right B
|
||||
myAAxisValue = Event::RightPaddleAAnalog;
|
||||
myBAxisValue = Event::RightPaddleBAnalog;
|
||||
myLeftAFireEvent = Event::RightPaddleAFire;
|
||||
myLeftBFireEvent = Event::RightPaddleBFire;
|
||||
myAAxisValue = Event::RightPaddleAAnalog;
|
||||
myBAxisValue = Event::RightPaddleBAnalog;
|
||||
myAFireEvent = Event::RightPaddleAFire;
|
||||
myAButton1Event = Event::RightPaddleAButton1;
|
||||
myAButton2Event = Event::RightPaddleAButton2;
|
||||
|
||||
myBFireEvent = Event::RightPaddleBFire;
|
||||
|
||||
// These can be affected by changes in axis orientation
|
||||
myLeftADecEvent = Event::RightPaddleADecrease;
|
||||
myLeftAIncEvent = Event::RightPaddleAIncrease;
|
||||
myLeftBDecEvent = Event::RightPaddleBDecrease;
|
||||
myLeftBIncEvent = Event::RightPaddleBIncrease;
|
||||
myADecEvent = Event::RightPaddleADecrease;
|
||||
myAIncEvent = Event::RightPaddleAIncrease;
|
||||
myBDecEvent = Event::RightPaddleBDecrease;
|
||||
myBIncEvent = Event::RightPaddleBIncrease;
|
||||
}
|
||||
else
|
||||
{
|
||||
// First paddle is QT 4A, second is QT 4B (fire buttons only)
|
||||
myLeftAFireEvent = Event::QTPaddle4AFire;
|
||||
myLeftBFireEvent = Event::QTPaddle4BFire;
|
||||
|
||||
myAAxisValue = myBAxisValue =
|
||||
myLeftADecEvent = myLeftAIncEvent =
|
||||
myLeftBDecEvent = myLeftBIncEvent = Event::NoType;
|
||||
myAFireEvent = Event::QTPaddle4AFire;
|
||||
myBFireEvent = Event::QTPaddle4BFire;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,9 +109,10 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system,
|
|||
{
|
||||
// First paddle is right A|B, second is left A|B
|
||||
std::swap(myAAxisValue, myBAxisValue);
|
||||
std::swap(myLeftAFireEvent, myLeftBFireEvent);
|
||||
std::swap(myLeftADecEvent, myLeftBDecEvent);
|
||||
std::swap(myLeftAIncEvent, myLeftBIncEvent);
|
||||
std::swap(myAFireEvent, myBFireEvent);
|
||||
myAButton1Event = myAButton2Event = Event::NoType;
|
||||
std::swap(myADecEvent, myBDecEvent);
|
||||
std::swap(myAIncEvent, myBIncEvent);
|
||||
}
|
||||
|
||||
// Direction of movement can be swapped
|
||||
|
@ -115,8 +120,8 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system,
|
|||
// result in either increasing or decreasing paddle movement
|
||||
if(swapdir)
|
||||
{
|
||||
std::swap(myLeftADecEvent, myLeftAIncEvent);
|
||||
std::swap(myLeftBDecEvent, myLeftBIncEvent);
|
||||
std::swap(myADecEvent, myAIncEvent);
|
||||
std::swap(myBDecEvent, myBIncEvent);
|
||||
}
|
||||
|
||||
// The following are independent of whether or not the port
|
||||
|
@ -136,9 +141,9 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system,
|
|||
myAxisDigitalOne = 0;
|
||||
}
|
||||
|
||||
// Digital pins 1, 2 and 6 are not connected
|
||||
setPin(DigitalPin::One, true);
|
||||
setPin(DigitalPin::Two, true);
|
||||
// Digital pins 1, 2 and 6 are (usually, see below) not connected
|
||||
//setPin(DigitalPin::One, true);
|
||||
//setPin(DigitalPin::Two, true);
|
||||
setPin(DigitalPin::Six, true);
|
||||
}
|
||||
|
||||
|
@ -155,7 +160,7 @@ void Paddles::updateA()
|
|||
setPin(DigitalPin::Four, true);
|
||||
|
||||
// Digital events (from keyboard or joystick hats & buttons)
|
||||
bool firePressedA = myEvent.get(myLeftAFireEvent) != 0;
|
||||
bool firePressedA = myEvent.get(myAFireEvent) != 0;
|
||||
|
||||
// Paddle movement is a very difficult thing to accurately emulate,
|
||||
// since it originally came from an analog device that had very
|
||||
|
@ -182,6 +187,10 @@ void Paddles::updateA()
|
|||
}
|
||||
|
||||
setPin(DigitalPin::Four, !getAutoFireState(firePressedA));
|
||||
|
||||
// Joystick up/down pins when using a splitter:
|
||||
setPin(DigitalPin::One, myEvent.get(myAButton1Event) == 0);
|
||||
setPin(DigitalPin::Two, myEvent.get(myAButton2Event) == 0);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -319,13 +328,13 @@ void Paddles::updateDigitalAxesA()
|
|||
|
||||
myKeyRepeatA = false;
|
||||
|
||||
if(myEvent.get(myLeftADecEvent))
|
||||
if(myEvent.get(myADecEvent))
|
||||
{
|
||||
myKeyRepeatA = true;
|
||||
if(myCharge[myAxisDigitalZero] > myPaddleRepeatA)
|
||||
myCharge[myAxisDigitalZero] -= myPaddleRepeatA;
|
||||
}
|
||||
if(myEvent.get(myLeftAIncEvent))
|
||||
if(myEvent.get(myAIncEvent))
|
||||
{
|
||||
myKeyRepeatA = true;
|
||||
if((myCharge[myAxisDigitalZero] + myPaddleRepeatA) < TRIGRANGE)
|
||||
|
@ -339,7 +348,7 @@ void Paddles::updateB()
|
|||
setPin(DigitalPin::Three, true);
|
||||
|
||||
// Digital events (from keyboard or joystick hats & buttons)
|
||||
bool firePressedB = myEvent.get(myLeftBFireEvent) != 0;
|
||||
bool firePressedB = myEvent.get(myBFireEvent) != 0;
|
||||
|
||||
if(!updateAnalogAxesB())
|
||||
{
|
||||
|
@ -426,13 +435,13 @@ void Paddles::updateDigitalAxesB()
|
|||
|
||||
myKeyRepeatB = false;
|
||||
|
||||
if(myEvent.get(myLeftBDecEvent))
|
||||
if(myEvent.get(myBDecEvent))
|
||||
{
|
||||
myKeyRepeatB = true;
|
||||
if(myCharge[myAxisDigitalOne] > myPaddleRepeatB)
|
||||
myCharge[myAxisDigitalOne] -= myPaddleRepeatB;
|
||||
}
|
||||
if(myEvent.get(myLeftBIncEvent))
|
||||
if(myEvent.get(myBIncEvent))
|
||||
{
|
||||
myKeyRepeatB = true;
|
||||
if((myCharge[myAxisDigitalOne] + myPaddleRepeatB) < TRIGRANGE)
|
||||
|
|
|
@ -177,9 +177,10 @@ class Paddles : public Controller
|
|||
// Pre-compute the events we care about based on given port
|
||||
// This will eliminate test for left or right port in update()
|
||||
Event::Type myAAxisValue, myBAxisValue,
|
||||
myLeftADecEvent, myLeftAIncEvent,
|
||||
myLeftBDecEvent, myLeftBIncEvent,
|
||||
myLeftAFireEvent, myLeftBFireEvent,
|
||||
myADecEvent, myAIncEvent,
|
||||
myBDecEvent, myBIncEvent,
|
||||
myAFireEvent, myAButton1Event, myAButton2Event,
|
||||
myBFireEvent,
|
||||
myAxisMouseMotion;
|
||||
|
||||
// The following are used for the various mouse-axis modes
|
||||
|
|
Loading…
Reference in New Issue