initial commit for QuadTari support (see #693)

This commit is contained in:
Thomas Jentzsch 2020-08-31 10:33:37 +02:00
parent 2bc8e4f669
commit bf4b63cb1c
10 changed files with 107 additions and 12 deletions

View File

@ -658,6 +658,7 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultJoyst
{Event::JoystickZeroFire9, KBDK_5},
{Event::JoystickZeroFire9, KBDK_RCTRL},
{Event::JoystickZeroFire9, KBDK_KP_3},
{Event::JoystickOneUp, KBDK_Y},
{Event::JoystickOneDown, KBDK_H},
{Event::JoystickOneLeft, KBDK_G},
@ -665,6 +666,22 @@ PhysicalKeyboardHandler::EventMappingArray PhysicalKeyboardHandler::DefaultJoyst
{Event::JoystickOneFire, KBDK_F},
{Event::JoystickOneFire5, KBDK_6},
{Event::JoystickOneFire9, KBDK_7},
{Event::JoystickTwoUp, KBDK_UP, KBDM_SHIFT},
{Event::JoystickTwoDown, KBDK_DOWN, KBDM_SHIFT},
{Event::JoystickTwoLeft, KBDK_LEFT, KBDM_SHIFT},
{Event::JoystickTwoRight, KBDK_RIGHT, KBDM_SHIFT},
{Event::JoystickTwoUp, KBDK_KP_8, KBDM_SHIFT},
{Event::JoystickTwoDown, KBDK_KP_2, KBDM_SHIFT},
{Event::JoystickTwoLeft, KBDK_KP_4, KBDM_SHIFT},
{Event::JoystickTwoRight, KBDK_KP_6, KBDM_SHIFT},
{Event::JoystickTwoFire, KBDK_SPACE, KBDM_SHIFT},
{Event::JoystickThreeUp, KBDK_Y, KBDM_SHIFT},
{Event::JoystickThreeDown, KBDK_H, KBDM_SHIFT},
{Event::JoystickThreeLeft, KBDK_G, KBDM_SHIFT},
{Event::JoystickThreeRight, KBDK_J, KBDM_SHIFT},
{Event::JoystickThreeFire, KBDK_F, KBDM_SHIFT},
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -35,6 +35,11 @@
#include "Genesis.hxx"
#include "MindLink.hxx"
#include "CompuMate.hxx"
#include "AmigaMouse.hxx"
#include "AtariMouse.hxx"
#include "TrakBall.hxx"
#include "Lightgun.hxx"
#include "QuadTari.hxx"
#include "M6502.hxx"
#include "M6532.hxx"
#include "TIA.hxx"
@ -46,10 +51,6 @@
#include "Sound.hxx"
#include "Switches.hxx"
#include "System.hxx"
#include "AmigaMouse.hxx"
#include "AtariMouse.hxx"
#include "TrakBall.hxx"
#include "Lightgun.hxx"
#include "FrameBuffer.hxx"
#include "TIASurface.hxx"
#include "OSystem.hxx"
@ -927,6 +928,10 @@ unique_ptr<Controller> Console::getControllerPort(const Controller::Type type,
controller = make_unique<Lightgun>(port, myEvent, *mySystem, romMd5, myOSystem.frameBuffer());
break;
case Controller::Type::QuadTari:
controller = make_unique<QuadTari>(port, myEvent, *mySystem);
break;
default:
// What else can we do?
// always create because it may have been changed by user dialog

View File

@ -125,7 +125,7 @@ string Controller::getPropName(const Type type)
"AMIGAMOUSE", "ATARIMOUSE", "ATARIVOX", "BOOSTERGRIP", "COMPUMATE",
"DRIVING", "GENESIS", "JOYSTICK", "KEYBOARD", "KIDVID", "MINDLINK",
"PADDLES", "PADDLES_IAXIS", "PADDLES_IAXDR", "SAVEKEY", "TRAKBALL",
"LIGHTGUN"
"LIGHTGUN", "QUADTARI"
};
return PROP_NAMES[int(type)];

View File

@ -94,7 +94,7 @@ class Controller : public Serializable
AmigaMouse, AtariMouse, AtariVox, BoosterGrip, CompuMate,
Driving, Genesis, Joystick, Keyboard, KidVid, MindLink,
Paddles, PaddlesIAxis, PaddlesIAxDr, SaveKey, TrakBall,
Lightgun,
Lightgun, QuadTari,
LastType
};
@ -178,12 +178,12 @@ class Controller : public Serializable
Update the entire digital and analog pin state according to the
events currently set.
*/
virtual void update() = 0;
virtual void update() { };
/**
Returns the name of this controller.
*/
virtual string name() const = 0;
virtual string name() const { return ""; }
/**
Answers whether the controller is intrinsically an analog controller.

View File

@ -123,12 +123,17 @@ class Event
ToggleFrameStats, ToggleSAPortOrder, ExitGame,
SettingDecrease, SettingIncrease, PreviousSetting, NextSetting,
ToggleAdaptRefresh, PreviousMultiCartRom,
// add new events from here to avoid that user remapped events get overwritten
// add new (after Version 4) events from here to avoid that user remapped events get overwritten
PreviousSettingGroup, NextSettingGroup,
TogglePlayBackMode,
DecreaseAutoFire, IncreaseAutoFire,
DecreaseSpeed, IncreaseSpeed,
JoystickTwoUp, JoystickTwoDown, JoystickTwoLeft, JoystickTwoRight,
JoystickTwoFire,
JoystickThreeUp, JoystickThreeDown, JoystickThreeLeft, JoystickThreeRight,
JoystickThreeFire,
LastType
};
@ -217,11 +222,15 @@ class Event
static const Event::EventSet LeftJoystickEvents = {
Event::JoystickZeroUp, Event::JoystickZeroDown, Event::JoystickZeroLeft, Event::JoystickZeroRight,
Event::JoystickZeroFire, Event::JoystickZeroFire5, Event::JoystickZeroFire9,
Event::JoystickTwoUp, Event::JoystickTwoDown, Event::JoystickTwoLeft, Event::JoystickTwoRight,
Event::JoystickTwoFire
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
static const Event::EventSet RightJoystickEvents = {
Event::JoystickOneUp, Event::JoystickOneDown, Event::JoystickOneLeft, Event::JoystickOneRight,
Event::JoystickOneFire, Event::JoystickOneFire5, Event::JoystickOneFire9
Event::JoystickOneFire, Event::JoystickOneFire5, Event::JoystickOneFire9,
Event::JoystickThreeUp, Event::JoystickThreeDown, Event::JoystickThreeLeft, Event::JoystickThreeRight,
Event::JoystickThreeFire
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -620,6 +620,46 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
myEvent.set(Event::JoystickOneLeft, 0);
break;
case Event::JoystickTwoUp:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoDown, 0);
break;
case Event::JoystickTwoDown:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoUp, 0);
break;
case Event::JoystickTwoLeft:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoRight, 0);
break;
case Event::JoystickTwoRight:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickTwoLeft, 0);
break;
case Event::JoystickThreeUp:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeDown, 0);
break;
case Event::JoystickThreeDown:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeUp, 0);
break;
case Event::JoystickThreeLeft:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeRight, 0);
break;
case Event::JoystickThreeRight:
if(!myAllowAllDirectionsFlag && pressed)
myEvent.set(Event::JoystickThreeLeft, 0);
break;
///////////////////////////////////////////////////////////////////////////
// Audio & Video events (with global hotkeys)
case Event::VolumeDecrease:
@ -2467,6 +2507,18 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
{ Event::JoystickOneFire5, "P1 Booster Top Booster Button", "" },
{ Event::JoystickOneFire9, "P1 Booster Handle Grip Trigger", "" },
{ Event::JoystickTwoUp, "P2 Joystick Up", "" },
{ Event::JoystickTwoDown, "P2 Joystick Down", "" },
{ Event::JoystickTwoLeft, "P2 Joystick Left", "" },
{ Event::JoystickTwoRight, "P2 Joystick Right", "" },
{ Event::JoystickTwoFire, "P2 Joystick Fire", "" },
{ Event::JoystickThreeUp, "P3 Joystick Up", "" },
{ Event::JoystickThreeDown, "P3 Joystick Down", "" },
{ Event::JoystickThreeLeft, "P3 Joystick Left", "" },
{ Event::JoystickThreeRight, "P3 Joystick Right", "" },
{ Event::JoystickThreeFire, "P3 Joystick Fire", "" },
{ Event::PaddleZeroAnalog, "Paddle 0 Analog", "" },
{ Event::PaddleZeroIncrease, "Paddle 0 Turn Left", "" },
{ Event::PaddleZeroDecrease, "Paddle 0 Turn Right", "" },
@ -2711,6 +2763,10 @@ const Event::EventSet EventHandler::JoystickEvents = {
Event::JoystickZeroFire, Event::JoystickZeroFire5, Event::JoystickZeroFire9,
Event::JoystickOneUp, Event::JoystickOneDown, Event::JoystickOneLeft, Event::JoystickOneRight,
Event::JoystickOneFire, Event::JoystickOneFire5, Event::JoystickOneFire9,
Event::JoystickTwoUp, Event::JoystickTwoDown, Event::JoystickTwoLeft, Event::JoystickTwoRight,
Event::JoystickTwoFire,
Event::JoystickThreeUp, Event::JoystickThreeDown, Event::JoystickThreeLeft, Event::JoystickThreeRight,
Event::JoystickThreeFire,
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -559,7 +559,7 @@ class EventHandler
#else
REFRESH_SIZE = 0,
#endif
EMUL_ACTIONLIST_SIZE = 164 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
EMUL_ACTIONLIST_SIZE = 174 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
MENU_ACTIONLIST_SIZE = 18
;

View File

@ -227,6 +227,7 @@ GameInfoDialog::GameInfoDialog(
VarList::push_back(ctrls, "KidVid", "KIDVID");
VarList::push_back(ctrls, "Lightgun", "LIGHTGUN");
VarList::push_back(ctrls, "MindLink", "MINDLINK");
VarList::push_back(ctrls, "QuadTari", "QUADTARI");
ypos = VBORDER;
pwidth = font.getStringWidth("Paddles_IAxis");
@ -771,7 +772,6 @@ void GameInfoDialog::updateControllerStates()
myPaddleXCenter->setEnabled(enablePaddles);
myPaddleYCenter->setEnabled(enablePaddles);
bool enableMouse = enablePaddles ||
BSPF::startsWithIgnoreCase(contrLeft, "Driving") ||
BSPF::startsWithIgnoreCase(contrRight, "Driving") ||

View File

@ -746,6 +746,7 @@
<ClCompile Include="..\emucore\MindLink.cxx" />
<ClCompile Include="..\emucore\PointingDevice.cxx" />
<ClCompile Include="..\emucore\ProfilingRunner.cxx" />
<ClCompile Include="..\emucore\QuadTari.cxx" />
<ClCompile Include="..\emucore\TIASurface.cxx" />
<ClCompile Include="..\emucore\tia\Audio.cxx" />
<ClCompile Include="..\emucore\tia\AudioChannel.cxx" />
@ -1775,6 +1776,7 @@
<ClInclude Include="..\emucore\MindLink.hxx" />
<ClInclude Include="..\emucore\PointingDevice.hxx" />
<ClInclude Include="..\emucore\ProfilingRunner.hxx" />
<ClInclude Include="..\emucore\QuadTari.hxx" />
<ClInclude Include="..\emucore\SerialPort.hxx" />
<ClInclude Include="..\emucore\TIASurface.hxx" />
<ClInclude Include="..\emucore\tia\Audio.hxx" />

View File

@ -1017,6 +1017,9 @@
<ClCompile Include="..\gui\WhatsNewDialog.cxx">
<Filter>Source Files\gui</Filter>
</ClCompile>
<ClCompile Include="..\emucore\QuadTari.cxx">
<Filter>Source Files\emucore</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\common\bspf.hxx">
@ -2090,6 +2093,9 @@
<ClInclude Include="..\emucore\SerialPort.hxx">
<Filter>Header Files\emucore</Filter>
</ClInclude>
<ClInclude Include="..\emucore\QuadTari.hxx">
<Filter>Header Files\emucore</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="stella.ico">