SDL icon indicating copy to clipboard operation
SDL copied to clipboard

Sanwa Supply JY-P76USV wrong controller mapping

Open pkr-sadx opened this issue 2 years ago • 6 comments

Hi! I have a Sanwa Supply JY-P76USV controller that SDL identifies as GameShark GS-GP702. However, with SDL's Controller bindings the button locations are all wrong and some of the axes are unusable.

It's been like this for a while. In the last several years, the SDL controller database has had edits for this specific controller's entries, which sometimes made it work better, sometimes not. At the moment it's back to unusable without a custom controller map.

Here's the device GUID as reported by SDL 2.28.5: 0300f020790000000600000000000000 In SDL 2.24.0 it reports a different GUID: 03000000790000000600000000000000

Here's a mapping string that displays all inputs correctly in SDL2 Gamepad Mapper 0.0.5:

0300f020790000000600000000000000,Sanwa Supply JY-P76USV,a:b0,b:b1,x:b2,y:b3,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,-leftx:-a0,+leftx:+a0,-lefty:-a1,lefty:+a1,-rightx:-a2,+rightx:+a2,-righty:-a4,+righty:a4,lefttrigger:b6,righttrigger:b7,platform:Windows,

Here's what its button layout looks like when mapped to the X360 controller layout: image (triggers as buttons 7-8, shoulder buttons 5-6, axis and button indices are 1-based here)

It is possible to get this controller properly registered in the database? I'll be happy to provide any additional information.

EDIT: Device Manager info Device instance path: HID\VID_0079&PID_0006\6&3B6771A7&2&0000 Hardware IDs:

HID\VID_0079&PID_0006&REV_0107
HID\VID_0079&PID_0006
HID\VID_0079&UP:0001_U:0004

pkr-sadx avatar Nov 29 '23 23:11 pkr-sadx

Thank you for the mapping string, this has been added for the next release!

slouken avatar Mar 03 '24 20:03 slouken

Yeah, it looks like that mapping string was incorrect.

Try this: "03000000790000000600000000000000,Sanwa Supply JY-P76USV,crc:20f0,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b2,y:b3,",

slouken avatar Mar 07 '24 04:03 slouken

Okay, this mapping has been updated for the next release, thanks!

slouken avatar Mar 07 '24 04:03 slouken

This is fixed for the 2.32.0 release, can you please confirm in the 2.31.1 prerelease later today?

slouken avatar Feb 08 '25 16:02 slouken

That's weird, because this is the mapping included in SDL:

03000000790000000600000000000000,Sanwa Supply JY-P76USV,crc:20f0,a:b0,b:b1,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b2,y:b3,

slouken avatar Feb 11 '25 15:02 slouken

I think I see the problem. Your joystick is actually "Generic USB Joystick" with crc 02f4, which isn't unique. If you change the GUID in your mapping to 03000000790000000600000000000000, does it still work?

slouken avatar Feb 11 '25 15:02 slouken

It stops being detected if I change the GUID to that. I didn't know the GUID reported originally wasn't unique, sorry for the trouble. I think the VID and PID it reports aren't unique either, so I guess individual support for this controller would be impossible since it would clash with other generic controllers? It's no big deal, this controller is really old and I doubt anyone else has one... But thank you for looking into this!

That's correct. You're welcome! I'll go ahead and remove the incorrect mapping, since it seems like it isn't helpful.

slouken avatar Feb 11 '25 15:02 slouken