MickGyver / DaemonBite-Arcade-Encoder

An arcade controller project for the MiSTer FPGA project and any other device accepting USB HID joysticks. Up to 12 buttons are supported. Can also be used to create NeoGeo/Atari/Commodore/Amiga controller to USB adapters.
GNU General Public License v3.0
280 stars 48 forks source link

Debounce (?) issues in Steam #21

Closed davewongillies closed 2 years ago

davewongillies commented 2 years ago

I'm not entirely sure what's going on, but the Daemonbite will continually trigger down after pressing up on the controller while in Steam's controller configuration, and also when using it in the Steam UI (on both Linux & SteamOS which is just Linux anyhow) & any games launched from Steam. Using the joystick outside of Steam is fine, so there's obviously something funky about the controller layer with Steam.

I found this thread on reddit which claims that enabling DEBOUNCE fixes this, but I've had no success. I've also tried changing the value for DEBOUNCE_TIME up to 50 too but its made no difference so far.

davewongillies commented 2 years ago

I just tried enabling PS3 mode and direction buttons work, but now R2 seems to be triggering repeated presses

davewongillies commented 2 years ago

I ended up with this franken setup https://github.com/davewongillies/DaemonBite-Arcade-Encoder/commit/427979cf7c62e4085b15cfa27bcb8c0e94508c20 where I have PS3 joystick mode, but keep the normal B11/B12 buttons. I also had to bump DEBOUNCE_TIME up to 100 (I tried 50 to no avail, but just jumped to 100 so perhaps something in between works).

--- a/DaemonBiteArcadeEncoder/DaemonBiteArcadeEncoder.ino
+++ b/DaemonBiteArcadeEncoder/DaemonBiteArcadeEncoder.ino
@@ -23,11 +23,12 @@

 #include "Gamepad.h"

-//#define PS3                 // PS3 (ScpToolkit) compatibility (Comment out for joystick=X/Y-Axis and B11/B12 as normal buttons)
+#define PS3                 // PS3 joystick (ScpToolkit) compatibility (Comment out for joystick=X/Y-Axis)
+//#define PS3_BUTTONS       // PS3 button (ScpToolkit) compatibility (B11/B12 as normal buttons)
 //#define NEOGEO

-#define DEBOUNCE 0          // 1=Diddly-squat-Delay-Debouncing™ activated, 0=Debounce deactivated
-#define DEBOUNCE_TIME 10    // Debounce time in milliseconds
+#define DEBOUNCE 1          // 1=Diddly-squat-Delay-Debouncing™ activated, 0=Debounce deactivated
+#define DEBOUNCE_TIME 100   // Debounce time in milliseconds
 //#define DEBUG             // Enables debugging (sends debug data to usb serial)

 #ifdef NEOGEO
@@ -167,7 +168,7 @@ void loop()
     // Has button inputs changed?
     if(buttons != buttonsPrev)
     {
-      #ifdef PS3
+      #ifdef PS3_BUTTONS
         Gamepad._GamepadReport.buttons = buttons & 0x3FF;
         if(buttons & 0x400) // B11
           Gamepad._GamepadReport.Z = -1;

Perhaps this may be of help to someone else facing the same issue with Steam, but I'll be closing this issue as I've moved my joystick to another project. Thanks.