Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Joystick doesn't handle diagonal directions #127

Open
mankeli opened this issue Feb 25, 2023 · 6 comments
Open

Joystick doesn't handle diagonal directions #127

mankeli opened this issue Feb 25, 2023 · 6 comments

Comments

@mankeli
Copy link

mankeli commented Feb 25, 2023

It seems that the joystick support doesn't do diagonal directions at all when using gamepad as input. Using gravutil.exe (from gravis analog pro) it can be observed that even if gamepad up/left directions (for example) are pressed, the emulated PC only sees one axis being moved.

@jeffkrull
Copy link

I've noticed that diagonal inputs seem to work correctly when using X-input controllers. Any other controller protocol doesn't register diagonals. I've tested this with an 8bitdo Pro 2 controller paired over bluetooth. In D-input mode, it will not register diagonal inputs, but in X-input mode it does. I've seen the same results with an M30 Bluetooth controller. No diagonals in D-input or Switch mode, yes in X-input.

@sorgelig
Copy link
Member

I never noticed such behavior depending on protocols. But if it happens with some controllers, then it's not because of MiSTer code. Probably something is in driver or even in controller firmware.

@jeffkrull
Copy link

I tested with a few other controllers I have on hand to see if I got different results.

It works with the 8bitdo SN30 Pro 2 (in Xinput mode), the 8bitdo M30 Bluetooth (in Xinput mode), the Pokken Tournament USB controller, and the Switch Online SNES controller (wired).

It does not work with the 8bitdo M30 Bluetooth (in any other mode), or the iBuffalo USB controller.

So I spoke too soon pointing the finger at Xinput support. But it's still strange that it's only certain controllers that is the issue, especially when those same controllers' diagonals work fine in other cores I test. This issue seems to be unique to the AO486 core.

@mankeli
Copy link
Author

mankeli commented Apr 26, 2024

It might have something to do how the axes are being reported by the controller. I couldn't see anything with controller test, but I know those usb controllers report the dpad presses as x/y axes, and I wonder if the ao486 uses that data directly.

@Koston-0xDEADBEEF
Copy link

It looks like this problem concerns any controller which reports d-pad as joystick axis via linux evdev (but only ever produces values 0, 128 or 255). This is simple to test; map any other buttons as left/right/up/down, and diagonals work correctly.

In mister shell, you can check exactly how linux sees your controller(s):

for x in $(evdev-joystick --l); do echo "== $x =="; evdev-joystick --s $x; done

I'm currently trying to learn how inputs are handled on mister main binary side and in the ao486 core.. it's rough

@Koston-0xDEADBEEF
Copy link

I was able to get an iBuffalo gamepad working correctly, by removing existing input maps for it:

rm /media/fat/config/inputs/*0853_2060*

Not yet sure what exactly in the mappings triggered the problem, but in the linux side code the d-pad X-axis was handled as left analog stick, but Y-axis as right analog stick.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

4 participants