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

Add 8BitDo Ultimate C Wired controller (SDL2, udev) #918

Merged
merged 4 commits into from
Sep 27, 2023

Conversation

aduffey
Copy link
Contributor

@aduffey aduffey commented Aug 3, 2023

Both udev and sdl2 config files are provided. The sdl2 config is particularly useful for the Retroarch Flatpak, which uses the sdl2 driver by default.

I do not have a Windows license, so this is Linux support only.

aduffey added 3 commits August 3, 2023 18:46
Both udev and sdl2 config files are provided. The sdl2 config is
particularly useful for the Retroarch Flatpak, which uses the sdl2
driver by default.

I do not have a Windows license, so this is Linux support only.
@ciphermenial
Copy link

ciphermenial commented Aug 10, 2023

In my testing I have only been able to make this work with udev (hold B button when connecting USB). Mine also reports the vendor and product ID as 2dc8:3107. I have also had to change the button around a lot in comparison to what is in this PR. I will post my config later.

@ciphermenial
Copy link

ciphermenial commented Aug 11, 2023

# 8BitDo Ultimate C Wired Controller
# https://www.8bitdo.com/ - https://www.8bitdo.com/ultimate-c-wired-controller/
# https://support.8bitdo.com/ - https://support.8bitdo.com/firmware-updater.html
#
# This is with the device started in D-Input mode, by holding the
# B button while plugging in the controller.
#
# The star button cannot be mapped in D-Input mode and functions as a
# hardware turbo button.

input_driver = "udev"
# The device name has a trailing space
input_device = "8BitDo Ultimate C Wired Controller "
input_device_display_name = "8BitDo Ultimate C Wired Controller"

# 2dc8:3107
input_vendor_id = "11720"
input_product_id = "12311"

input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"

input_a_btn = "1"
input_b_btn = "0"
input_x_btn = "3"
input_y_btn = "2"

input_select_btn = "10"
input_start_btn = "11"
input_menu_toggle_btn = "12"

input_l_btn = "6"
input_r_btn = "7"
input_l2_btn = "5"
input_r2_btn = "4"
input_l3_btn = "13"
input_r3_btn = "14"

input_l_x_plus_axis = "+0"
input_l_x_minus_axis = "-0"
input_l_y_plus_axis = "+1"
input_l_y_minus_axis = "-1"
input_r_x_plus_axis = "+3"
input_r_x_minus_axis = "-3"
input_r_y_plus_axis = "+2"
input_r_y_minus_axis = "-2"

input_up_btn_label = "Dpad Up"
input_down_btn_label = "Dpad Down"
input_left_btn_label = "Dpad Left"
input_right_btn_label = "Dpad Right"

input_b_btn_label = "A"
input_a_btn_label = "B"
input_y_btn_label = "X"
input_x_btn_label = "Y"

input_select_btn_label = "Select"
input_start_btn_label = "Start"
input_menu_toggle_btn_label = "Home"

input_l_btn_label = "LB"
input_r_btn_label = "RB"
input_l2_btn_label = "LT"
input_r2_btn_label = "RT"
input_l3_btn_label = "LSB"
input_r3_btn_label = "RSB"

input_l_x_plus_axis_label = "LS Right"
input_l_x_minus_axis_label = "LS Left"
input_l_y_plus_axis_label = "LS Down"
input_l_y_minus_axis_label = "LS Up"
input_r_x_plus_axis_label = "RS Right"
input_r_x_minus_axis_label = "RS Left"
input_r_y_plus_axis_label = "RS Down"
input_r_y_minus_axis_label = "RS Up"

@aduffey
Copy link
Contributor Author

aduffey commented Aug 12, 2023

@ciphermenial Yes, if you start it in D-Input mode the device ID and device name are different, as well as all of the mappings. It's a little weird because it seems to emit two events on a trigger press, one binary and one variable value. I can try to add an sdl2 config for it as well.

I just favored the X-Input config because the instructions say to use that on a PC and the mappings were easier.

@ciphermenial
Copy link

I can't get mine to connect in X-input mode.

@aduffey
Copy link
Contributor Author

aduffey commented Aug 15, 2023

@ciphermenial What revision does yours report?

X-Input:

$ sudo grep -B3 -A8 "2dc8.*3106" /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  8 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs=  1
P:  Vendor=2dc8 ProdID=3106 Rev= 1.10
S:  Manufacturer=8BitDo
S:  Product=Ultimate C Wired Controller 
S:  SerialNumber=D4B1320A05
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=5d Prot=01 Driver=xpad
E:  Ad=84(I) Atr=03(Int.) MxPS=  32 Ivl=2ms
E:  Ad=05(O) Atr=03(Int.) MxPS=  32 Ivl=8ms

D-Input:

$ sudo grep -B3 -A8 "2dc8.*3017" /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#=  7 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=2dc8 ProdID=3017 Rev= 0.01
S:  Manufacturer=8BitDo
S:  Product=Ultimate C Wired Controller 
S:  SerialNumber=D4B1320A05
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=480mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=00 Prot=00 Driver=usbhid
E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=4ms
E:  Ad=05(O) Atr=03(Int.) MxPS=  64 Ivl=1ms

Kernel:

$ uname -a
Linux fedora 6.4.6-100.fc37.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Jul 24 20:38:53 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Retroarch 1.15.0

[Edited for copy+paste error.]

@RobLoach
Copy link
Member

Is this good to merge? I don't have one of these controllers.

@aduffey
Copy link
Contributor Author

aduffey commented Sep 27, 2023

I have since added a D-Input config, similar to @ciphermenial but with the L2 and L3 triggers as analog axes rather than buttons. I have verified all the buttons in the Remote RetroPad core. I will push it tomorrow morning and then I believe it should be good to merge.

I tried to make a D-Input/sdl2 config but some mappings didn't work. I think it's possibly related to this issue but I haven't looked any deeper into it.

@RobLoach
Copy link
Member

Without any duplicates found, I believe this should be good to go for now. If there any any other updates, feel free to submit them in a follow up 👍

@RobLoach RobLoach merged commit 69d77b8 into libretro:master Sep 27, 2023
@RobLoach RobLoach changed the title Add support for the 8BitDo Ultimate C Wired controller in X-Input mode. Add 8BitDo Ultimate C Wired controller (SDL2, udev) Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants