o0Zz / sys-con

Nintendo Switch sysmodule that allows support for third-party controllers (XBox, PSX, PC, ...)
GNU General Public License v3.0
74 stars 6 forks source link

D-pad mapping not functional #22

Closed Inclsevd closed 5 months ago

Inclsevd commented 5 months ago

Information Atmosphere version: 1.7.1 Switch OS version: 18.1.0 Syscon version: 1.2.1 Controller: Wii Classic Controller Pro via Raphnet Classic Controller USB adapter

Description Thank you for this fork!

The controller was automatically added but most inputs were wrong or not working, however I was able to fully configure it apart from the d-pad which is unfortunate as it's the main reason I'd like to use this controller. I obtained the button ids from windows and they work for all buttons except the d-pad which doesn't respond at all.

Inclsevd commented 5 months ago

Here is my log file: https://gist.github.com/Inclsevd/41ca6cafc9a2669311387d3f179063f1

Here is the config:

[289b-0080] 
right_stick_x=Rx
right_stick_y=Ry
B=2
A=5
X=6
Y=1
L=7
R=8
ZL=9
ZR=10
minus=3
plus=4
dpad_up=13
dpad_right=16
dpad_down=14
dpad_left=15
home=11
simulate_home_from_plus_minus=0
o0Zz commented 5 months ago

Hi, try to remove the dpad settings from the configuration. Indeed dpad works without any configuration usually.

Inclsevd commented 5 months ago

There's no response at all for the dpad with or without dpad in the config, not even incorrect input.

Inclsevd commented 5 months ago

I tried again with allowing sys-con to add the controller automatically and it mapped these two:

lstick_click=13
rstick_click=14

Checking the sys-con homebrew app, d-pad up and down actually respond to these, so I'm not sure why they aren't responding to the d-pad settings.

o0Zz commented 5 months ago

What happen if you plug your controller to windows, when you press dpad up/down/right/up ? Do you see a specific button that light on? Or do you see the arrow zone that move ?

Inclsevd commented 5 months ago

The button lights up, for example d-pad up looks like this:

dpadup

o0Zz commented 5 months ago

sys-con-1.2.1+8-ATMOSPHERE-1.7.x.zip Try this build and let me know if it's fixed.

Inclsevd commented 5 months ago

This build is giving an atmosphere fatal error for sys-con at boot, is it definitely the 1.7 version and not 1.6?

texita commented 5 months ago

This build is giving an atmosphere fatal error for sys-con at boot, is it definitely the 1.7 version and not 1.6?

Have you try with the new config.ini in the 1.2.1+8? Was happening to me aswell. I think you still using your old config.ini

Inclsevd commented 5 months ago

Have you try with the new config.ini in the 1.2.1+8? Was happening to me aswell. I think you still using your old config.ini

Thanks for pointing that out, I was using my older config and didn't realize @o0Zz had updated the config. Maybe it's possible for the config files to be handled in a more graceful way to avoid a crash for future users who want to keep their own custom configs in future updates?

sys-con-1.2.1+8-ATMOSPHERE-1.7.x.zip Try this build and let me know if it's fixed.

Thanks for this, I can confirm that it works fine now!

I also tested another controller with this adapter, the official SNES classic controller. The button mappings are the same but the controller has less buttons. The same config works but we also need to add an entry for simulate_home= because there is no home button on that one. It seems we need to keep the missing buttons in the config for the SNES controller because if I remove them I get ghost inputs from L R where it seems like they start to behave as right stick.

Because there are many controllers that can be connected to this adapter other tweaks like that might be needed, so maybe the config needs to be called Raphnet Classic Controller USB adapter - Wii Classic Controller Pro instead? I will let you decide the best way to name and handle it :+1:

texita commented 5 months ago

This version is crashing with the old config.ini because is changed the parameter "simulate_home_from_plus_minus=" and this parameter now doesen't exist anymore, you have to use these 2 parameters: simulate_home= simulate_capture=

For the snes pad, try to put in your adapter config:

[289b-0080] ;Raphnet Classic Controller USB adapter - Wii Classic Controller Pro simulate_home=plus+dpad_up simulate_capture=plus+dpad_down

Inclsevd commented 5 months ago

Yes but ideally it should fail gracefully rather than crash the system.

I'd already mentioned the simulate_home= in my post, no problem with it.

texita commented 5 months ago

Yes but ideally it should fail gracefully rather than crash the system.

I'd already mentioned the simulate_home= in my post, no problem with it.

Oh sorry, i wrongly read the part to "keep "simulate_home=" and snes controller mapping and changing buttons. Yes need to keep all buttons in the config, because you are mapping the adapter, not the pads connected to the adapter, If you delete one button mapping, it will be replaced with one in the [dafault] section above in the config file

Inclsevd commented 5 months ago

That seems like a bug then, because if I have:

L=7
R=8

in the config, but I delete these:

right_stick_x=Rx
right_stick_y=Ry

After that L R should only work for the defined buttons, not the defined buttons plus the defaults (in this case right stick).

Inclsevd commented 5 months ago

Ignore the last post, it just seems to be something this adapter does - see the z axis and z rotation when L/R are pressed:

a b

o0Zz commented 5 months ago

Ok great, thank you for the update. I agree with you, sys-con is not suppose to crash with an old config, I will try to figure out what's wrong in order to avoid such kind of issue which is hard de debug. I will include this fix (DPAD_xxx) to the next version ;)

Inclsevd commented 5 months ago

Thanks for the quick fix and release, very nice to use that adapter.