Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feature request: Add analog trigger polling for future Saturn support #823

Open
YLFAndy opened this issue Sep 19, 2023 · 6 comments
Open

Comments

@YLFAndy
Copy link

YLFAndy commented Sep 19, 2023

Currently analog triggers are not polled as full byte values. They can be mapped as digital but cannot be read for xinput byte value. This is (currently) specifically an issue for the Saturn core, which has a number of emulated controllers with analog inputs apart from the L and R sticks (perhaps analog trigger quirk could be added?)

NOTE: The core currently can write values to the emulated Saturn pad for the inputs, but it is not hooked up because an appropriate analog read source is non existent. See: https://github.com/srg320/Saturn_MiSTer/blob/master/rtl/hps2pad.sv
Applying value to the Z1/Z2 inputs in-core will work, but cannot be read from any analog currently apart from L and R sticks A test core has been created that maps Y2 up to Z1 and Y2 down to Z2 to verify this.

Two known xinput cases:
Modern console trigger/8bitDo ultimate controller - both triggers map in Xinput as Z. RT as 0-255, LT as -255-0.
Reflex Adapt using Saturn 3D pad - R maps to 'Throttle' L maps to 'Brake' both 0-255.

In-menu work arounds failed - attempting to map triggers to analog stick 2 inputs causes the mapper module to hang after stick 2 down is entered on a number of controllers with analog trigger support. The mapper graphical menu shows up and hangs on dpad R assignment - tested with multiple controllers with analog triggers.
Repro steps:
Using a controller with analog triggers, launch Define Joystick Buttons in the main MiSTer OSD
Map the first set to D pad
Map stick 1 to stick 1
When "Press right on Stick 2" is displayed, pull the right trigger.
When "Press down on Stick 2" is displayed, pull the left trigger.

Result: This hangs the remainder of the controller mapping.

If this is an issue that can be solved per-core, please close (thought if it was mappable for racing games in general as throttle/brake, that would be a bonus).

@sorgelig
Copy link
Member

I will think about implementation.

@dazzer69
Copy link

Any update on implementation?

@thorr2
Copy link

thorr2 commented May 6, 2024

I keep running into this. I would really appreciate analog trigger support. Spy Hunter is another one where I would like to use the analog triggers, along with any other driving game that has foot pedals such as Outrun. Triggers are the logical choice for gas and brake which are separate functions, unlike up/down. I hope this can be implemented soon. Also, the gear button in Spy Hunter is backwards from how I need it to work. I have a real arcade shifter, but up/down is backwards in Spy Hunter. Can a reverse gear (logical not) function be added to Spy Hunter's core menu? I can't find a github issues area for Spy Hunter.

@tonytoon
Copy link
Contributor

I will think about implementation.

I'd like to take a stab at this if you have any ideas or guidance. I've already been mucking around input.cpp and want to learn more about input handling in general.

@birdybro
Copy link
Member

birdybro commented Jul 14, 2024

I can't find a github issues area for Spy Hunter.

https://github.com/MiSTer-devel/Arcade-MCR3Scroll_MiSTer/issues

@gleek12
Copy link

gleek12 commented Sep 18, 2024

Hello! Has there been any luck in getting analog triggers to work?

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

No branches or pull requests

7 participants