made port naming (left/right) consistent (see #796)

This commit is contained in:
Thomas Jentzsch 2021-05-11 22:51:40 +02:00
parent 82e1430598
commit 69740f25f8
23 changed files with 665 additions and 673 deletions

View File

@ -785,8 +785,8 @@
<table BORDER=2> <table BORDER=2>
<tr> <tr>
<th>Left Joystick (Joy0)</th> <th>Left Joystick</th>
<th>Right Joystick (Joy1)</th> <th>Right Joystick</th>
</tr> </tr>
<tr> <tr>
@ -898,32 +898,32 @@
<tr> <tr>
<td>Pad Up</td> <td>Pad Up</td>
<td>Same as 'Joy0 Up'</td> <td>Same as Left Joystick 'Up'</td>
</tr> </tr>
<tr> <tr>
<td>Pad Down</td> <td>Pad Down</td>
<td>Same as 'Joy0 Down'</td> <td>Same as Left Joystick 'Down'</td>
</tr> </tr>
<tr> <tr>
<td>Pad Left</td> <td>Pad Left</td>
<td>Same as 'Joy0 Left'</td> <td>Same as Left Joystick 'Left'</td>
</tr> </tr>
<tr> <tr>
<td>Pad Right</td> <td>Pad Right</td>
<td>Same as 'Joy0 Right'</td> <td>Same as Left Joystick 'Right'</td>
</tr> </tr>
<tr> <tr>
<td>Button 'B'</td> <td>Button 'B'</td>
<td>Same as 'Joy0 Fire'</td> <td>Same as Left Joystick 'Fire'</td>
</tr> </tr>
<tr> <tr>
<td>Button 'C'</td> <td>Button 'C'</td>
<td>Same as 'Joy0 Top Booster Button'</td> <td>Same as Left Joystick 'Top Booster Button'</td>
</tr> </tr>
</table> </table>
</td> </td>
@ -937,32 +937,32 @@
<tr> <tr>
<td>Pad Up</td> <td>Pad Up</td>
<td>Same as 'Joy1 Up'</td> <td>Same as Right Joystick 'Up'</td>
</tr> </tr>
<tr> <tr>
<td>Pad Down</td> <td>Pad Down</td>
<td>Same as 'Joy1 Down'</td> <td>Same as Right Joystick 'Down'</td>
</tr> </tr>
<tr> <tr>
<td>Pad Left</td> <td>Pad Left</td>
<td>Same as 'Joy1 Left'</td> <td>Same as Right Joystick 'Left'</td>
</tr> </tr>
<tr> <tr>
<td>Pad Right</td> <td>Pad Right</td>
<td>Same as 'Joy1 Right'</td> <td>Same as Right Joystick 'Right'</td>
</tr> </tr>
<tr> <tr>
<td>Button 'B'</td> <td>Button 'B'</td>
<td>Same as 'Joy1 Fire'</td> <td>Same as Right Joystick 'Fire'</td>
</tr> </tr>
<tr> <tr>
<td>Button 'C'</td> <td>Button 'C'</td>
<td>Same as 'Joy1 Top Booster Button'</td> <td>Same as Right Joystick 'Top Booster Button'</td>
</tr> </tr>
</table> </table>
</td> </td>
@ -987,17 +987,17 @@
<tr> <tr>
<td>Left Direction</td> <td>Left Direction</td>
<td>Same as 'Joy0 Left'</td> <td>Same as Left Joystick 'Left'</td>
</tr> </tr>
<tr> <tr>
<td>Right Direction</td> <td>Right Direction</td>
<td>Same as 'Joy0 Right'</td> <td>Same as Left Joystick 'Right'</td>
</tr> </tr>
<tr> <tr>
<td>Fire Button</td> <td>Fire Button</td>
<td>Same as 'Joy0 Fire'</td> <td>Same as Left Joystick 'Fire'</td>
</tr> </tr>
</table> </table>
</td> </td>
@ -1011,17 +1011,17 @@
<tr> <tr>
<td>Left Direction</td> <td>Left Direction</td>
<td>Same as 'Joy1 Left'</td> <td>Same as Right Joystick 'Left'</td>
</tr> </tr>
<tr> <tr>
<td>Right Direction</td> <td>Right Direction</td>
<td>Same as 'Joy1 Right'</td> <td>Same as Right Joystick 'Right'</td>
</tr> </tr>
<tr> <tr>
<td>Fire Button</td> <td>Fire Button</td>
<td>Same as 'Joy1 Fire'</td> <td>Same as Right Joystick 'Fire'</td>
</tr> </tr>
</table> </table>
</td> </td>
@ -1043,7 +1043,7 @@
</tr> </tr>
<tr> <tr>
<td>Fire Button</td> <td>Fire Button</td>
<td>Same as 'Joy0 Fire'</td> <td>Same as Left Joystick 'Fire'</td>
</tr> </tr>
</table> </table>
</td> </td>
@ -1065,7 +1065,7 @@
</tr> </tr>
<tr> <tr>
<td>Fire Button</td> <td>Fire Button</td>
<td>Same as 'Joy0 Fire'</td> <td>Same as Left Joystick 'Fire'</td>
</tr> </tr>
</table> </table>
</td> </td>
@ -1089,32 +1089,32 @@
</tr> </tr>
<tr> <tr>
<td>Paddle 0 Turn Left</td> <td>Paddle A Turn Left</td>
<td>Left arrow</td> <td>Left arrow</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 0 Turn Right</td> <td>Paddle A Turn Right</td>
<td>Right arrow</td> <td>Right arrow</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 0 Fire</td> <td>Paddle A Fire</td>
<td>Left Control, Space</td> <td>Left Control, Space</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 1 Turn Left</td> <td>Paddle B Turn Left</td>
<td>Up arrow</td> <td>Up arrow</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 1 Turn Right</td> <td>Paddle B Turn Right</td>
<td>Down arrow</td> <td>Down arrow</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 1 Fire</td> <td>Paddle B Fire</td>
<td>4</td> <td>4</td>
</tr> </tr>
</table> </table>
@ -1128,32 +1128,32 @@
</tr> </tr>
<tr> <tr>
<td>Paddle 2 Turn Left</td> <td>Paddle A Turn Left</td>
<td>G</td> <td>G</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 2 Turn Right</td> <td>Paddle A Turn Right</td>
<td>J</td> <td>J</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 2 Fire</td> <td>Paddle A Fire</td>
<td>F</td> <td>F</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 3 Turn Left</td> <td>Paddle B Turn Left</td>
<td>Y</td> <td>Y</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 3 Turn Right</td> <td>Paddle B Turn Right</td>
<td>H</td> <td>H</td>
</tr> </tr>
<tr> <tr>
<td>Paddle 3 Fire</td> <td>Paddle B Fire</td>
<td>6</td> <td>6</td>
</tr> </tr>
</table> </table>
@ -3913,7 +3913,7 @@
Notes:<ul> Notes:<ul>
<li>If nothing seems to happen, either Stella can't see the input device, or the <li>If nothing seems to happen, either Stella can't see the input device, or the
selected event doesn't support being remapped to the input device.</li> selected event doesn't support being remapped to the input device.</li>
<li>The same input can be used for multiple controller types (e.g. 'Right' for 'P0 Joystick Right' and 'Paddle 0 Turn Right').</li> <li>The same input can be used for multiple controller types (e.g. 'Right' for 'Left Joystick Right' and 'Left Paddle A Turn Right').</li>
<li>If the same input is used again for the same controller type, the old mapping will be removed.</li> <li>If the same input is used again for the same controller type, the old mapping will be removed.</li>
<li>Events which are available in both event modes can be remapped individually.</li> <li>Events which are available in both event modes can be remapped individually.</li>
<li>Left and right modifiers are mapped separately when used alone.</li> <li>Left and right modifiers are mapped separately when used alone.</li>
@ -4152,12 +4152,12 @@
<ul> <ul>
<li>The first device found will act as the <b>left game port</b> <li>The first device found will act as the <b>left game port</b>
on a real Atari. Depending on the device, Stella will detect it as on a real Atari. Depending on the device, Stella will detect it as
either the left joystick, paddles 0 & 1, the left driving controller, either the left joystick, left paddles A & B, the left driving controller,
left keypad, etc.</li> left keypad, etc.</li>
<li>The second device found will act as the <b>right game port</b> <li>The second device found will act as the <b>right game port</b>
on a real Atari. Depending on the device, Stella will detect it as on a real Atari. Depending on the device, Stella will detect it as
either the right joystick, paddles 2 & 3, the right driving controller, either the right joystick, right paddles A & B, the right driving controller,
right keypad, etc.</li> right keypad, etc.</li>
<li>Any other devices will be ignored.</li> <li>Any other devices will be ignored.</li>
@ -4870,7 +4870,7 @@ Ms Pac-Man (Stella extended codes):
<td VALIGN="TOP"><i>Console.SwapPorts</i></td> <td VALIGN="TOP"><i>Console.SwapPorts</i></td>
<td>Indicates that the left and right ports should be <td>Indicates that the left and right ports should be
swapped internally. This is used for ROMs like 'Raiders of the Lost Ark' where the swapped internally. This is used for ROMs like 'Raiders of the Lost Ark' where the
Player 0 joystick is plugged into the right joystick port. 1st player's joystick is plugged into the right joystick port.
The value must be <b>Yes</b> or <b>No</b>.</td> The value must be <b>Yes</b> or <b>No</b>.</td>
</tr> </tr>
@ -4878,8 +4878,8 @@ Ms Pac-Man (Stella extended codes):
<td VALIGN="TOP"><i>Controller.SwapPaddles</i></td> <td VALIGN="TOP"><i>Controller.SwapPaddles</i></td>
<td>Indicates that the left and right paddles in <td>Indicates that the left and right paddles in
a particular port should be swapped. This is used for ROMs like a particular port should be swapped. This is used for ROMs like
'Demons to Diamonds' where the default paddle is paddle 1, not 'Demons to Diamonds' where the default paddle is left paddle B, not
paddle 0. Other ROMs such as 'Tac-Scan' default to paddle 3, left paddle A. Other ROMs such as 'Tac-Scan' default to right paddle B,
which can be set using both 'Controller.SwapPaddles' and which can be set using both 'Controller.SwapPaddles' and
'Console.SwapPorts'. The value must be <b>Yes</b> or <b>No</b>.</td> 'Console.SwapPorts'. The value must be <b>Yes</b> or <b>No</b>.</td>
</tr> </tr>
@ -4903,14 +4903,14 @@ Ms Pac-Man (Stella extended codes):
Y-axis and right button. The value must be <b>Auto</b> or <b>XY</b>, as follows: Y-axis and right button. The value must be <b>Auto</b> or <b>XY</b>, as follows:
<table cellpadding="2" border="1"> <table cellpadding="2" border="1">
<tr><th>&nbsp;Id&nbsp;</th><th>Controller</th></tr> <tr><th>&nbsp;Id&nbsp;</th><th>Controller</th></tr>
<tr><td>0 </td><td>Paddle 0</td></tr> <tr><td>0 </td><td>Left Paddle A</td></tr>
<tr><td>1 </td><td>Paddle 1</td></tr> <tr><td>1 </td><td>Left Paddle B</td></tr>
<tr><td>2 </td><td>Paddle 2</td></tr> <tr><td>2 </td><td>Right Paddle A</td></tr>
<tr><td>3 </td><td>Paddle 3</td></tr> <tr><td>3 </td><td>Right Paddle B</td></tr>
<tr><td>4 </td><td>Driving 0</td></tr> <tr><td>4 </td><td>Left Driving</td></tr>
<tr><td>5 </td><td>Driving 1</td></tr> <tr><td>5 </td><td>Right Driving</td></tr>
<tr><td>6 </td><td>MindLink 0</td></tr> <tr><td>6 </td><td>Left MindLink</td></tr>
<tr><td>7 </td><td>MindLink 1</td></tr> <tr><td>7 </td><td>Right MindLink</td></tr>
</table> </table>
An <I>optional</I> second parameter (default of 100) indicates how much An <I>optional</I> second parameter (default of 100) indicates how much
of the paddle range the mouse should emulate. of the paddle range the mouse should emulate.

View File

@ -54,45 +54,45 @@ MouseControl::MouseControl(Console& console, const string& mode)
case MouseControl::Type::NoControl: case MouseControl::Type::NoControl:
msg << "not used"; msg << "not used";
break; break;
case MouseControl::Type::Paddle0: case MouseControl::Type::PaddleLeftA:
type = Controller::Type::Paddles; type = Controller::Type::Paddles;
id = 0; id = 0;
msg << "Paddle 0"; msg << "Left Paddle A";
break; break;
case MouseControl::Type::Paddle1: case MouseControl::Type::PaddleLeftB:
type = Controller::Type::Paddles; type = Controller::Type::Paddles;
id = 1; id = 1;
msg << "Paddle 1"; msg << "Left Paddle B";
break; break;
case MouseControl::Type::Paddle2: case MouseControl::Type::PaddleRightA:
type = Controller::Type::Paddles; type = Controller::Type::Paddles;
id = 2; id = 2;
msg << "Paddle 2"; msg << "Right Paddle A";
break; break;
case MouseControl::Type::Paddle3: case MouseControl::Type::PaddleRightB:
type = Controller::Type::Paddles; type = Controller::Type::Paddles;
id = 3; id = 3;
msg << "Paddle 3"; msg << "Right Paddle B";
break; break;
case MouseControl::Type::Driving0: case MouseControl::Type::DrivingLeft:
type = Controller::Type::Driving; type = Controller::Type::Driving;
id = 0; id = 0;
msg << "Driving 0"; msg << "Left Driving";
break; break;
case MouseControl::Type::Driving1: case MouseControl::Type::DrivingRight:
type = Controller::Type::Driving; type = Controller::Type::Driving;
id = 1; id = 1;
msg << "Driving 1"; msg << "Right Driving";
break; break;
case MouseControl::Type::MindLink0: case MouseControl::Type::MindLinkLeft:
type = Controller::Type::MindLink; type = Controller::Type::MindLink;
id = 0; id = 0;
msg << "MindLink 0"; msg << "Left MindLink";
break; break;
case MouseControl::Type::MindLink1: case MouseControl::Type::MindLinkRight:
type = Controller::Type::MindLink; type = Controller::Type::MindLink;
id = 1; id = 1;
msg << "MindLink 1"; msg << "Right MindLink";
break; break;
} }
}; };

View File

@ -43,8 +43,8 @@ class MouseControl
*/ */
enum class Type enum class Type
{ {
Paddle0 = 0, Paddle1, Paddle2, Paddle3, PaddleLeftA = 0, PaddleLeftB, PaddleRightA, PaddleRightB,
Driving0, Driving1, MindLink0, MindLink1, DrivingLeft, DrivingRight, MindLinkLeft, MindLinkRight,
NoControl NoControl
}; };

View File

@ -1068,113 +1068,113 @@ void PhysicalJoystickHandler::changeDrivingSensitivity(int direction)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftJoystickMapping = { PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftJoystickMapping = {
// Left joystick (assume buttons zero..two) // Left joystick (assume buttons zero..two)
{Event::JoystickZeroFire, 0}, {Event::JoystickLeftFire, 0},
{Event::JoystickZeroFire5, 1}, {Event::JoystickLeftFire5, 1},
{Event::JoystickZeroFire9, 2}, {Event::JoystickLeftFire9, 2},
// Left joystick left/right directions // Left joystick left/right directions
{Event::JoystickZeroLeft, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG}, {Event::JoystickLeftLeft, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG},
{Event::JoystickZeroRight, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS}, {Event::JoystickLeftRight, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS},
// Left joystick up/down directions // Left joystick up/down directions
{Event::JoystickZeroUp, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG}, {Event::JoystickLeftUp, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG},
{Event::JoystickZeroDown, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS}, {Event::JoystickLeftDown, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS},
// Left joystick left/right directions (assume hat 0) // Left joystick left/right directions (assume hat 0)
{Event::JoystickZeroLeft, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::LEFT}, {Event::JoystickLeftLeft, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::LEFT},
{Event::JoystickZeroRight, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::RIGHT}, {Event::JoystickLeftRight, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::RIGHT},
// Left joystick up/down directions (assume hat 0) // Left joystick up/down directions (assume hat 0)
{Event::JoystickZeroUp, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::UP}, {Event::JoystickLeftUp, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::UP},
{Event::JoystickZeroDown, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::DOWN}, {Event::JoystickLeftDown, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::DOWN},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRightJoystickMapping = { PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRightJoystickMapping = {
// Right joystick (assume buttons zero..two) // Right joystick (assume buttons zero..two)
{Event::JoystickOneFire, 0}, {Event::JoystickRightFire, 0},
{Event::JoystickOneFire5, 1}, {Event::JoystickRightFire5, 1},
{Event::JoystickOneFire9, 2}, {Event::JoystickRightFire9, 2},
// Right joystick left/right directions // Right joystick left/right directions
{Event::JoystickOneLeft, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG}, {Event::JoystickRightLeft, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG},
{Event::JoystickOneRight, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS}, {Event::JoystickRightRight, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS},
// Right joystick up/down directions // Right joystick up/down directions
{Event::JoystickOneUp, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG}, {Event::JoystickRightUp, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG},
{Event::JoystickOneDown, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS}, {Event::JoystickRightDown, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS},
// Right joystick left/right directions (assume hat 0) // Right joystick left/right directions (assume hat 0)
{Event::JoystickOneLeft, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::LEFT}, {Event::JoystickRightLeft, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::LEFT},
{Event::JoystickOneRight, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::RIGHT}, {Event::JoystickRightRight, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::RIGHT},
// Right joystick up/down directions (assume hat 0) // Right joystick up/down directions (assume hat 0)
{Event::JoystickOneUp, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::UP}, {Event::JoystickRightUp, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::UP},
{Event::JoystickOneDown, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::DOWN}, {Event::JoystickRightDown, JOY_CTRL_NONE, JoyAxis::NONE, JoyDir::NONE, 0, JoyHatDir::DOWN},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftPaddlesMapping = { PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftPaddlesMapping = {
{Event::PaddleZeroAnalog, JOY_CTRL_NONE, JoyAxis::X, JoyDir::ANALOG}, {Event::PaddleLeftAAnalog, JOY_CTRL_NONE, JoyAxis::X, JoyDir::ANALOG},
#if defined(RETRON77) #if defined(RETRON77)
{Event::PaddleZeroAnalog, JOY_CTRL_NONE, JoyAxis::Z, JoyDir::ANALOG}, {Event::PaddleLeftAAnalog, JOY_CTRL_NONE, JoyAxis::Z, JoyDir::ANALOG},
#endif #endif
// Current code does NOT allow digital and anlog events on the same axis at the same time // Current code does NOT allow digital and anlog events on the same axis at the same time
//{Event::PaddleZeroDecrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS}, //{Event::PaddleLeftADecrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS},
//{Event::PaddleZeroIncrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG}, //{Event::PaddleLeftAIncrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG},
{Event::PaddleZeroFire, 0}, {Event::PaddleLeftAFire, 0},
{Event::PaddleOneAnalog, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::ANALOG}, {Event::PaddleLeftBAnalog, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::ANALOG},
#if defined(RETRON77) #if defined(RETRON77)
{Event::PaddleOneAnalog, JOY_CTRL_NONE, JoyAxis::A3, JoyDir::ANALOG}, {Event::PaddleLeftBAnalog, JOY_CTRL_NONE, JoyAxis::A3, JoyDir::ANALOG},
#endif #endif
// Current code does NOT allow digital and anlog events on the same axis at the same // Current code does NOT allow digital and anlog events on the same axis at the same
//{Event::PaddleOneDecrease, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS}, //{Event::PaddleLeftBDecrease, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS},
//{Event::PaddleOneIncrease, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG}, //{Event::PaddleLeftBIncrease, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG},
{Event::PaddleOneFire, 1}, {Event::PaddleLeftBFire, 1},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRightPaddlesMapping = { PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRightPaddlesMapping = {
{Event::PaddleTwoAnalog, JOY_CTRL_NONE, JoyAxis::X, JoyDir::ANALOG}, {Event::PaddleRightAAnalog, JOY_CTRL_NONE, JoyAxis::X, JoyDir::ANALOG},
#if defined(RETRON77) #if defined(RETRON77)
{Event::PaddleTwoAnalog, JOY_CTRL_NONE, JoyAxis::Z, JoyDir::ANALOG}, {Event::PaddleRightAAnalog, JOY_CTRL_NONE, JoyAxis::Z, JoyDir::ANALOG},
#endif #endif
// Current code does NOT allow digital and anlog events on the same axis at the same // Current code does NOT allow digital and anlog events on the same axis at the same
//{Event::PaddleTwoDecrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS}, //{Event::PaddleRightADecrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS},
//{Event::PaddleTwoIncrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG}, //{Event::PaddleRightAIncrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG},
{Event::PaddleTwoFire, 0}, {Event::PaddleRightAFire, 0},
{Event::PaddleThreeAnalog, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::ANALOG}, {Event::PaddleRightBAnalog, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::ANALOG},
#if defined(RETRON77) #if defined(RETRON77)
{Event::PaddleThreeAnalog, JOY_CTRL_NONE, JoyAxis::A3, JoyDir::ANALOG}, {Event::PaddleRightBAnalog, JOY_CTRL_NONE, JoyAxis::A3, JoyDir::ANALOG},
#endif #endif
// Current code does NOT allow digital and anlog events on the same axis at the same // Current code does NOT allow digital and anlog events on the same axis at the same
//{Event::PaddleThreeDecrease,JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS}, //{Event::PaddleRightBDecrease,JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS},
//{Event::PaddleThreeIncrease,JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG}, //{Event::PaddleRightBIncrease,JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG},
{Event::PaddleThreeFire, 1}, {Event::PaddleRightBFire, 1},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftKeypadMapping = { PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftKeypadMapping = {
{Event::KeyboardZero1, 0}, {Event::LeftKeyboard1, 0},
{Event::KeyboardZero2, 1}, {Event::LeftKeyboard2, 1},
{Event::KeyboardZero3, 2}, {Event::LeftKeyboard3, 2},
{Event::KeyboardZero4, 3}, {Event::LeftKeyboard4, 3},
{Event::KeyboardZero5, 4}, {Event::LeftKeyboard5, 4},
{Event::KeyboardZero6, 5}, {Event::LeftKeyboard6, 5},
{Event::KeyboardZero7, 6}, {Event::LeftKeyboard7, 6},
{Event::KeyboardZero8, 7}, {Event::LeftKeyboard8, 7},
{Event::KeyboardZero9, 8}, {Event::LeftKeyboard9, 8},
{Event::KeyboardZeroStar, 9}, {Event::LeftKeyboardStar, 9},
{Event::KeyboardZero0, 10}, {Event::LeftKeyboard0, 10},
{Event::KeyboardZeroPound, 11}, {Event::LeftKeyboardPound, 11},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRightKeypadMapping = { PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRightKeypadMapping = {
{Event::KeyboardOne1, 0}, {Event::RightKeyboard1, 0},
{Event::KeyboardOne2, 1}, {Event::RightKeyboard2, 1},
{Event::KeyboardOne3, 2}, {Event::RightKeyboard3, 2},
{Event::KeyboardOne4, 3}, {Event::RightKeyboard4, 3},
{Event::KeyboardOne5, 4}, {Event::RightKeyboard5, 4},
{Event::KeyboardOne6, 5}, {Event::RightKeyboard6, 5},
{Event::KeyboardOne7, 6}, {Event::RightKeyboard7, 6},
{Event::KeyboardOne8, 7}, {Event::RightKeyboard8, 7},
{Event::KeyboardOne9, 8}, {Event::RightKeyboard9, 8},
{Event::KeyboardOneStar, 9}, {Event::RightKeyboardStar, 9},
{Event::KeyboardOne0, 10}, {Event::RightKeyboard0, 10},
{Event::KeyboardOnePound, 11}, {Event::RightKeyboardPound, 11},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -292,28 +292,28 @@ void PhysicalKeyboardHandler::enableEmulationMappings()
switch(myRight2ndMode) switch(myRight2ndMode)
{ {
case EventMode::kPaddlesMode: case EventMode::kPaddlesMode:
enableMappings(Right2PaddlesEvents, EventMode::kPaddlesMode); enableMappings(QTPaddles4Events, EventMode::kPaddlesMode);
break; break;
case EventMode::kEmulationMode: // no QuadTari case EventMode::kEmulationMode: // no QuadTari
break; break;
default: default:
enableMappings(Right2JoystickEvents, EventMode::kJoystickMode); enableMappings(QTJoystick4Events, EventMode::kJoystickMode);
break; break;
} }
switch(myLeft2ndMode) switch(myLeft2ndMode)
{ {
case EventMode::kPaddlesMode: case EventMode::kPaddlesMode:
enableMappings(Left2PaddlesEvents, EventMode::kPaddlesMode); enableMappings(QTPaddles3Events, EventMode::kPaddlesMode);
break; break;
case EventMode::kEmulationMode: // no QuadTari case EventMode::kEmulationMode: // no QuadTari
break; break;
default: default:
enableMappings(Left2JoystickEvents, EventMode::kJoystickMode); enableMappings(QTJoystick3Events, EventMode::kJoystickMode);
break; break;
} }
@ -414,18 +414,18 @@ EventMode PhysicalKeyboardHandler::getEventMode(const Event::Type event,
bool PhysicalKeyboardHandler::isJoystickEvent(const Event::Type event) const bool PhysicalKeyboardHandler::isJoystickEvent(const Event::Type event) const
{ {
return LeftJoystickEvents.find(event) != LeftJoystickEvents.end() return LeftJoystickEvents.find(event) != LeftJoystickEvents.end()
|| Left2JoystickEvents.find(event) != Left2JoystickEvents.end() || QTJoystick3Events.find(event) != QTJoystick3Events.end()
|| RightJoystickEvents.find(event) != RightJoystickEvents.end() || RightJoystickEvents.find(event) != RightJoystickEvents.end()
|| Right2JoystickEvents.find(event) != Right2JoystickEvents.end(); || QTJoystick4Events.find(event) != QTJoystick4Events.end();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool PhysicalKeyboardHandler::isPaddleEvent(const Event::Type event) const bool PhysicalKeyboardHandler::isPaddleEvent(const Event::Type event) const
{ {
return LeftPaddlesEvents.find(event) != LeftPaddlesEvents.end() return LeftPaddlesEvents.find(event) != LeftPaddlesEvents.end()
|| Left2PaddlesEvents.find(event) != Left2PaddlesEvents.end() || QTPaddles3Events.find(event) != QTPaddles3Events.end()
|| RightPaddlesEvents.find(event) != RightPaddlesEvents.end() || RightPaddlesEvents.find(event) != RightPaddlesEvents.end()
|| Right2PaddlesEvents.find(event) != Right2PaddlesEvents.end(); || QTPaddles4Events.find(event) != QTPaddles4Events.end();
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -936,107 +936,107 @@ PhysicalKeyboardHandler::FixedPromptMapping = {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultJoystickMapping = { PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultJoystickMapping = {
{Event::JoystickZeroUp, KBDK_UP}, {Event::JoystickLeftUp, KBDK_UP},
{Event::JoystickZeroDown, KBDK_DOWN}, {Event::JoystickLeftDown, KBDK_DOWN},
{Event::JoystickZeroLeft, KBDK_LEFT}, {Event::JoystickLeftLeft, KBDK_LEFT},
{Event::JoystickZeroRight, KBDK_RIGHT}, {Event::JoystickLeftRight, KBDK_RIGHT},
{Event::JoystickZeroUp, KBDK_KP_8}, {Event::JoystickLeftUp, KBDK_KP_8},
{Event::JoystickZeroDown, KBDK_KP_2}, {Event::JoystickLeftDown, KBDK_KP_2},
{Event::JoystickZeroLeft, KBDK_KP_4}, {Event::JoystickLeftLeft, KBDK_KP_4},
{Event::JoystickZeroRight, KBDK_KP_6}, {Event::JoystickLeftRight, KBDK_KP_6},
{Event::JoystickZeroFire, KBDK_SPACE}, {Event::JoystickLeftFire, KBDK_SPACE},
{Event::JoystickZeroFire, KBDK_LCTRL}, {Event::JoystickLeftFire, KBDK_LCTRL},
{Event::JoystickZeroFire, KBDK_KP_5}, {Event::JoystickLeftFire, KBDK_KP_5},
{Event::JoystickZeroFire5, KBDK_4}, {Event::JoystickLeftFire5, KBDK_4},
{Event::JoystickZeroFire5, KBDK_RSHIFT}, {Event::JoystickLeftFire5, KBDK_RSHIFT},
{Event::JoystickZeroFire5, KBDK_KP_9}, {Event::JoystickLeftFire5, KBDK_KP_9},
{Event::JoystickZeroFire9, KBDK_5}, {Event::JoystickLeftFire9, KBDK_5},
{Event::JoystickZeroFire9, KBDK_RCTRL}, {Event::JoystickLeftFire9, KBDK_RCTRL},
{Event::JoystickZeroFire9, KBDK_KP_3}, {Event::JoystickLeftFire9, KBDK_KP_3},
{Event::JoystickOneUp, KBDK_Y}, {Event::JoystickRightUp, KBDK_Y},
{Event::JoystickOneDown, KBDK_H}, {Event::JoystickRightDown, KBDK_H},
{Event::JoystickOneLeft, KBDK_G}, {Event::JoystickRightLeft, KBDK_G},
{Event::JoystickOneRight, KBDK_J}, {Event::JoystickRightRight, KBDK_J},
{Event::JoystickOneFire, KBDK_F}, {Event::JoystickRightFire, KBDK_F},
{Event::JoystickOneFire5, KBDK_6}, {Event::JoystickRightFire5, KBDK_6},
{Event::JoystickOneFire9, KBDK_7}, {Event::JoystickRightFire9, KBDK_7},
// Same as Joysticks Zero & One + SHIFT // Same as Joysticks Zero & One + SHIFT
{Event::JoystickTwoUp, KBDK_UP, KBDM_SHIFT}, {Event::QTJoystickThreeUp, KBDK_UP, KBDM_SHIFT},
{Event::JoystickTwoDown, KBDK_DOWN, KBDM_SHIFT}, {Event::QTJoystickThreeDown, KBDK_DOWN, KBDM_SHIFT},
{Event::JoystickTwoLeft, KBDK_LEFT, KBDM_SHIFT}, {Event::QTJoystickThreeLeft, KBDK_LEFT, KBDM_SHIFT},
{Event::JoystickTwoRight, KBDK_RIGHT, KBDM_SHIFT}, {Event::QTJoystickThreeRight, KBDK_RIGHT, KBDM_SHIFT},
{Event::JoystickTwoUp, KBDK_KP_8, KBDM_SHIFT}, {Event::QTJoystickThreeUp, KBDK_KP_8, KBDM_SHIFT},
{Event::JoystickTwoDown, KBDK_KP_2, KBDM_SHIFT}, {Event::QTJoystickThreeDown, KBDK_KP_2, KBDM_SHIFT},
{Event::JoystickTwoLeft, KBDK_KP_4, KBDM_SHIFT}, {Event::QTJoystickThreeLeft, KBDK_KP_4, KBDM_SHIFT},
{Event::JoystickTwoRight, KBDK_KP_6, KBDM_SHIFT}, {Event::QTJoystickThreeRight, KBDK_KP_6, KBDM_SHIFT},
{Event::JoystickTwoFire, KBDK_SPACE, KBDM_SHIFT}, {Event::QTJoystickThreeFire, KBDK_SPACE, KBDM_SHIFT},
{Event::JoystickThreeUp, KBDK_Y, KBDM_SHIFT}, {Event::QTJoystickFourUp, KBDK_Y, KBDM_SHIFT},
{Event::JoystickThreeDown, KBDK_H, KBDM_SHIFT}, {Event::QTJoystickFourDown, KBDK_H, KBDM_SHIFT},
{Event::JoystickThreeLeft, KBDK_G, KBDM_SHIFT}, {Event::QTJoystickFourLeft, KBDK_G, KBDM_SHIFT},
{Event::JoystickThreeRight, KBDK_J, KBDM_SHIFT}, {Event::QTJoystickFourRight, KBDK_J, KBDM_SHIFT},
{Event::JoystickThreeFire, KBDK_F, KBDM_SHIFT}, {Event::QTJoystickFourFire, KBDK_F, KBDM_SHIFT},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::EventMappingArray
PhysicalKeyboardHandler::DefaultPaddleMapping = { PhysicalKeyboardHandler::DefaultPaddleMapping = {
{Event::PaddleZeroDecrease, KBDK_RIGHT}, {Event::PaddleLeftADecrease, KBDK_RIGHT},
{Event::PaddleZeroIncrease, KBDK_LEFT}, {Event::PaddleLeftAIncrease, KBDK_LEFT},
{Event::PaddleZeroFire, KBDK_SPACE}, {Event::PaddleLeftAFire, KBDK_SPACE},
{Event::PaddleZeroFire, KBDK_LCTRL}, {Event::PaddleLeftAFire, KBDK_LCTRL},
{Event::PaddleZeroFire, KBDK_KP_5}, {Event::PaddleLeftAFire, KBDK_KP_5},
{Event::PaddleOneDecrease, KBDK_DOWN}, {Event::PaddleLeftBDecrease, KBDK_DOWN},
{Event::PaddleOneIncrease, KBDK_UP}, {Event::PaddleLeftBIncrease, KBDK_UP},
{Event::PaddleOneFire, KBDK_4}, {Event::PaddleLeftBFire, KBDK_4},
{Event::PaddleOneFire, KBDK_RCTRL}, {Event::PaddleLeftBFire, KBDK_RCTRL},
{Event::PaddleTwoDecrease, KBDK_J}, {Event::PaddleRightADecrease, KBDK_J},
{Event::PaddleTwoIncrease, KBDK_G}, {Event::PaddleRightAIncrease, KBDK_G},
{Event::PaddleTwoFire, KBDK_F}, {Event::PaddleRightAFire, KBDK_F},
{Event::PaddleThreeDecrease, KBDK_H}, {Event::PaddleRightBDecrease, KBDK_H},
{Event::PaddleThreeIncrease, KBDK_Y}, {Event::PaddleRightBIncrease, KBDK_Y},
{Event::PaddleThreeFire, KBDK_6}, {Event::PaddleRightBFire, KBDK_6},
// Same as Paddles Zero..Three Fire + SHIFT // Same as Paddles Zero..Three Fire + SHIFT
{Event::PaddleFourFire, KBDK_SPACE, KBDM_SHIFT}, {Event::QTPaddle3AFire, KBDK_SPACE, KBDM_SHIFT},
{Event::PaddleFiveFire, KBDK_4, KBDM_SHIFT}, {Event::QTPaddle3BFire, KBDK_4, KBDM_SHIFT},
{Event::PaddleSixFire, KBDK_F, KBDM_SHIFT}, {Event::QTPaddle4AFire, KBDK_F, KBDM_SHIFT},
{Event::PaddleSevenFire, KBDK_6, KBDM_SHIFT}, {Event::QTPaddle4BFire, KBDK_6, KBDM_SHIFT},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::EventMappingArray
PhysicalKeyboardHandler::DefaultKeypadMapping = { PhysicalKeyboardHandler::DefaultKeypadMapping = {
{Event::KeyboardZero1, KBDK_1}, {Event::LeftKeyboard1, KBDK_1},
{Event::KeyboardZero2, KBDK_2}, {Event::LeftKeyboard2, KBDK_2},
{Event::KeyboardZero3, KBDK_3}, {Event::LeftKeyboard3, KBDK_3},
{Event::KeyboardZero4, KBDK_Q}, {Event::LeftKeyboard4, KBDK_Q},
{Event::KeyboardZero5, KBDK_W}, {Event::LeftKeyboard5, KBDK_W},
{Event::KeyboardZero6, KBDK_E}, {Event::LeftKeyboard6, KBDK_E},
{Event::KeyboardZero7, KBDK_A}, {Event::LeftKeyboard7, KBDK_A},
{Event::KeyboardZero8, KBDK_S}, {Event::LeftKeyboard8, KBDK_S},
{Event::KeyboardZero9, KBDK_D}, {Event::LeftKeyboard9, KBDK_D},
{Event::KeyboardZeroStar, KBDK_Z}, {Event::LeftKeyboardStar, KBDK_Z},
{Event::KeyboardZero0, KBDK_X}, {Event::LeftKeyboard0, KBDK_X},
{Event::KeyboardZeroPound, KBDK_C}, {Event::LeftKeyboardPound, KBDK_C},
{Event::KeyboardOne1, KBDK_8}, {Event::RightKeyboard1, KBDK_8},
{Event::KeyboardOne2, KBDK_9}, {Event::RightKeyboard2, KBDK_9},
{Event::KeyboardOne3, KBDK_0}, {Event::RightKeyboard3, KBDK_0},
{Event::KeyboardOne4, KBDK_I}, {Event::RightKeyboard4, KBDK_I},
{Event::KeyboardOne5, KBDK_O}, {Event::RightKeyboard5, KBDK_O},
{Event::KeyboardOne6, KBDK_P}, {Event::RightKeyboard6, KBDK_P},
{Event::KeyboardOne7, KBDK_K}, {Event::RightKeyboard7, KBDK_K},
{Event::KeyboardOne8, KBDK_L}, {Event::RightKeyboard8, KBDK_L},
{Event::KeyboardOne9, KBDK_SEMICOLON}, {Event::RightKeyboard9, KBDK_SEMICOLON},
{Event::KeyboardOneStar, KBDK_COMMA}, {Event::RightKeyboardStar, KBDK_COMMA},
{Event::KeyboardOne0, KBDK_PERIOD}, {Event::RightKeyboard0, KBDK_PERIOD},
{Event::KeyboardOnePound, KBDK_SLASH}, {Event::RightKeyboardPound, KBDK_SLASH},
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -73,74 +73,74 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
{Event::ConsoleRightDiffToggle, "ConsoleRightDiffToggle"}, {Event::ConsoleRightDiffToggle, "ConsoleRightDiffToggle"},
{Event::ConsoleSelect, "ConsoleSelect"}, {Event::ConsoleSelect, "ConsoleSelect"},
{Event::ConsoleReset, "ConsoleReset"}, {Event::ConsoleReset, "ConsoleReset"},
{Event::JoystickZeroUp, "JoystickZeroUp"}, {Event::JoystickLeftUp, "JoystickLeftUp"},
{Event::JoystickZeroDown, "JoystickZeroDown"}, {Event::JoystickLeftDown, "JoystickLeftDown"},
{Event::JoystickZeroLeft, "JoystickZeroLeft"}, {Event::JoystickLeftLeft, "JoystickLeftLeft"},
{Event::JoystickZeroRight, "JoystickZeroRight"}, {Event::JoystickLeftRight, "JoystickLeftRight"},
{Event::JoystickZeroFire, "JoystickZeroFire"}, {Event::JoystickLeftFire, "JoystickLeftFire"},
{Event::JoystickZeroFire5, "JoystickZeroFire5"}, {Event::JoystickLeftFire5, "JoystickLeftFire5"},
{Event::JoystickZeroFire9, "JoystickZeroFire9"}, {Event::JoystickLeftFire9, "JoystickLeftFire9"},
{Event::JoystickOneUp, "JoystickOneUp"}, {Event::JoystickRightUp, "JoystickRightUp"},
{Event::JoystickOneDown, "JoystickOneDown"}, {Event::JoystickRightDown, "JoystickRightDown"},
{Event::JoystickOneLeft, "JoystickOneLeft"}, {Event::JoystickRightLeft, "JoystickRightLeft"},
{Event::JoystickOneRight, "JoystickOneRight"}, {Event::JoystickRightRight, "JoystickRightRight"},
{Event::JoystickOneFire, "JoystickOneFire"}, {Event::JoystickRightFire, "JoystickRightFire"},
{Event::JoystickOneFire5, "JoystickOneFire5"}, {Event::JoystickRightFire5, "JoystickRightFire5"},
{Event::JoystickOneFire9, "JoystickOneFire9"}, {Event::JoystickRightFire9, "JoystickRightFire9"},
{Event::JoystickTwoUp, "JoystickTwoUp"}, {Event::QTJoystickThreeUp, "QTJoystickThreeUp"},
{Event::JoystickTwoDown, "JoystickTwoDown"}, {Event::QTJoystickThreeDown, "QTJoystickThreeDown"},
{Event::JoystickTwoLeft, "JoystickTwoLeft"}, {Event::QTJoystickThreeLeft, "QTJoystickThreeLeft"},
{Event::JoystickTwoRight, "JoystickTwoRight"}, {Event::QTJoystickThreeRight, "QTJoystickThreeRight"},
{Event::JoystickTwoFire, "JoystickTwoFire"}, {Event::QTJoystickThreeFire, "QTJoystickThreeFire"},
{Event::JoystickThreeUp, "JoystickThreeUp"}, {Event::QTJoystickFourUp, "QTJoystickFourUp"},
{Event::JoystickThreeDown, "JoystickThreeDown"}, {Event::QTJoystickFourDown, "QTJoystickFourDown"},
{Event::JoystickThreeLeft, "JoystickThreeLeft"}, {Event::QTJoystickFourLeft, "QTJoystickFourLeft"},
{Event::JoystickThreeRight, "JoystickThreeRight"}, {Event::QTJoystickFourRight, "QTJoystickFourRight"},
{Event::JoystickThreeFire, "JoystickThreeFire"}, {Event::QTJoystickFourFire, "QTJoystickFourFire"},
{Event::PaddleZeroDecrease, "PaddleZeroDecrease"}, {Event::PaddleLeftADecrease, "PaddleLeftADecrease"},
{Event::PaddleZeroIncrease, "PaddleZeroIncrease"}, {Event::PaddleLeftAIncrease, "PaddleLeftAIncrease"},
{Event::PaddleZeroAnalog, "PaddleZeroAnalog"}, {Event::PaddleLeftAAnalog, "PaddleLeftAAnalog"},
{Event::PaddleZeroFire, "PaddleZeroFire"}, {Event::PaddleLeftAFire, "PaddleLeftAFire"},
{Event::PaddleOneDecrease, "PaddleOneDecrease"}, {Event::PaddleLeftBDecrease, "PaddleLeftBDecrease"},
{Event::PaddleOneIncrease, "PaddleOneIncrease"}, {Event::PaddleLeftBIncrease, "PaddleLeftBIncrease"},
{Event::PaddleOneAnalog, "PaddleOneAnalog"}, {Event::PaddleLeftBAnalog, "PaddleLeftBAnalog"},
{Event::PaddleOneFire, "PaddleOneFire"}, {Event::PaddleLeftBFire, "PaddleLeftBFire"},
{Event::PaddleTwoDecrease, "PaddleTwoDecrease"}, {Event::PaddleRightADecrease, "PaddleRightADecrease"},
{Event::PaddleTwoIncrease, "PaddleTwoIncrease"}, {Event::PaddleRightAIncrease, "PaddleRightAIncrease"},
{Event::PaddleTwoAnalog, "PaddleTwoAnalog"}, {Event::PaddleRightAAnalog, "PaddleRightAAnalog"},
{Event::PaddleTwoFire, "PaddleTwoFire"}, {Event::PaddleRightAFire, "PaddleRightAFire"},
{Event::PaddleThreeDecrease, "PaddleThreeDecrease"}, {Event::PaddleRightBDecrease, "PaddleRightBDecrease"},
{Event::PaddleThreeIncrease, "PaddleThreeIncrease"}, {Event::PaddleRightBIncrease, "PaddleRightBIncrease"},
{Event::PaddleThreeAnalog, "PaddleThreeAnalog"}, {Event::PaddleRightBAnalog, "PaddleRightBAnalog"},
{Event::PaddleThreeFire, "PaddleThreeFire"}, {Event::PaddleRightBFire, "PaddleRightBFire"},
{Event::PaddleFourFire, "PaddleFourFire"}, {Event::QTPaddle3AFire, "QTPaddle3AFire"},
{Event::PaddleFiveFire, "PaddleFiveFire"}, {Event::QTPaddle3BFire, "QTPaddle3BFire"},
{Event::PaddleSixFire, "PaddleSixFire"}, {Event::QTPaddle4AFire, "QTPaddle4AFire"},
{Event::PaddleSevenFire, "PaddleSevenFire"}, {Event::QTPaddle4BFire, "QTPaddle4BFire"},
{Event::KeyboardZero1, "KeyboardZero1"}, {Event::LeftKeyboard1, "LeftKeyboard1"},
{Event::KeyboardZero2, "KeyboardZero2"}, {Event::LeftKeyboard2, "LeftKeyboard2"},
{Event::KeyboardZero3, "KeyboardZero3"}, {Event::LeftKeyboard3, "LeftKeyboard3"},
{Event::KeyboardZero4, "KeyboardZero4"}, {Event::LeftKeyboard4, "LeftKeyboard4"},
{Event::KeyboardZero5, "KeyboardZero5"}, {Event::LeftKeyboard5, "LeftKeyboard5"},
{Event::KeyboardZero6, "KeyboardZero6"}, {Event::LeftKeyboard6, "LeftKeyboard6"},
{Event::KeyboardZero7, "KeyboardZero7"}, {Event::LeftKeyboard7, "LeftKeyboard7"},
{Event::KeyboardZero8, "KeyboardZero8"}, {Event::LeftKeyboard8, "LeftKeyboard8"},
{Event::KeyboardZero9, "KeyboardZero9"}, {Event::LeftKeyboard9, "LeftKeyboard9"},
{Event::KeyboardZeroStar, "KeyboardZeroStar"}, {Event::LeftKeyboardStar, "LeftKeyboardStar"},
{Event::KeyboardZero0, "KeyboardZero0"}, {Event::LeftKeyboard0, "LeftKeyboard0"},
{Event::KeyboardZeroPound, "KeyboardZeroPound"}, {Event::LeftKeyboardPound, "LeftKeyboardPound"},
{Event::KeyboardOne1, "KeyboardOne1"}, {Event::RightKeyboard1, "RightKeyboard1"},
{Event::KeyboardOne2, "KeyboardOne2"}, {Event::RightKeyboard2, "RightKeyboard2"},
{Event::KeyboardOne3, "KeyboardOne3"}, {Event::RightKeyboard3, "RightKeyboard3"},
{Event::KeyboardOne4, "KeyboardOne4"}, {Event::RightKeyboard4, "RightKeyboard4"},
{Event::KeyboardOne5, "KeyboardOne5"}, {Event::RightKeyboard5, "RightKeyboard5"},
{Event::KeyboardOne6, "KeyboardOne6"}, {Event::RightKeyboard6, "RightKeyboard6"},
{Event::KeyboardOne7, "KeyboardOne7"}, {Event::RightKeyboard7, "RightKeyboard7"},
{Event::KeyboardOne8, "KeyboardOne8"}, {Event::RightKeyboard8, "RightKeyboard8"},
{Event::KeyboardOne9, "KeyboardOne9"}, {Event::RightKeyboard9, "RightKeyboard9"},
{Event::KeyboardOneStar, "KeyboardOneStar"}, {Event::RightKeyboardStar, "RightKeyboardStar"},
{Event::KeyboardOne0, "KeyboardOne0"}, {Event::RightKeyboard0, "RightKeyboard0"},
{Event::KeyboardOnePound, "KeyboardOnePound"}, {Event::RightKeyboardPound, "RightKeyboardPound"},
{Event::CompuMateFunc, "CompuMateFunc"}, {Event::CompuMateFunc, "CompuMateFunc"},
{Event::CompuMateShift, "CompuMateShift"}, {Event::CompuMateShift, "CompuMateShift"},
{Event::CompuMate0, "CompuMate0"}, {Event::CompuMate0, "CompuMate0"},

View File

@ -33,16 +33,16 @@ class KeyboardWidget : public ControllerWidget
const Event::Type* myEvent{nullptr}; const Event::Type* myEvent{nullptr};
static constexpr std::array<Event::Type, 12> ourLeftEvents = {{ static constexpr std::array<Event::Type, 12> ourLeftEvents = {{
Event::KeyboardZero1, Event::KeyboardZero2, Event::KeyboardZero3, Event::LeftKeyboard1, Event::LeftKeyboard2, Event::LeftKeyboard3,
Event::KeyboardZero4, Event::KeyboardZero5, Event::KeyboardZero6, Event::LeftKeyboard4, Event::LeftKeyboard5, Event::LeftKeyboard6,
Event::KeyboardZero7, Event::KeyboardZero8, Event::KeyboardZero9, Event::LeftKeyboard7, Event::LeftKeyboard8, Event::LeftKeyboard9,
Event::KeyboardZeroStar, Event::KeyboardZero0, Event::KeyboardZeroPound Event::LeftKeyboardStar, Event::LeftKeyboard0, Event::LeftKeyboardPound
}}; }};
static constexpr std::array<Event::Type, 12> ourRightEvents = {{ static constexpr std::array<Event::Type, 12> ourRightEvents = {{
Event::KeyboardOne1, Event::KeyboardOne2, Event::KeyboardOne3, Event::RightKeyboard1, Event::RightKeyboard2, Event::RightKeyboard3,
Event::KeyboardOne4, Event::KeyboardOne5, Event::KeyboardOne6, Event::RightKeyboard4, Event::RightKeyboard5, Event::RightKeyboard6,
Event::KeyboardOne7, Event::KeyboardOne8, Event::KeyboardOne9, Event::RightKeyboard7, Event::RightKeyboard8, Event::RightKeyboard9,
Event::KeyboardOneStar, Event::KeyboardOne0, Event::KeyboardOnePound Event::RightKeyboardStar, Event::RightKeyboard0, Event::RightKeyboardPound
}}; }};
private: private:

View File

@ -488,12 +488,11 @@ string PromptWidget::getLine()
{ {
#if defined(PSEUDO_CUT_COPY_PASTE) #if defined(PSEUDO_CUT_COPY_PASTE)
assert(_promptEndPos >= _promptStartPos); assert(_promptEndPos >= _promptStartPos);
int len = _promptEndPos - _promptStartPos;
string text; string text;
// Copy current line to text // Copy current line to text
for(int i = 0; i < len; i++) for(int i = _promptStartPos; i < _promptEndPos; i++)
text += buffer(_promptStartPos + i) & 0x7f; text += buffer(i) & 0x7f;
return text; return text;
#endif #endif
@ -609,12 +608,7 @@ bool PromptWidget::historyScroll(int direction)
if(_historyLine == 0) if(_historyLine == 0)
{ {
string input; historyAdd(getLine());
for(int i = _promptStartPos; i < _promptEndPos; i++)
input += buffer(i) & 0x7f;
historyAdd(input);
} }
// Advance to the next/prev line in the history // Advance to the next/prev line in the history
@ -668,9 +662,7 @@ bool PromptWidget::execute()
if(len > 0) if(len > 0)
{ {
// Copy the user input to command // Copy the user input to command
string command; string command = getLine();
for(int i = 0; i < len; i++)
command += buffer(_promptStartPos + i) & 0x7f;
// Add the input to the history // Add the input to the history
addToHistory(command.c_str()); addToHistory(command.c_str());

View File

@ -90,14 +90,14 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
// SWCHA bits in 'peek' mode // SWCHA bits in 'peek' mode
xpos = 10; ypos += lineHeight + 5; xpos = 10; ypos += lineHeight + 5;
labels.clear(); labels.clear();
labels.push_back("P0 right"); labels.push_back("Left right");
labels.push_back("P0 left"); labels.push_back("Left left");
labels.push_back("P0 down"); labels.push_back("Left down");
labels.push_back("P0 up"); labels.push_back("Left up");
labels.push_back("P1 right"); labels.push_back("Right right");
labels.push_back("P1 left"); labels.push_back("Right left");
labels.push_back("P1 down"); labels.push_back("Right down");
labels.push_back("P1 up"); labels.push_back("Right up");
CREATE_IO_REGS("SWCHA(R)", mySWCHAReadBits, kSWCHARBitsID, true) CREATE_IO_REGS("SWCHA(R)", mySWCHAReadBits, kSWCHARBitsID, true)
// SWCHB bits in 'poke' mode // SWCHB bits in 'poke' mode
@ -112,8 +112,8 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
// SWCHB bits in 'peek' mode // SWCHB bits in 'peek' mode
xpos = 10; ypos += lineHeight + 5; xpos = 10; ypos += lineHeight + 5;
labels.clear(); labels.clear();
labels.push_back("P1 difficulty"); labels.push_back("Right difficulty");
labels.push_back("P0 difficulty"); labels.push_back("Left difficulty");
labels.push_back(""); labels.push_back("");
labels.push_back(""); labels.push_back("");
labels.push_back("Color/B+W"); labels.push_back("Color/B+W");
@ -210,19 +210,19 @@ RiotWidget::RiotWidget(GuiObject* boss, const GUI::Font& lfont,
// PO & P1 difficulty switches // PO & P1 difficulty switches
int pwidth = lfont.getStringWidth("B/easy"); int pwidth = lfont.getStringWidth("B/easy");
lwidth = lfont.getStringWidth("P0 Diff "); lwidth = lfont.getStringWidth("Right Diff ");
xpos = col; ypos += 2 * lineHeight; xpos = col; ypos += 2 * lineHeight;
int col2_ypos = ypos; int col2_ypos = ypos;
items.clear(); items.clear();
VarList::push_back(items, "B/easy", "b"); VarList::push_back(items, "B/easy", "b");
VarList::push_back(items, "A/hard", "a"); VarList::push_back(items, "A/hard", "a");
myP0Diff = new PopUpWidget(boss, lfont, xpos, ypos, pwidth, lineHeight, items, myP0Diff = new PopUpWidget(boss, lfont, xpos, ypos, pwidth, lineHeight, items,
"P0 Diff ", lwidth, kP0DiffChanged); "Left Diff ", lwidth, kP0DiffChanged);
myP0Diff->setTarget(this); myP0Diff->setTarget(this);
addFocusWidget(myP0Diff); addFocusWidget(myP0Diff);
ypos += myP0Diff->getHeight() + 5; ypos += myP0Diff->getHeight() + 5;
myP1Diff = new PopUpWidget(boss, lfont, xpos, ypos, pwidth, lineHeight, items, myP1Diff = new PopUpWidget(boss, lfont, xpos, ypos, pwidth, lineHeight, items,
"P1 Diff ", lwidth, kP1DiffChanged); "Right Diff ", lwidth, kP1DiffChanged);
myP1Diff->setTarget(this); myP1Diff->setTarget(this);
addFocusWidget(myP1Diff); addFocusWidget(myP1Diff);

View File

@ -23,13 +23,13 @@ BoosterGrip::BoosterGrip(Jack jack, const Event& event, const System& system)
{ {
if(myJack == Jack::Left) if(myJack == Jack::Left)
{ {
myTriggerEvent = Event::JoystickZeroFire5; myTriggerEvent = Event::JoystickLeftFire5;
myBoosterEvent = Event::JoystickZeroFire9; myBoosterEvent = Event::JoystickLeftFire9;
} }
else else
{ {
myTriggerEvent = Event::JoystickOneFire5; myTriggerEvent = Event::JoystickRightFire5;
myBoosterEvent = Event::JoystickOneFire9; myBoosterEvent = Event::JoystickRightFire9;
} }
setPin(AnalogPin::Five, AnalogReadout::disconnect()); setPin(AnalogPin::Five, AnalogReadout::disconnect());

View File

@ -25,15 +25,15 @@ Driving::Driving(Jack jack, const Event& event, const System& system, bool altma
{ {
if(!altmap) if(!altmap)
{ {
myCCWEvent = Event::JoystickZeroLeft; myCCWEvent = Event::JoystickLeftLeft;
myCWEvent = Event::JoystickZeroRight; myCWEvent = Event::JoystickLeftRight;
myFireEvent = Event::JoystickZeroFire; myFireEvent = Event::JoystickLeftFire;
} }
else else
{ {
myCCWEvent = Event::JoystickTwoLeft; myCCWEvent = Event::QTJoystickThreeLeft;
myCWEvent = Event::JoystickTwoRight; myCWEvent = Event::QTJoystickThreeRight;
myFireEvent = Event::JoystickTwoFire; myFireEvent = Event::QTJoystickThreeFire;
} }
myXAxisValue = Event::SALeftAxis0Value; // joystick input myXAxisValue = Event::SALeftAxis0Value; // joystick input
myYAxisValue = Event::SALeftAxis1Value; // driving controller input myYAxisValue = Event::SALeftAxis1Value; // driving controller input
@ -42,15 +42,15 @@ Driving::Driving(Jack jack, const Event& event, const System& system, bool altma
{ {
if(!altmap) if(!altmap)
{ {
myCCWEvent = Event::JoystickOneLeft; myCCWEvent = Event::JoystickRightLeft;
myCWEvent = Event::JoystickOneRight; myCWEvent = Event::JoystickRightRight;
myFireEvent = Event::JoystickOneFire; myFireEvent = Event::JoystickRightFire;
} }
else else
{ {
myCCWEvent = Event::JoystickThreeLeft; myCCWEvent = Event::QTJoystickFourLeft;
myCWEvent = Event::JoystickThreeRight; myCWEvent = Event::QTJoystickFourRight;
myFireEvent = Event::JoystickThreeFire; myFireEvent = Event::QTJoystickFourFire;
} }
myXAxisValue = Event::SARightAxis0Value; // joystick input myXAxisValue = Event::SARightAxis0Value; // joystick input
myYAxisValue = Event::SARightAxis1Value; // driving controller input myYAxisValue = Event::SARightAxis1Value; // driving controller input

View File

@ -42,25 +42,25 @@ class Event
ConsoleRightDiffA, ConsoleRightDiffB, ConsoleRightDiffToggle, ConsoleRightDiffA, ConsoleRightDiffB, ConsoleRightDiffToggle,
ConsoleSelect, ConsoleReset, ConsoleSelect, ConsoleReset,
JoystickZeroUp, JoystickZeroDown, JoystickZeroLeft, JoystickZeroRight, JoystickLeftUp, JoystickLeftDown, JoystickLeftLeft, JoystickLeftRight,
JoystickZeroFire, JoystickZeroFire5, JoystickZeroFire9, JoystickLeftFire, JoystickLeftFire5, JoystickLeftFire9,
JoystickOneUp, JoystickOneDown, JoystickOneLeft, JoystickOneRight, JoystickRightUp, JoystickRightDown, JoystickRightLeft, JoystickRightRight,
JoystickOneFire, JoystickOneFire5, JoystickOneFire9, JoystickRightFire, JoystickRightFire5, JoystickRightFire9,
PaddleZeroDecrease, PaddleZeroIncrease, PaddleZeroAnalog, PaddleZeroFire, PaddleLeftADecrease, PaddleLeftAIncrease, PaddleLeftAAnalog, PaddleLeftAFire,
PaddleOneDecrease, PaddleOneIncrease, PaddleOneAnalog, PaddleOneFire, PaddleLeftBDecrease, PaddleLeftBIncrease, PaddleLeftBAnalog, PaddleLeftBFire,
PaddleTwoDecrease, PaddleTwoIncrease, PaddleTwoAnalog, PaddleTwoFire, PaddleRightADecrease, PaddleRightAIncrease, PaddleRightAAnalog, PaddleRightAFire,
PaddleThreeDecrease, PaddleThreeIncrease, PaddleThreeAnalog, PaddleThreeFire, PaddleRightBDecrease, PaddleRightBIncrease, PaddleRightBAnalog, PaddleRightBFire,
KeyboardZero1, KeyboardZero2, KeyboardZero3, LeftKeyboard1, LeftKeyboard2, LeftKeyboard3,
KeyboardZero4, KeyboardZero5, KeyboardZero6, LeftKeyboard4, LeftKeyboard5, LeftKeyboard6,
KeyboardZero7, KeyboardZero8, KeyboardZero9, LeftKeyboard7, LeftKeyboard8, LeftKeyboard9,
KeyboardZeroStar, KeyboardZero0, KeyboardZeroPound, LeftKeyboardStar, LeftKeyboard0, LeftKeyboardPound,
KeyboardOne1, KeyboardOne2, KeyboardOne3, RightKeyboard1, RightKeyboard2, RightKeyboard3,
KeyboardOne4, KeyboardOne5, KeyboardOne6, RightKeyboard4, RightKeyboard5, RightKeyboard6,
KeyboardOne7, KeyboardOne8, KeyboardOne9, RightKeyboard7, RightKeyboard8, RightKeyboard9,
KeyboardOneStar, KeyboardOne0, KeyboardOnePound, RightKeyboardStar, RightKeyboard0, RightKeyboardPound,
CompuMateFunc, CompuMateShift, CompuMateFunc, CompuMateShift,
CompuMate0, CompuMate1, CompuMate2, CompuMate3, CompuMate4, CompuMate0, CompuMate1, CompuMate2, CompuMate3, CompuMate4,
@ -129,10 +129,10 @@ class Event
DecreaseAutoFire, IncreaseAutoFire, DecreaseAutoFire, IncreaseAutoFire,
DecreaseSpeed, IncreaseSpeed, DecreaseSpeed, IncreaseSpeed,
JoystickTwoUp, JoystickTwoDown, JoystickTwoLeft, JoystickTwoRight, QTJoystickThreeUp, QTJoystickThreeDown, QTJoystickThreeLeft, QTJoystickThreeRight,
JoystickTwoFire, QTJoystickThreeFire,
JoystickThreeUp, JoystickThreeDown, JoystickThreeLeft, JoystickThreeRight, QTJoystickFourUp, QTJoystickFourDown, QTJoystickFourLeft, QTJoystickFourRight,
JoystickThreeFire, QTJoystickFourFire,
ToggleCorrectAspectRatio, ToggleCorrectAspectRatio,
@ -167,7 +167,7 @@ class Event
DecreaseMouseAxesRange, IncreaseMouseAxesRange, DecreaseMouseAxesRange, IncreaseMouseAxesRange,
SALeftAxis0Value, SALeftAxis1Value, SARightAxis0Value, SARightAxis1Value, SALeftAxis0Value, SALeftAxis1Value, SARightAxis0Value, SARightAxis1Value,
PaddleFourFire, PaddleFiveFire, PaddleSixFire, PaddleSevenFire, QTPaddle3AFire, QTPaddle3BFire, QTPaddle4AFire, QTPaddle4BFire,
UIHelp, UIHelp,
LastType LastType
}; };
@ -229,10 +229,10 @@ class Event
{ {
switch(type) switch(type)
{ {
case Event::PaddleZeroAnalog: case Event::PaddleLeftAAnalog:
case Event::PaddleOneAnalog: case Event::PaddleLeftBAnalog:
case Event::PaddleTwoAnalog: case Event::PaddleRightAAnalog:
case Event::PaddleThreeAnalog: case Event::PaddleRightBAnalog:
return true; return true;
default: default:
return false; return false;
@ -256,62 +256,62 @@ class Event
// Hold controller related events // Hold controller related events
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet LeftJoystickEvents = { static const Event::EventSet LeftJoystickEvents = {
Event::JoystickZeroUp, Event::JoystickZeroDown, Event::JoystickZeroLeft, Event::JoystickZeroRight, Event::JoystickLeftUp, Event::JoystickLeftDown, Event::JoystickLeftLeft, Event::JoystickLeftRight,
Event::JoystickZeroFire, Event::JoystickZeroFire5, Event::JoystickZeroFire9, Event::JoystickLeftFire, Event::JoystickLeftFire5, Event::JoystickLeftFire9,
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet Left2JoystickEvents = { static const Event::EventSet QTJoystick3Events = {
Event::JoystickTwoUp, Event::JoystickTwoDown, Event::JoystickTwoLeft, Event::JoystickTwoRight, Event::QTJoystickThreeUp, Event::QTJoystickThreeDown, Event::QTJoystickThreeLeft, Event::QTJoystickThreeRight,
Event::JoystickTwoFire Event::QTJoystickThreeFire
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet RightJoystickEvents = { static const Event::EventSet RightJoystickEvents = {
Event::JoystickOneUp, Event::JoystickOneDown, Event::JoystickOneLeft, Event::JoystickOneRight, Event::JoystickRightUp, Event::JoystickRightDown, Event::JoystickRightLeft, Event::JoystickRightRight,
Event::JoystickOneFire, Event::JoystickOneFire5, Event::JoystickOneFire9, Event::JoystickRightFire, Event::JoystickRightFire5, Event::JoystickRightFire9,
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet Right2JoystickEvents = { static const Event::EventSet QTJoystick4Events = {
Event::JoystickThreeUp, Event::JoystickThreeDown, Event::JoystickThreeLeft, Event::JoystickThreeRight, Event::QTJoystickFourUp, Event::QTJoystickFourDown, Event::QTJoystickFourLeft, Event::QTJoystickFourRight,
Event::JoystickThreeFire Event::QTJoystickFourFire
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet LeftPaddlesEvents = { static const Event::EventSet LeftPaddlesEvents = {
Event::PaddleZeroDecrease, Event::PaddleZeroIncrease, Event::PaddleZeroAnalog, Event::PaddleZeroFire, Event::PaddleLeftADecrease, Event::PaddleLeftAIncrease, Event::PaddleLeftAAnalog, Event::PaddleLeftAFire,
Event::PaddleOneDecrease, Event::PaddleOneIncrease, Event::PaddleOneAnalog, Event::PaddleOneFire, Event::PaddleLeftBDecrease, Event::PaddleLeftBIncrease, Event::PaddleLeftBAnalog, Event::PaddleLeftBFire,
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet Left2PaddlesEvents = { static const Event::EventSet QTPaddles3Events = {
// Only fire buttons supported by QuadTari // Only fire buttons supported by QuadTari
Event::PaddleFourFire, Event::PaddleFiveFire Event::QTPaddle3AFire, Event::QTPaddle3BFire
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet RightPaddlesEvents = { static const Event::EventSet RightPaddlesEvents = {
Event::PaddleTwoDecrease, Event::PaddleTwoIncrease, Event::PaddleTwoAnalog, Event::PaddleTwoFire, Event::PaddleRightADecrease, Event::PaddleRightAIncrease, Event::PaddleRightAAnalog, Event::PaddleRightAFire,
Event::PaddleThreeDecrease, Event::PaddleThreeIncrease, Event::PaddleThreeAnalog, Event::PaddleThreeFire, Event::PaddleRightBDecrease, Event::PaddleRightBIncrease, Event::PaddleRightBAnalog, Event::PaddleRightBFire,
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet Right2PaddlesEvents = { static const Event::EventSet QTPaddles4Events = {
// Only fire buttons supported by QuadTari // Only fire buttons supported by QuadTari
Event::PaddleSixFire, Event::PaddleSevenFire Event::QTPaddle4AFire, Event::QTPaddle4BFire
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet LeftKeypadEvents = { static const Event::EventSet LeftKeypadEvents = {
Event::KeyboardZero1, Event::KeyboardZero2, Event::KeyboardZero3, Event::LeftKeyboard1, Event::LeftKeyboard2, Event::LeftKeyboard3,
Event::KeyboardZero4, Event::KeyboardZero5, Event::KeyboardZero6, Event::LeftKeyboard4, Event::LeftKeyboard5, Event::LeftKeyboard6,
Event::KeyboardZero7, Event::KeyboardZero8, Event::KeyboardZero9, Event::LeftKeyboard7, Event::LeftKeyboard8, Event::LeftKeyboard9,
Event::KeyboardZeroStar, Event::KeyboardZero0, Event::KeyboardZeroPound, Event::LeftKeyboardStar, Event::LeftKeyboard0, Event::LeftKeyboardPound,
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet RightKeypadEvents = { static const Event::EventSet RightKeypadEvents = {
Event::KeyboardOne1, Event::KeyboardOne2, Event::KeyboardOne3, Event::RightKeyboard1, Event::RightKeyboard2, Event::RightKeyboard3,
Event::KeyboardOne4, Event::KeyboardOne5, Event::KeyboardOne6, Event::RightKeyboard4, Event::RightKeyboard5, Event::RightKeyboard6,
Event::KeyboardOne7, Event::KeyboardOne8, Event::KeyboardOne9, Event::RightKeyboard7, Event::RightKeyboard8, Event::RightKeyboard9,
Event::KeyboardOneStar, Event::KeyboardOne0, Event::KeyboardOnePound, Event::RightKeyboardStar, Event::RightKeyboard0, Event::RightKeyboardPound,
}; };
#endif #endif

View File

@ -758,84 +758,84 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// If enabled, make sure 'impossible' joystick directions aren't allowed // If enabled, make sure 'impossible' joystick directions aren't allowed
case Event::JoystickZeroUp: case Event::JoystickLeftUp:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickZeroDown, 0); myEvent.set(Event::JoystickLeftDown, 0);
break; break;
case Event::JoystickZeroDown: case Event::JoystickLeftDown:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickZeroUp, 0); myEvent.set(Event::JoystickLeftUp, 0);
break; break;
case Event::JoystickZeroLeft: case Event::JoystickLeftLeft:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickZeroRight, 0); myEvent.set(Event::JoystickLeftRight, 0);
break; break;
case Event::JoystickZeroRight: case Event::JoystickLeftRight:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickZeroLeft, 0); myEvent.set(Event::JoystickLeftLeft, 0);
break; break;
case Event::JoystickOneUp: case Event::JoystickRightUp:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickOneDown, 0); myEvent.set(Event::JoystickRightDown, 0);
break; break;
case Event::JoystickOneDown: case Event::JoystickRightDown:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickOneUp, 0); myEvent.set(Event::JoystickRightUp, 0);
break; break;
case Event::JoystickOneLeft: case Event::JoystickRightLeft:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickOneRight, 0); myEvent.set(Event::JoystickRightRight, 0);
break; break;
case Event::JoystickOneRight: case Event::JoystickRightRight:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickOneLeft, 0); myEvent.set(Event::JoystickRightLeft, 0);
break; break;
case Event::JoystickTwoUp: case Event::QTJoystickThreeUp:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoDown, 0); myEvent.set(Event::QTJoystickThreeDown, 0);
break; break;
case Event::JoystickTwoDown: case Event::QTJoystickThreeDown:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoUp, 0); myEvent.set(Event::QTJoystickThreeUp, 0);
break; break;
case Event::JoystickTwoLeft: case Event::QTJoystickThreeLeft:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoRight, 0); myEvent.set(Event::QTJoystickThreeRight, 0);
break; break;
case Event::JoystickTwoRight: case Event::QTJoystickThreeRight:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoLeft, 0); myEvent.set(Event::QTJoystickThreeLeft, 0);
break; break;
case Event::JoystickThreeUp: case Event::QTJoystickFourUp:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeDown, 0); myEvent.set(Event::QTJoystickFourDown, 0);
break; break;
case Event::JoystickThreeDown: case Event::QTJoystickFourDown:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeUp, 0); myEvent.set(Event::QTJoystickFourUp, 0);
break; break;
case Event::JoystickThreeLeft: case Event::QTJoystickFourLeft:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeRight, 0); myEvent.set(Event::QTJoystickFourRight, 0);
break; break;
case Event::JoystickThreeRight: case Event::QTJoystickFourRight:
if(!myAllowAllDirectionsFlag && pressed) if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeLeft, 0); myEvent.set(Event::QTJoystickFourLeft, 0);
break; break;
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
@ -2087,27 +2087,27 @@ void EventHandler::handleConsoleStartupEvents()
const string& holdjoy0 = myOSystem.settings().getString("holdjoy0"); const string& holdjoy0 = myOSystem.settings().getString("holdjoy0");
if(BSPF::containsIgnoreCase(holdjoy0, "U")) if(BSPF::containsIgnoreCase(holdjoy0, "U"))
handleEvent(Event::JoystickZeroUp); handleEvent(Event::JoystickLeftUp);
if(BSPF::containsIgnoreCase(holdjoy0, "D")) if(BSPF::containsIgnoreCase(holdjoy0, "D"))
handleEvent(Event::JoystickZeroDown); handleEvent(Event::JoystickLeftDown);
if(BSPF::containsIgnoreCase(holdjoy0, "L")) if(BSPF::containsIgnoreCase(holdjoy0, "L"))
handleEvent(Event::JoystickZeroLeft); handleEvent(Event::JoystickLeftLeft);
if(BSPF::containsIgnoreCase(holdjoy0, "R")) if(BSPF::containsIgnoreCase(holdjoy0, "R"))
handleEvent(Event::JoystickZeroRight); handleEvent(Event::JoystickLeftRight);
if(BSPF::containsIgnoreCase(holdjoy0, "F")) if(BSPF::containsIgnoreCase(holdjoy0, "F"))
handleEvent(Event::JoystickZeroFire); handleEvent(Event::JoystickLeftFire);
const string& holdjoy1 = myOSystem.settings().getString("holdjoy1"); const string& holdjoy1 = myOSystem.settings().getString("holdjoy1");
if(BSPF::containsIgnoreCase(holdjoy1, "U")) if(BSPF::containsIgnoreCase(holdjoy1, "U"))
handleEvent(Event::JoystickOneUp); handleEvent(Event::JoystickRightUp);
if(BSPF::containsIgnoreCase(holdjoy1, "D")) if(BSPF::containsIgnoreCase(holdjoy1, "D"))
handleEvent(Event::JoystickOneDown); handleEvent(Event::JoystickRightDown);
if(BSPF::containsIgnoreCase(holdjoy1, "L")) if(BSPF::containsIgnoreCase(holdjoy1, "L"))
handleEvent(Event::JoystickOneLeft); handleEvent(Event::JoystickRightLeft);
if(BSPF::containsIgnoreCase(holdjoy1, "R")) if(BSPF::containsIgnoreCase(holdjoy1, "R"))
handleEvent(Event::JoystickOneRight); handleEvent(Event::JoystickRightRight);
if(BSPF::containsIgnoreCase(holdjoy1, "F")) if(BSPF::containsIgnoreCase(holdjoy1, "F"))
handleEvent(Event::JoystickOneFire); handleEvent(Event::JoystickRightFire);
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -3036,12 +3036,12 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::ConsoleBlackWhite, "Black & White TV", "" }, { Event::ConsoleBlackWhite, "Black & White TV", "" },
{ Event::ConsoleColorToggle, "Toggle Color / B&W TV", "" }, { Event::ConsoleColorToggle, "Toggle Color / B&W TV", "" },
{ Event::Console7800Pause, "7800 Pause Key", "" }, { Event::Console7800Pause, "7800 Pause Key", "" },
{ Event::ConsoleLeftDiffA, "P0 Difficulty A", "" }, { Event::ConsoleLeftDiffA, "Left Difficulty A", "" },
{ Event::ConsoleLeftDiffB, "P0 Difficulty B", "" }, { Event::ConsoleLeftDiffB, "Left Difficulty B", "" },
{ Event::ConsoleLeftDiffToggle, "P0 Toggle Difficulty", "" }, { Event::ConsoleLeftDiffToggle, "Toggle Left Difficulty", "" },
{ Event::ConsoleRightDiffA, "P1 Difficulty A", "" }, { Event::ConsoleRightDiffA, "Right Difficulty A", "" },
{ Event::ConsoleRightDiffB, "P1 Difficulty B", "" }, { Event::ConsoleRightDiffB, "Right Difficulty B", "" },
{ Event::ConsoleRightDiffToggle, "P1 Toggle Difficulty", "" }, { Event::ConsoleRightDiffToggle, "Toggle Right Difficulty", "" },
{ Event::SaveState, "Save state", "" }, { Event::SaveState, "Save state", "" },
{ Event::SaveAllStates, "Save all TM states of current game", "" }, { Event::SaveAllStates, "Save all TM states of current game", "" },
{ Event::PreviousState, "Change to previous state slot", "" }, { Event::PreviousState, "Change to previous state slot", "" },
@ -3056,84 +3056,84 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::ToggleContSnapshotsFrame,"Save continuous snapsh. (every frame)", "" }, { Event::ToggleContSnapshotsFrame,"Save continuous snapsh. (every frame)", "" },
#endif #endif
{ Event::JoystickZeroUp, "P0 Joystick Up", "" }, { Event::JoystickLeftUp, "Left Joystick Up", "" },
{ Event::JoystickZeroDown, "P0 Joystick Down", "" }, { Event::JoystickLeftDown, "Left Joystick Down", "" },
{ Event::JoystickZeroLeft, "P0 Joystick Left", "" }, { Event::JoystickLeftLeft, "Left Joystick Left", "" },
{ Event::JoystickZeroRight, "P0 Joystick Right", "" }, { Event::JoystickLeftRight, "Left Joystick Right", "" },
{ Event::JoystickZeroFire, "P0 Joystick Fire", "" }, { Event::JoystickLeftFire, "Left Joystick Fire", "" },
{ Event::JoystickZeroFire5, "P0 Booster Top Booster Button", "" }, { Event::JoystickLeftFire5, "Left Booster Top Booster Button", "" },
{ Event::JoystickZeroFire9, "P0 Booster Handle Grip Trigger", "" }, { Event::JoystickLeftFire9, "Left Booster Handle Grip Trigger", "" },
{ Event::JoystickOneUp, "P1 Joystick Up", "" }, { Event::JoystickRightUp, "Right Joystick Up", "" },
{ Event::JoystickOneDown, "P1 Joystick Down", "" }, { Event::JoystickRightDown, "Right Joystick Down", "" },
{ Event::JoystickOneLeft, "P1 Joystick Left", "" }, { Event::JoystickRightLeft, "Right Joystick Left", "" },
{ Event::JoystickOneRight, "P1 Joystick Right", "" }, { Event::JoystickRightRight, "Right Joystick Right", "" },
{ Event::JoystickOneFire, "P1 Joystick Fire", "" }, { Event::JoystickRightFire, "Right Joystick Fire", "" },
{ Event::JoystickOneFire5, "P1 Booster Top Booster Button", "" }, { Event::JoystickRightFire5, "Right Booster Top Booster Button", "" },
{ Event::JoystickOneFire9, "P1 Booster Handle Grip Trigger", "" }, { Event::JoystickRightFire9, "Right Booster Handle Grip Trigger", "" },
{ Event::JoystickTwoUp, "P2 Joystick Up", "" }, { Event::QTJoystickThreeUp, "QuadTari Joystick 3 Up", "" },
{ Event::JoystickTwoDown, "P2 Joystick Down", "" }, { Event::QTJoystickThreeDown, "QuadTari Joystick 3 Down", "" },
{ Event::JoystickTwoLeft, "P2 Joystick Left", "" }, { Event::QTJoystickThreeLeft, "QuadTari Joystick 3 Left", "" },
{ Event::JoystickTwoRight, "P2 Joystick Right", "" }, { Event::QTJoystickThreeRight, "QuadTari Joystick 3 Right", "" },
{ Event::JoystickTwoFire, "P2 Joystick Fire", "" }, { Event::QTJoystickThreeFire, "QuadTari Joystick 3 Fire", "" },
{ Event::JoystickThreeUp, "P3 Joystick Up", "" }, { Event::QTJoystickFourUp, "QuadTari Joystick 4 Up", "" },
{ Event::JoystickThreeDown, "P3 Joystick Down", "" }, { Event::QTJoystickFourDown, "QuadTari Joystick 4 Down", "" },
{ Event::JoystickThreeLeft, "P3 Joystick Left", "" }, { Event::QTJoystickFourLeft, "QuadTari Joystick 4 Left", "" },
{ Event::JoystickThreeRight, "P3 Joystick Right", "" }, { Event::QTJoystickFourRight, "QuadTari Joystick 4 Right", "" },
{ Event::JoystickThreeFire, "P3 Joystick Fire", "" }, { Event::QTJoystickFourFire, "QuadTari Joystick 4 Fire", "" },
{ Event::PaddleZeroAnalog, "Paddle 0 Analog", "" }, { Event::PaddleLeftAAnalog, "Left Paddle A Analog", "" },
{ Event::PaddleZeroIncrease, "Paddle 0 Turn Left", "" }, { Event::PaddleLeftAIncrease, "Left Paddle A Turn Left", "" },
{ Event::PaddleZeroDecrease, "Paddle 0 Turn Right", "" }, { Event::PaddleLeftADecrease, "Left Paddle A Turn Right", "" },
{ Event::PaddleZeroFire, "Paddle 0 Fire", "" }, { Event::PaddleLeftAFire, "Left Paddle A Fire", "" },
{ Event::PaddleOneAnalog, "Paddle 1 Analog", "" }, { Event::PaddleLeftBAnalog, "Left Paddle B Analog", "" },
{ Event::PaddleOneIncrease, "Paddle 1 Turn Left", "" }, { Event::PaddleLeftBIncrease, "Left Paddle B Turn Left", "" },
{ Event::PaddleOneDecrease, "Paddle 1 Turn Right", "" }, { Event::PaddleLeftBDecrease, "Left Paddle B Turn Right", "" },
{ Event::PaddleOneFire, "Paddle 1 Fire", "" }, { Event::PaddleLeftBFire, "Left Paddle B Fire", "" },
{ Event::PaddleTwoAnalog, "Paddle 2 Analog", "" }, { Event::PaddleRightAAnalog, "Right Paddle A Analog", "" },
{ Event::PaddleTwoIncrease, "Paddle 2 Turn Left", "" }, { Event::PaddleRightAIncrease, "Right Paddle A Turn Left", "" },
{ Event::PaddleTwoDecrease, "Paddle 2 Turn Right", "" }, { Event::PaddleRightADecrease, "Right Paddle A Turn Right", "" },
{ Event::PaddleTwoFire, "Paddle 2 Fire", "" }, { Event::PaddleRightAFire, "Right Paddle A Fire", "" },
{ Event::PaddleThreeAnalog, "Paddle 3 Analog", "" }, { Event::PaddleRightBAnalog, "Right Paddle B Analog", "" },
{ Event::PaddleThreeIncrease, "Paddle 3 Turn Left", "" }, { Event::PaddleRightBIncrease, "Right Paddle B Turn Left", "" },
{ Event::PaddleThreeDecrease, "Paddle 3 Turn Right", "" }, { Event::PaddleRightBDecrease, "Right Paddle B Turn Right", "" },
{ Event::PaddleThreeFire, "Paddle 3 Fire", "" }, { Event::PaddleRightBFire, "Right Paddle B Fire", "" },
{ Event::PaddleFourFire, "Paddle 4 Fire", "" }, { Event::QTPaddle3AFire, "QuadTari Paddle 3A Fire", "" },
{ Event::PaddleFiveFire, "Paddle 5 Fire", "" }, { Event::QTPaddle3BFire, "QuadTari Paddle 3B Fire", "" },
{ Event::PaddleSixFire, "Paddle 6 Fire", "" }, { Event::QTPaddle4AFire, "QuadTari Paddle 4A Fire", "" },
{ Event::PaddleSevenFire, "Paddle 7 Fire", "" }, { Event::QTPaddle4BFire, "QuadTari Paddle 4B Fire", "" },
{ Event::KeyboardZero1, "P0 Keyboard 1", "" }, { Event::LeftKeyboard1, "Left Keyboard 1", "" },
{ Event::KeyboardZero2, "P0 Keyboard 2", "" }, { Event::LeftKeyboard2, "Left Keyboard 2", "" },
{ Event::KeyboardZero3, "P0 Keyboard 3", "" }, { Event::LeftKeyboard3, "Left Keyboard 3", "" },
{ Event::KeyboardZero4, "P0 Keyboard 4", "" }, { Event::LeftKeyboard4, "Left Keyboard 4", "" },
{ Event::KeyboardZero5, "P0 Keyboard 5", "" }, { Event::LeftKeyboard5, "Left Keyboard 5", "" },
{ Event::KeyboardZero6, "P0 Keyboard 6", "" }, { Event::LeftKeyboard6, "Left Keyboard 6", "" },
{ Event::KeyboardZero7, "P0 Keyboard 7", "" }, { Event::LeftKeyboard7, "Left Keyboard 7", "" },
{ Event::KeyboardZero8, "P0 Keyboard 8", "" }, { Event::LeftKeyboard8, "Left Keyboard 8", "" },
{ Event::KeyboardZero9, "P0 Keyboard 9", "" }, { Event::LeftKeyboard9, "Left Keyboard 9", "" },
{ Event::KeyboardZeroStar, "P0 Keyboard *", "" }, { Event::LeftKeyboardStar, "Left Keyboard *", "" },
{ Event::KeyboardZero0, "P0 Keyboard 0", "" }, { Event::LeftKeyboard0, "Left Keyboard 0", "" },
{ Event::KeyboardZeroPound, "P0 Keyboard #", "" }, { Event::LeftKeyboardPound, "Left Keyboard #", "" },
{ Event::KeyboardOne1, "P1 Keyboard 1", "" }, { Event::RightKeyboard1, "Right Keyboard 1", "" },
{ Event::KeyboardOne2, "P1 Keyboard 2", "" }, { Event::RightKeyboard2, "Right Keyboard 2", "" },
{ Event::KeyboardOne3, "P1 Keyboard 3", "" }, { Event::RightKeyboard3, "Right Keyboard 3", "" },
{ Event::KeyboardOne4, "P1 Keyboard 4", "" }, { Event::RightKeyboard4, "Right Keyboard 4", "" },
{ Event::KeyboardOne5, "P1 Keyboard 5", "" }, { Event::RightKeyboard5, "Right Keyboard 5", "" },
{ Event::KeyboardOne6, "P1 Keyboard 6", "" }, { Event::RightKeyboard6, "Right Keyboard 6", "" },
{ Event::KeyboardOne7, "P1 Keyboard 7", "" }, { Event::RightKeyboard7, "Right Keyboard 7", "" },
{ Event::KeyboardOne8, "P1 Keyboard 8", "" }, { Event::RightKeyboard8, "Right Keyboard 8", "" },
{ Event::KeyboardOne9, "P1 Keyboard 9", "" }, { Event::RightKeyboard9, "Right Keyboard 9", "" },
{ Event::KeyboardOneStar, "P1 Keyboard *", "" }, { Event::RightKeyboardStar, "Right Keyboard *", "" },
{ Event::KeyboardOne0, "P1 Keyboard 0", "" }, { Event::RightKeyboard0, "Right Keyboard 0", "" },
{ Event::KeyboardOnePound, "P1 Keyboard #", "" }, { Event::RightKeyboardPound, "Right Keyboard #", "" },
// Video // Video
{ Event::ToggleFullScreen, "Toggle fullscreen", "" }, { Event::ToggleFullScreen, "Toggle fullscreen", "" },
#ifdef ADAPTABLE_REFRESH_SUPPORT #ifdef ADAPTABLE_REFRESH_SUPPORT
@ -3234,7 +3234,7 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::DecreaseDrivingSense, "Decrease driving sensitivity", "" }, { Event::DecreaseDrivingSense, "Decrease driving sensitivity", "" },
{ Event::IncreaseDrivingSense, "Increase driving sensitivity", "" }, { Event::IncreaseDrivingSense, "Increase driving sensitivity", "" },
{ Event::PreviousCursorVisbility, "Select prev. cursor visibility mode", "" }, { Event::PreviousCursorVisbility, "Select prev. cursor visibility mode", "" },
{ Event::NextCursorVisbility, "Select next cursor visibility mode" ,"" }, { Event::NextCursorVisbility, "Select next cursor visibility mode", "" },
{ Event::ToggleGrabMouse, "Toggle grab mouse", "" }, { Event::ToggleGrabMouse, "Toggle grab mouse", "" },
{ Event::PreviousLeftPort, "Select previous left controller", "" }, { Event::PreviousLeftPort, "Select previous left controller", "" },
{ Event::NextLeftPort, "Select next left controller", "" }, { Event::NextLeftPort, "Select next left controller", "" },
@ -3363,35 +3363,35 @@ const Event::EventSet EventHandler::ConsoleEvents = {
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const Event::EventSet EventHandler::JoystickEvents = { const Event::EventSet EventHandler::JoystickEvents = {
Event::JoystickZeroUp, Event::JoystickZeroDown, Event::JoystickZeroLeft, Event::JoystickZeroRight, Event::JoystickLeftUp, Event::JoystickLeftDown, Event::JoystickLeftLeft, Event::JoystickLeftRight,
Event::JoystickZeroFire, Event::JoystickZeroFire5, Event::JoystickZeroFire9, Event::JoystickLeftFire, Event::JoystickLeftFire5, Event::JoystickLeftFire9,
Event::JoystickOneUp, Event::JoystickOneDown, Event::JoystickOneLeft, Event::JoystickOneRight, Event::JoystickRightUp, Event::JoystickRightDown, Event::JoystickRightLeft, Event::JoystickRightRight,
Event::JoystickOneFire, Event::JoystickOneFire5, Event::JoystickOneFire9, Event::JoystickRightFire, Event::JoystickRightFire5, Event::JoystickRightFire9,
Event::JoystickTwoUp, Event::JoystickTwoDown, Event::JoystickTwoLeft, Event::JoystickTwoRight, Event::QTJoystickThreeUp, Event::QTJoystickThreeDown, Event::QTJoystickThreeLeft, Event::QTJoystickThreeRight,
Event::JoystickTwoFire, Event::QTJoystickThreeFire,
Event::JoystickThreeUp, Event::JoystickThreeDown, Event::JoystickThreeLeft, Event::JoystickThreeRight, Event::QTJoystickFourUp, Event::QTJoystickFourDown, Event::QTJoystickFourLeft, Event::QTJoystickFourRight,
Event::JoystickThreeFire, Event::QTJoystickFourFire,
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const Event::EventSet EventHandler::PaddlesEvents = { const Event::EventSet EventHandler::PaddlesEvents = {
Event::PaddleZeroDecrease, Event::PaddleZeroIncrease, Event::PaddleZeroAnalog, Event::PaddleZeroFire, Event::PaddleLeftADecrease, Event::PaddleLeftAIncrease, Event::PaddleLeftAAnalog, Event::PaddleLeftAFire,
Event::PaddleOneDecrease, Event::PaddleOneIncrease, Event::PaddleOneAnalog, Event::PaddleOneFire, Event::PaddleLeftBDecrease, Event::PaddleLeftBIncrease, Event::PaddleLeftBAnalog, Event::PaddleLeftBFire,
Event::PaddleTwoDecrease, Event::PaddleTwoIncrease, Event::PaddleTwoAnalog, Event::PaddleTwoFire, Event::PaddleRightADecrease, Event::PaddleRightAIncrease, Event::PaddleRightAAnalog, Event::PaddleRightAFire,
Event::PaddleThreeDecrease, Event::PaddleThreeIncrease, Event::PaddleThreeAnalog, Event::PaddleThreeFire, Event::PaddleRightBDecrease, Event::PaddleRightBIncrease, Event::PaddleRightBAnalog, Event::PaddleRightBFire,
Event::PaddleFourFire, Event::PaddleFiveFire,Event::PaddleSixFire,Event::PaddleSevenFire, Event::QTPaddle3AFire, Event::QTPaddle3BFire,Event::QTPaddle4AFire,Event::QTPaddle4BFire,
}; };
const Event::EventSet EventHandler::KeyboardEvents = { const Event::EventSet EventHandler::KeyboardEvents = {
Event::KeyboardZero1, Event::KeyboardZero2, Event::KeyboardZero3, Event::LeftKeyboard1, Event::LeftKeyboard2, Event::LeftKeyboard3,
Event::KeyboardZero4, Event::KeyboardZero5, Event::KeyboardZero6, Event::LeftKeyboard4, Event::LeftKeyboard5, Event::LeftKeyboard6,
Event::KeyboardZero7, Event::KeyboardZero8, Event::KeyboardZero9, Event::LeftKeyboard7, Event::LeftKeyboard8, Event::LeftKeyboard9,
Event::KeyboardZeroStar, Event::KeyboardZero0, Event::KeyboardZeroPound, Event::LeftKeyboardStar, Event::LeftKeyboard0, Event::LeftKeyboardPound,
Event::KeyboardOne1, Event::KeyboardOne2, Event::KeyboardOne3, Event::RightKeyboard1, Event::RightKeyboard2, Event::RightKeyboard3,
Event::KeyboardOne4, Event::KeyboardOne5, Event::KeyboardOne6, Event::RightKeyboard4, Event::RightKeyboard5, Event::RightKeyboard6,
Event::KeyboardOne7, Event::KeyboardOne8, Event::KeyboardOne9, Event::RightKeyboard7, Event::RightKeyboard8, Event::RightKeyboard9,
Event::KeyboardOneStar, Event::KeyboardOne0, Event::KeyboardOnePound, Event::RightKeyboardStar, Event::RightKeyboard0, Event::RightKeyboardPound,
}; };
const Event::EventSet EventHandler::DevicesEvents = { const Event::EventSet EventHandler::DevicesEvents = {

View File

@ -22,9 +22,9 @@ Genesis::Genesis(Jack jack, const Event& event, const System& system)
: Joystick(jack, event, system, Controller::Type::Genesis) : Joystick(jack, event, system, Controller::Type::Genesis)
{ {
if(myJack == Jack::Left) if(myJack == Jack::Left)
myButtonCEvent = Event::JoystickZeroFire5; myButtonCEvent = Event::JoystickLeftFire5;
else else
myButtonCEvent = Event::JoystickOneFire5; myButtonCEvent = Event::JoystickRightFire5;
setPin(AnalogPin::Five, AnalogReadout::connectToVcc()); setPin(AnalogPin::Five, AnalogReadout::connectToVcc());
} }

View File

@ -32,38 +32,38 @@ Joystick::Joystick(Jack jack, const Event& event, const System& system,
{ {
if(!altmap) if(!altmap)
{ {
myUpEvent = Event::JoystickZeroUp; myUpEvent = Event::JoystickLeftUp;
myDownEvent = Event::JoystickZeroDown; myDownEvent = Event::JoystickLeftDown;
myLeftEvent = Event::JoystickZeroLeft; myLeftEvent = Event::JoystickLeftLeft;
myRightEvent = Event::JoystickZeroRight; myRightEvent = Event::JoystickLeftRight;
myFireEvent = Event::JoystickZeroFire; myFireEvent = Event::JoystickLeftFire;
} }
else else
{ {
myUpEvent = Event::JoystickTwoUp; myUpEvent = Event::QTJoystickThreeUp;
myDownEvent = Event::JoystickTwoDown; myDownEvent = Event::QTJoystickThreeDown;
myLeftEvent = Event::JoystickTwoLeft; myLeftEvent = Event::QTJoystickThreeLeft;
myRightEvent = Event::JoystickTwoRight; myRightEvent = Event::QTJoystickThreeRight;
myFireEvent = Event::JoystickTwoFire; myFireEvent = Event::QTJoystickThreeFire;
} }
} }
else else
{ {
if(!altmap) if(!altmap)
{ {
myUpEvent = Event::JoystickOneUp; myUpEvent = Event::JoystickRightUp;
myDownEvent = Event::JoystickOneDown; myDownEvent = Event::JoystickRightDown;
myLeftEvent = Event::JoystickOneLeft; myLeftEvent = Event::JoystickRightLeft;
myRightEvent = Event::JoystickOneRight; myRightEvent = Event::JoystickRightRight;
myFireEvent = Event::JoystickOneFire; myFireEvent = Event::JoystickRightFire;
} }
else else
{ {
myUpEvent = Event::JoystickThreeUp; myUpEvent = Event::QTJoystickFourUp;
myDownEvent = Event::JoystickThreeDown; myDownEvent = Event::QTJoystickFourDown;
myLeftEvent = Event::JoystickThreeLeft; myLeftEvent = Event::QTJoystickFourLeft;
myRightEvent = Event::JoystickThreeRight; myRightEvent = Event::QTJoystickFourRight;
myFireEvent = Event::JoystickThreeFire; myFireEvent = Event::QTJoystickFourFire;
} }
} }
} }

View File

@ -24,33 +24,33 @@ Keyboard::Keyboard(Jack jack, const Event& event, const System& system)
{ {
if(myJack == Jack::Left) if(myJack == Jack::Left)
{ {
myOneEvent = Event::KeyboardZero1; myOneEvent = Event::LeftKeyboard1;
myTwoEvent = Event::KeyboardZero2; myTwoEvent = Event::LeftKeyboard2;
myThreeEvent = Event::KeyboardZero3; myThreeEvent = Event::LeftKeyboard3;
myFourEvent = Event::KeyboardZero4; myFourEvent = Event::LeftKeyboard4;
myFiveEvent = Event::KeyboardZero5; myFiveEvent = Event::LeftKeyboard5;
mySixEvent = Event::KeyboardZero6; mySixEvent = Event::LeftKeyboard6;
mySevenEvent = Event::KeyboardZero7; mySevenEvent = Event::LeftKeyboard7;
myEightEvent = Event::KeyboardZero8; myEightEvent = Event::LeftKeyboard8;
myNineEvent = Event::KeyboardZero9; myNineEvent = Event::LeftKeyboard9;
myStarEvent = Event::KeyboardZeroStar; myStarEvent = Event::LeftKeyboardStar;
myZeroEvent = Event::KeyboardZero0; myZeroEvent = Event::LeftKeyboard0;
myPoundEvent = Event::KeyboardZeroPound; myPoundEvent = Event::LeftKeyboardPound;
} }
else else
{ {
myOneEvent = Event::KeyboardOne1; myOneEvent = Event::RightKeyboard1;
myTwoEvent = Event::KeyboardOne2; myTwoEvent = Event::RightKeyboard2;
myThreeEvent = Event::KeyboardOne3; myThreeEvent = Event::RightKeyboard3;
myFourEvent = Event::KeyboardOne4; myFourEvent = Event::RightKeyboard4;
myFiveEvent = Event::KeyboardOne5; myFiveEvent = Event::RightKeyboard5;
mySixEvent = Event::KeyboardOne6; mySixEvent = Event::RightKeyboard6;
mySevenEvent = Event::KeyboardOne7; mySevenEvent = Event::RightKeyboard7;
myEightEvent = Event::KeyboardOne8; myEightEvent = Event::RightKeyboard8;
myNineEvent = Event::KeyboardOne9; myNineEvent = Event::RightKeyboard9;
myStarEvent = Event::KeyboardOneStar; myStarEvent = Event::RightKeyboardStar;
myZeroEvent = Event::KeyboardOne0; myZeroEvent = Event::RightKeyboard0;
myPoundEvent = Event::KeyboardOnePound; myPoundEvent = Event::RightKeyboardPound;
} }
} }

View File

@ -52,7 +52,7 @@ void KidVid::update()
myTape = 0; // rewind Kid Vid tape myTape = 0; // rewind Kid Vid tape
closeSampleFile(); closeSampleFile();
} }
if(myEvent.get(Event::KeyboardOne1)) if(myEvent.get(Event::RightKeyboard1))
{ {
myTape = 2; myTape = 2;
myIdx = myGame == KVBBEARS ? KVBLOCKBITS : 0; myIdx = myGame == KVBBEARS ? KVBLOCKBITS : 0;
@ -61,7 +61,7 @@ void KidVid::update()
openSampleFile(); openSampleFile();
//cerr << "myTape = " << myTape << endl; //cerr << "myTape = " << myTape << endl;
} }
else if(myEvent.get(Event::KeyboardOne2)) else if(myEvent.get(Event::RightKeyboard2))
{ {
myTape = 3; myTape = 3;
myIdx = myGame == KVBBEARS ? KVBLOCKBITS : 0; myIdx = myGame == KVBBEARS ? KVBLOCKBITS : 0;
@ -70,7 +70,7 @@ void KidVid::update()
openSampleFile(); openSampleFile();
//cerr << "myTape = " << myTape << endl; //cerr << "myTape = " << myTape << endl;
} }
else if(myEvent.get(Event::KeyboardOne3)) else if(myEvent.get(Event::RightKeyboard3))
{ {
if(myGame == KVBBEARS) /* Berenstain Bears ? */ if(myGame == KVBBEARS) /* Berenstain Bears ? */
{ {

View File

@ -116,7 +116,7 @@ bool Lightgun::read(DigitalPin pin)
void Lightgun::update() void Lightgun::update()
{ {
// Digital events (from keyboard or joystick hats & buttons) // Digital events (from keyboard or joystick hats & buttons)
bool firePressed = myEvent.get(Event::JoystickZeroFire) != 0; bool firePressed = myEvent.get(Event::JoystickLeftFire) != 0;
// We allow left and right mouse buttons for fire button // We allow left and right mouse buttons for fire button
firePressed = firePressed firePressed = firePressed

View File

@ -49,65 +49,65 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system,
{ {
if(!altmap) if(!altmap)
{ {
// First paddle is 0, second is 1 // First paddle is left A, second is left B
myP0AxisValue = Event::PaddleZeroAnalog; myAAxisValue = Event::PaddleLeftAAnalog;
myP1AxisValue = Event::PaddleOneAnalog; myBAxisValue = Event::PaddleLeftBAnalog;
myP0FireEvent = Event::PaddleZeroFire; myLeftAFireEvent = Event::PaddleLeftAFire;
myP1FireEvent = Event::PaddleOneFire; myLeftBFireEvent = Event::PaddleLeftBFire;
// These can be affected by changes in axis orientation // These can be affected by changes in axis orientation
myP0DecEvent = Event::PaddleZeroDecrease; myLeftADecEvent = Event::PaddleLeftADecrease;
myP0IncEvent = Event::PaddleZeroIncrease; myLeftAIncEvent = Event::PaddleLeftAIncrease;
myP1DecEvent = Event::PaddleOneDecrease; myLeftBDecEvent = Event::PaddleLeftBDecrease;
myP1IncEvent = Event::PaddleOneIncrease; myLeftBIncEvent = Event::PaddleLeftBIncrease;
} }
else else
{ {
// First paddle is 4, second is 5 (fire buttons only) // First paddle is QT 3A, second is QT 3B (fire buttons only)
myP0FireEvent = Event::PaddleFourFire; myLeftAFireEvent = Event::QTPaddle3AFire;
myP1FireEvent = Event::PaddleFiveFire; myLeftBFireEvent = Event::QTPaddle3BFire;
myP0AxisValue = myP1AxisValue = myAAxisValue = myBAxisValue =
myP0DecEvent = myP0IncEvent = myLeftADecEvent = myLeftAIncEvent =
myP1DecEvent = myP1IncEvent = Event::NoType; myLeftBDecEvent = myLeftBIncEvent = Event::NoType;
} }
} }
else // Jack is right port else // Jack is right port
{ {
if(!altmap) if(!altmap)
{ {
// First paddle is 2, second is 3 // First paddle is right A, second is right B
myP0AxisValue = Event::PaddleTwoAnalog; myAAxisValue = Event::PaddleRightAAnalog;
myP1AxisValue = Event::PaddleThreeAnalog; myBAxisValue = Event::PaddleRightBAnalog;
myP0FireEvent = Event::PaddleTwoFire; myLeftAFireEvent = Event::PaddleRightAFire;
myP1FireEvent = Event::PaddleThreeFire; myLeftBFireEvent = Event::PaddleRightBFire;
// These can be affected by changes in axis orientation // These can be affected by changes in axis orientation
myP0DecEvent = Event::PaddleTwoDecrease; myLeftADecEvent = Event::PaddleRightADecrease;
myP0IncEvent = Event::PaddleTwoIncrease; myLeftAIncEvent = Event::PaddleRightAIncrease;
myP1DecEvent = Event::PaddleThreeDecrease; myLeftBDecEvent = Event::PaddleRightBDecrease;
myP1IncEvent = Event::PaddleThreeIncrease; myLeftBIncEvent = Event::PaddleRightBIncrease;
} }
else else
{ {
// First paddle is 6, second is 7 (fire buttons only) // First paddle is QT 4A, second is QT 4B (fire buttons only)
myP0FireEvent = Event::PaddleSixFire; myLeftAFireEvent = Event::QTPaddle4AFire;
myP1FireEvent = Event::PaddleSevenFire; myLeftBFireEvent = Event::QTPaddle4BFire;
myP0AxisValue = myP1AxisValue = myAAxisValue = myBAxisValue =
myP0DecEvent = myP0IncEvent = myLeftADecEvent = myLeftAIncEvent =
myP1DecEvent = myP1IncEvent = Event::NoType; myLeftBDecEvent = myLeftBIncEvent = Event::NoType;
} }
} }
// Some games swap the paddles // Some games swap the paddles
if(swappaddle) if(swappaddle)
{ {
// First paddle is 1|3, second is 0|2 // First paddle is right A|B, second is left A|B
swapEvents(myP0AxisValue, myP1AxisValue); swapEvents(myAAxisValue, myBAxisValue);
swapEvents(myP0FireEvent, myP1FireEvent); swapEvents(myLeftAFireEvent, myLeftBFireEvent);
swapEvents(myP0DecEvent, myP1DecEvent); swapEvents(myLeftADecEvent, myLeftBDecEvent);
swapEvents(myP0IncEvent, myP1IncEvent); swapEvents(myLeftAIncEvent, myLeftBIncEvent);
} }
// Direction of movement can be swapped // Direction of movement can be swapped
@ -115,8 +115,8 @@ Paddles::Paddles(Jack jack, const Event& event, const System& system,
// result in either increasing or decreasing paddle movement // result in either increasing or decreasing paddle movement
if(swapdir) if(swapdir)
{ {
swapEvents(myP0DecEvent, myP0IncEvent); swapEvents(myLeftADecEvent, myLeftAIncEvent);
swapEvents(myP1DecEvent, myP1IncEvent); swapEvents(myLeftBDecEvent, myLeftBIncEvent);
} }
// The following are independent of whether or not the port // The following are independent of whether or not the port
@ -159,8 +159,8 @@ void Paddles::update()
setPin(DigitalPin::Four, true); setPin(DigitalPin::Four, true);
// Digital events (from keyboard or joystick hats & buttons) // Digital events (from keyboard or joystick hats & buttons)
bool firePressedP0 = myEvent.get(myP0FireEvent) != 0; bool firePressedA = myEvent.get(myLeftAFireEvent) != 0;
bool firePressedP1 = myEvent.get(myP1FireEvent) != 0; bool firePressedB = myEvent.get(myLeftBFireEvent) != 0;
// Paddle movement is a very difficult thing to accurately emulate, // Paddle movement is a very difficult thing to accurately emulate,
// since it originally came from an analog device that had very // since it originally came from an analog device that had very
@ -175,7 +175,7 @@ void Paddles::update()
if(!updateAnalogAxes()) if(!updateAnalogAxes())
{ {
updateMouse(firePressedP0, firePressedP1); updateMouse(firePressedA, firePressedB);
updateDigitalAxes(); updateDigitalAxes();
// Only change state if the charge has actually changed // Only change state if the charge has actually changed
@ -191,8 +191,8 @@ void Paddles::update()
} }
} }
setPin(DigitalPin::Four, !getAutoFireState(firePressedP0)); setPin(DigitalPin::Four, !getAutoFireState(firePressedA));
setPin(DigitalPin::Three, !getAutoFireStateP1(firePressedP1)); setPin(DigitalPin::Three, !getAutoFireStateP1(firePressedB));
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -221,8 +221,8 @@ bool Paddles::updateAnalogAxes()
const double baseFactor = bFac[DEJITTER_BASE]; const double baseFactor = bFac[DEJITTER_BASE];
const double diffFactor = dFac[DEJITTER_DIFF]; const double diffFactor = dFac[DEJITTER_DIFF];
int sa_xaxis = myEvent.get(myP0AxisValue); int sa_xaxis = myEvent.get(myAAxisValue);
int sa_yaxis = myEvent.get(myP1AxisValue); int sa_yaxis = myEvent.get(myBAxisValue);
bool sa_changed = false; bool sa_changed = false;
if(abs(myLastAxisX - sa_xaxis) > 10) if(abs(myLastAxisX - sa_xaxis) > 10)
@ -261,7 +261,7 @@ bool Paddles::updateAnalogAxes()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Paddles::updateMouse(bool& firePressedP0, bool& firePressedP1) void Paddles::updateMouse(bool& firePressedA, bool& firePressedB)
{ {
// Mouse motion events give relative movement // Mouse motion events give relative movement
// That is, they're only relevant if they're non-zero // That is, they're only relevant if they're non-zero
@ -272,11 +272,11 @@ void Paddles::updateMouse(bool& firePressedP0, bool& firePressedP1)
(myEvent.get(myAxisMouseMotion) * MOUSE_SENSITIVITY), (myEvent.get(myAxisMouseMotion) * MOUSE_SENSITIVITY),
TRIGMIN, TRIGRANGE); TRIGMIN, TRIGRANGE);
if(myMPaddleID == 0) if(myMPaddleID == 0)
firePressedP0 = firePressedP0 firePressedA = firePressedA
|| myEvent.get(Event::MouseButtonLeftValue) || myEvent.get(Event::MouseButtonLeftValue)
|| myEvent.get(Event::MouseButtonRightValue); || myEvent.get(Event::MouseButtonRightValue);
else else
firePressedP1 = firePressedP1 firePressedB = firePressedB
|| myEvent.get(Event::MouseButtonLeftValue) || myEvent.get(Event::MouseButtonLeftValue)
|| myEvent.get(Event::MouseButtonRightValue); || myEvent.get(Event::MouseButtonRightValue);
} }
@ -290,10 +290,10 @@ void Paddles::updateMouse(bool& firePressedP0, bool& firePressedP1)
(myEvent.get(Event::MouseAxisXMove) * MOUSE_SENSITIVITY), (myEvent.get(Event::MouseAxisXMove) * MOUSE_SENSITIVITY),
TRIGMIN, TRIGRANGE); TRIGMIN, TRIGRANGE);
if(myMPaddleIDX == 0) if(myMPaddleIDX == 0)
firePressedP0 = firePressedP0 firePressedA = firePressedA
|| myEvent.get(Event::MouseButtonLeftValue); || myEvent.get(Event::MouseButtonLeftValue);
else else
firePressedP1 = firePressedP1 firePressedB = firePressedB
|| myEvent.get(Event::MouseButtonLeftValue); || myEvent.get(Event::MouseButtonLeftValue);
} }
if(myMPaddleIDY > -1) if(myMPaddleIDY > -1)
@ -302,10 +302,10 @@ void Paddles::updateMouse(bool& firePressedP0, bool& firePressedP1)
(myEvent.get(Event::MouseAxisYMove) * MOUSE_SENSITIVITY), (myEvent.get(Event::MouseAxisYMove) * MOUSE_SENSITIVITY),
TRIGMIN, TRIGRANGE); TRIGMIN, TRIGRANGE);
if(myMPaddleIDY == 0) if(myMPaddleIDY == 0)
firePressedP0 = firePressedP0 firePressedA = firePressedA
|| myEvent.get(Event::MouseButtonRightValue); || myEvent.get(Event::MouseButtonRightValue);
else else
firePressedP1 = firePressedP1 firePressedB = firePressedB
|| myEvent.get(Event::MouseButtonRightValue); || myEvent.get(Event::MouseButtonRightValue);
} }
} }
@ -316,45 +316,45 @@ void Paddles::updateDigitalAxes()
{ {
// Finally, consider digital input, where movement happens // Finally, consider digital input, where movement happens
// until a digital event is released // until a digital event is released
if(myKeyRepeat0) if(myKeyRepeatA)
{ {
myPaddleRepeat0++; myPaddleRepeatA++;
if(myPaddleRepeat0 > DIGITAL_SENSITIVITY) if(myPaddleRepeatA > DIGITAL_SENSITIVITY)
myPaddleRepeat0 = DIGITAL_DISTANCE; myPaddleRepeatA = DIGITAL_DISTANCE;
} }
if(myKeyRepeat1) if(myKeyRepeatB)
{ {
myPaddleRepeat1++; myPaddleRepeatB++;
if(myPaddleRepeat1 > DIGITAL_SENSITIVITY) if(myPaddleRepeatB > DIGITAL_SENSITIVITY)
myPaddleRepeat1 = DIGITAL_DISTANCE; myPaddleRepeatB = DIGITAL_DISTANCE;
} }
myKeyRepeat0 = false; myKeyRepeatA = false;
myKeyRepeat1 = false; myKeyRepeatB = false;
if(myEvent.get(myP0DecEvent)) if(myEvent.get(myLeftADecEvent))
{ {
myKeyRepeat0 = true; myKeyRepeatA = true;
if(myCharge[myAxisDigitalZero] > myPaddleRepeat0) if(myCharge[myAxisDigitalZero] > myPaddleRepeatA)
myCharge[myAxisDigitalZero] -= myPaddleRepeat0; myCharge[myAxisDigitalZero] -= myPaddleRepeatA;
} }
if(myEvent.get(myP0IncEvent)) if(myEvent.get(myLeftAIncEvent))
{ {
myKeyRepeat0 = true; myKeyRepeatA = true;
if((myCharge[myAxisDigitalZero] + myPaddleRepeat0) < TRIGRANGE) if((myCharge[myAxisDigitalZero] + myPaddleRepeatA) < TRIGRANGE)
myCharge[myAxisDigitalZero] += myPaddleRepeat0; myCharge[myAxisDigitalZero] += myPaddleRepeatA;
} }
if(myEvent.get(myP1DecEvent)) if(myEvent.get(myLeftBDecEvent))
{ {
myKeyRepeat1 = true; myKeyRepeatB = true;
if(myCharge[myAxisDigitalOne] > myPaddleRepeat1) if(myCharge[myAxisDigitalOne] > myPaddleRepeatB)
myCharge[myAxisDigitalOne] -= myPaddleRepeat1; myCharge[myAxisDigitalOne] -= myPaddleRepeatB;
} }
if(myEvent.get(myP1IncEvent)) if(myEvent.get(myLeftBIncEvent))
{ {
myKeyRepeat1 = true; myKeyRepeatB = true;
if((myCharge[myAxisDigitalOne] + myPaddleRepeat1) < TRIGRANGE) if((myCharge[myAxisDigitalOne] + myPaddleRepeatB) < TRIGRANGE)
myCharge[myAxisDigitalOne] += myPaddleRepeat1; myCharge[myAxisDigitalOne] += myPaddleRepeatB;
} }
} }

View File

@ -174,18 +174,18 @@ class Paddles : public Controller
// Pre-compute the events we care about based on given port // Pre-compute the events we care about based on given port
// This will eliminate test for left or right port in update() // This will eliminate test for left or right port in update()
Event::Type myP0AxisValue, myP1AxisValue, Event::Type myAAxisValue, myBAxisValue,
myP0DecEvent, myP0IncEvent, myLeftADecEvent, myLeftAIncEvent,
myP1DecEvent, myP1IncEvent, myLeftBDecEvent, myLeftBIncEvent,
myP0FireEvent, myP1FireEvent, myLeftAFireEvent, myLeftBFireEvent,
myAxisMouseMotion; myAxisMouseMotion;
// The following are used for the various mouse-axis modes // The following are used for the various mouse-axis modes
int myMPaddleID{-1}; // paddle to emulate in 'automatic' mode int myMPaddleID{-1}; // paddle to emulate in 'automatic' mode
int myMPaddleIDX{-1}, myMPaddleIDY{-1}; // paddles to emulate in 'specific axis' mode int myMPaddleIDX{-1}, myMPaddleIDY{-1}; // paddles to emulate in 'specific axis' mode
bool myKeyRepeat0{false}, myKeyRepeat1{false}; bool myKeyRepeatA{false}, myKeyRepeatB{false};
int myPaddleRepeat0{0}, myPaddleRepeat1{0}; int myPaddleRepeatA{0}, myPaddleRepeatB{0};
std::array<int, 2> myCharge{TRIGRANGE/2, TRIGRANGE/2}, myLastCharge{0}; std::array<int, 2> myCharge{TRIGRANGE/2, TRIGRANGE/2}, myLastCharge{0};
int myLastAxisX{0}, myLastAxisY{0}; int myLastAxisX{0}, myLastAxisY{0};
int myAxisDigitalZero{0}, myAxisDigitalOne{0}; int myAxisDigitalZero{0}, myAxisDigitalOne{0};
@ -211,7 +211,7 @@ class Paddles : public Controller
/** /**
Update the entire state according to mouse events currently set. Update the entire state according to mouse events currently set.
*/ */
void updateMouse(bool& firePressedP0, bool& firePressedP1); void updateMouse(bool& firePressedA, bool& firePressedB);
/** /**
Update the axes pin state according to the keyboard events currently set. Update the axes pin state according to the keyboard events currently set.

View File

@ -90,7 +90,7 @@ void PointingDevice::update()
myTrackBallDown, myTrackBallLinesV, myScanCountV, myFirstScanOffsetV); myTrackBallDown, myTrackBallLinesV, myScanCountV, myFirstScanOffsetV);
// We allow left and right mouse buttons for fire button // We allow left and right mouse buttons for fire button
setPin(DigitalPin::Six, !getAutoFireState(myEvent.get(Event::JoystickZeroFire) || setPin(DigitalPin::Six, !getAutoFireState(myEvent.get(Event::JoystickLeftFire) ||
myEvent.get(Event::MouseButtonLeftValue) || myEvent.get(Event::MouseButtonRightValue))); myEvent.get(Event::MouseButtonLeftValue) || myEvent.get(Event::MouseButtonRightValue)));
} }

View File

@ -367,17 +367,17 @@ void GameInfoDialog::addControllersTab()
wid.push_back(myMouseControl); wid.push_back(myMouseControl);
// Mouse controller specific axis // Mouse controller specific axis
pwidth = _font.getStringWidth("MindLink 0"); pwidth = _font.getStringWidth("Right MindLink");
ctrls.clear(); ctrls.clear();
VarList::push_back(ctrls, "None", static_cast<uInt32>(MouseControl::Type::NoControl)); VarList::push_back(ctrls, "None", static_cast<uInt32>(MouseControl::Type::NoControl));
VarList::push_back(ctrls, "Paddle 0", static_cast<uInt32>(MouseControl::Type::Paddle0)); VarList::push_back(ctrls, "Left Paddle A", static_cast<uInt32>(MouseControl::Type::PaddleLeftA));
VarList::push_back(ctrls, "Paddle 1", static_cast<uInt32>(MouseControl::Type::Paddle1)); VarList::push_back(ctrls, "Left Paddle B", static_cast<uInt32>(MouseControl::Type::PaddleLeftB));
VarList::push_back(ctrls, "Paddle 2", static_cast<uInt32>(MouseControl::Type::Paddle2)); VarList::push_back(ctrls, "Right Paddle A", static_cast<uInt32>(MouseControl::Type::PaddleRightA));
VarList::push_back(ctrls, "Paddle 3", static_cast<uInt32>(MouseControl::Type::Paddle3)); VarList::push_back(ctrls, "Right Paddle B", static_cast<uInt32>(MouseControl::Type::PaddleRightB));
VarList::push_back(ctrls, "Driving 0", static_cast<uInt32>(MouseControl::Type::Driving0)); VarList::push_back(ctrls, "Left Driving", static_cast<uInt32>(MouseControl::Type::DrivingLeft));
VarList::push_back(ctrls, "Driving 1", static_cast<uInt32>(MouseControl::Type::Driving1)); VarList::push_back(ctrls, "Right Driving", static_cast<uInt32>(MouseControl::Type::DrivingRight));
VarList::push_back(ctrls, "MindLink 0", static_cast<uInt32>(MouseControl::Type::MindLink0)); VarList::push_back(ctrls, "Left MindLink", static_cast<uInt32>(MouseControl::Type::MindLinkLeft));
VarList::push_back(ctrls, "MindLink 1", static_cast<uInt32>(MouseControl::Type::MindLink1)); VarList::push_back(ctrls, "Right MindLink", static_cast<uInt32>(MouseControl::Type::MindLinkRight));
xpos += CheckboxWidget::prefixSize(_font); xpos += CheckboxWidget::prefixSize(_font);
ypos += lineHeight + VGAP; ypos += lineHeight + VGAP;

View File

@ -72,7 +72,7 @@ QuadTariDialog::QuadTariDialog(GuiObject* boss, const GUI::Font& font, int max_w
ypos += lineHeight + VGAP * 2; ypos += lineHeight + VGAP * 2;
myLeft2Port = new PopUpWidget(this, font, xpos, ypos, myLeft2Port = new PopUpWidget(this, font, xpos, ypos,
pwidth, lineHeight, ctrls, "P2 "); pwidth, lineHeight, ctrls, "P3 ");
wid.push_back(myLeft2Port); wid.push_back(myLeft2Port);
xpos = _w - HBORDER - myLeft1Port->getWidth(); // aligned right xpos = _w - HBORDER - myLeft1Port->getWidth(); // aligned right
@ -81,7 +81,7 @@ QuadTariDialog::QuadTariDialog(GuiObject* boss, const GUI::Font& font, int max_w
ypos += lineHeight + VGAP * 2; ypos += lineHeight + VGAP * 2;
myRight1Port = new PopUpWidget(this, font, xpos, ypos, myRight1Port = new PopUpWidget(this, font, xpos, ypos,
pwidth, lineHeight, ctrls, "P3 "); pwidth, lineHeight, ctrls, "P2 ");
wid.push_back(myRight1Port); wid.push_back(myRight1Port);
ypos += lineHeight + VGAP * 2; ypos += lineHeight + VGAP * 2;