From 7fb41e4752a3d106af7d2c6b63f87c7cc834e98d Mon Sep 17 00:00:00 2001 From: Thomas Jentzsch Date: Tue, 3 Mar 2020 11:27:15 +0100 Subject: [PATCH 1/2] allow remapping of fire button for trackball and light gun games --- src/emucore/Lightgun.cxx | 10 +++++++--- src/emucore/PointingDevice.cxx | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/emucore/Lightgun.cxx b/src/emucore/Lightgun.cxx index 65f44cce6..1c6c82ba7 100644 --- a/src/emucore/Lightgun.cxx +++ b/src/emucore/Lightgun.cxx @@ -115,7 +115,11 @@ bool Lightgun::read(DigitalPin pin) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Lightgun::update() { - // we allow left and right mouse buttons for fire button - setPin(DigitalPin::One, myEvent.get(Event::MouseButtonLeftValue) - || myEvent.get(Event::MouseButtonRightValue)); + // Digital events (from keyboard or joystick hats & buttons) + setPin(DigitalPin::One, myEvent.get(Event::JoystickZeroFire) == 0); + + // We allow left and right mouse buttons for fire button + if(myEvent.get(Event::MouseButtonLeftValue) || + myEvent.get(Event::MouseButtonRightValue)) + setPin(DigitalPin::One, false); } diff --git a/src/emucore/PointingDevice.cxx b/src/emucore/PointingDevice.cxx index 0ee561c31..1a2c781b4 100644 --- a/src/emucore/PointingDevice.cxx +++ b/src/emucore/PointingDevice.cxx @@ -86,9 +86,13 @@ void PointingDevice::update() updateDirection(-myEvent.get(Event::MouseAxisYMove), myVCounterRemainder, myTrackBallDown, myTrackBallLinesV, myScanCountV, myFirstScanOffsetV); - // Get mouse button state - setPin(DigitalPin::Six, (myEvent.get(Event::MouseButtonLeftValue) == 0) && - (myEvent.get(Event::MouseButtonRightValue) == 0)); + // Digital events (from keyboard or joystick hats & buttons) + setPin(DigitalPin::Six, myEvent.get(Event::JoystickZeroFire) == 0); + + // We allow left and right mouse buttons for fire button + if(myEvent.get(Event::MouseButtonLeftValue) || + myEvent.get(Event::MouseButtonRightValue)) + setPin(DigitalPin::Six, false); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 15a1c8c8b17422e04b77332d5794ab63319c0d9f Mon Sep 17 00:00:00 2001 From: thrust26 Date: Tue, 3 Mar 2020 19:54:45 +0100 Subject: [PATCH 2/2] update doc for Trackball and Light Gun fire button --- docs/index.html | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/index.html b/docs/index.html index 47144c162..6d54cb181 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1028,6 +1028,50 @@ +

Trackball Controller (uses mouse, left port only)

+ + + + + + + + +
Left Trackball
+ + + + + + + + + +
FunctionKey
Fire ButtonSame as 'Joy0 Fire'
+
+ +

Light Gun Controller (uses mouse, left port only)

+ + + + + + + + +
Left Light Gun
+ + + + + + + + + +
FunctionKey
Fire ButtonSame as 'Joy0 Fire'
+
+

Paddle Controller digital emulation (can be remapped)