N64 controller mapping

Very powerful gaming console solution based on Debian
Post Reply
NewAgeRetro
Posts: 11
Joined: Mon Jun 11, 2018 5:52 am
languages_spoken: english
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

N64 controller mapping

Post by NewAgeRetro »

Hello,

I have been searching the forums with no luck so I figured I would post my question.

I'm trying to run N64 on OGST with a USB N64 controller. Everything works fine until the game loads. The controls change so I assume they are loaded with the game. The 'Joystick' is linked with the 'C buttons' and 'B' and 'Z' are mixed up. I have seen posts on editing the Retroarch configs but am starting to get a little lost. I am used to RetroPie and know that its in the opt directory under configs but obviously this isn't Retropie. I'm just trying to figure out where the N64 emulator pulls its configs from.

I looked at the retroarch.cfg file in (/home/odroid/.config/retroarch/retroarch.cfg) but could not see any configs for my N64 controller.

Also is the hotkey+start combo supposed to work?

Sorry for questions. I hope my topic follows all the forum rules but if not please let me know as I often read forums but rarely post.

Thank you for any help.

User avatar
odroid
Site Admin
Posts: 36919
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1593 times
Been thanked: 1069 times
Contact:

Re: N64 controller mapping

Post by odroid »

Can you try to find a udev rule file for your controller?
For examples, we made a rule /usr/share/libretro/autoconfig/udev/xiaoji_GameSir_G3w.cfg for our G3w controller.

Code: Select all

input_driver = "udev"
input_device = "Gamesir-G3w"
input_device_display_name = "xiaoji GameSir G3w"
# Hex vid:pid is found using "dmesg -w" or "tail -f /var/log/syslog" and converted to Decimal using http://www.binaryhexconverter.com/hex-to-decimal-converter
# Hex vid:pid = 20BC:5500 -> Decimal vid:pid = 8380:21760
input_vendor_id = "8380"
input_product_id = "21760"
input_b_btn = "0"
input_y_btn = "3"
input_select_btn = "10"
input_start_btn = "11"
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
input_a_btn = "1"
input_x_btn = "4"
input_l_btn = "6"
input_r_btn = "7"
input_l2_btn = "8"
input_r2_btn = "9"
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 = "+2"
input_r_x_minus_axis = "-2"
input_r_y_plus_axis = "+3"
input_r_y_minus_axis = "-3"
input_b_btn_label = "A"
input_y_btn_label = "X"
input_select_btn_label = "Select"
input_start_btn_label = "Start"
input_up_btn_label = "D-Pad Up"
input_down_btn_label = "D-Pad Down"
input_left_btn_label = "D-Pad Left"
input_right_btn_label = "D-Pad Right"
input_a_btn_label = "B"
input_x_btn_label = "Y"
input_l_btn_label = "L1"
input_r_btn_label = "R1"
input_l2_btn_label = "L2"
input_r2_btn_label = "R2"
input_l3_btn_label = "Left Stick"
input_r3_btn_label = "Right Stick"
input_l_x_plus_axis_label = "Left Stick Right"
input_l_x_minus_axis_label = "Left Stick Left"
input_l_y_plus_axis_label = "Left Stick Down"
input_l_y_minus_axis_label = "Left Stick Up"
input_r_x_plus_axis_label = "Right Stick Right"
input_r_x_minus_axis_label = "Right Stick Left"
input_r_y_plus_axis_label = "Right Stick Down"
input_r_y_minus_axis_label = "Right Stick Up"

User avatar
meveric
Posts: 11441
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 63 times
Been thanked: 459 times
Contact:

Re: N64 controller mapping

Post by meveric »

It really depends on what controller you're using.
Retroarch should show the name of the controller when you start it, you can also use lsusb to find the name and the ID of your controller.

Retroarch has a very large library of known controllers, apparently yours is not one of em, or is found as a generic no-name controller which can mess up the button layout as well.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

NewAgeRetro
Posts: 11
Joined: Mon Jun 11, 2018 5:52 am
languages_spoken: english
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: N64 controller mapping

Post by NewAgeRetro »

Just had to get used to how Retroarch is set up on this system.

As for the GameSir controllers did you find that the udev rule fixed the trigger buttons? For some reason my GameSir maps correct for Emulationstation menus but in games it uses LT and RT as start and select. I think I can fix it in Retroarch but haven't had time to try yet.

User avatar
meveric
Posts: 11441
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2, H2 (J4105), GoA, C4, GoA v1.1, H2+, HC4, GoS
Has thanked: 63 times
Been thanked: 459 times
Contact:

Re: N64 controller mapping

Post by meveric »

EmulationStation and Retroarch are completely separated.. EmulationStation uses SDL2 and maps the controller it currently finds.
Retroarch uses udev and identifies the controller from the Vendor and Product ID and looks up a database of configs to map the buttons.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

psomero
Posts: 30
Joined: Wed Feb 19, 2014 11:46 am
languages_spoken: english
ODROIDs: XU+E, XU4, C1+, HC1, H2
Location: Silicon Valley
Has thanked: 0
Been thanked: 1 time
Contact:

Re: N64 controller mapping

Post by psomero »

meveric wrote:
Mon Jun 11, 2018 2:24 pm
Retroarch should show the name of the controller when you start it, you can also use lsusb to find the name and the ID of your controller.

Retroarch has a very large library of known controllers, apparently yours is not one of em, or is found as a generic no-name controller which can mess up the button layout as well.
I bought some offbrand N64 USB (HID) controllers which report as no-name (USB PID/VID it reports is HORI, but they're not HORI). I thought I was hosed, but figured out a super janky workaround that solved the issue.

I simply renamed the (empty, no mappings, just button list) auto-created config file with a non-standard extension ("Switch Co LTD Pro Controller.cfg" >> "Switch Co LTD Pro Controller.cfg.fuck") and then found the closest looking pre-baked config, cp'd a new version with my own name and substituted in the bogus VID/PID of the plugged in controller found using lsusb. One has to convert from hex to dec for the VID/PID, but after that, the analog joystick worked and it was simply a matter of re-ordering the buttons and remapping in the retroarch core config for N64 because even with the hacked udev file, the buttons are reported in a different order (same usb micro, same driver, different firmware, different layout of pcb?)

I plugged controller into windows, it enumerated as a gamepad and I used the "set up usb game controllers" gui to determine button order (mine was analog, buttons 1-10, POV hat for d-pad)

on OGST box,
ctrl-alt-t to get to terminal
sudo lsusb -v, look for something that reports as HID and sounds like a controller. The description for the usb device varied completely from what retroarch autoconfig was reporting.
take note of VID/PID for device
go to /usr/share/librertro/autoconfig/udev
dig around for USB N64 controllers, cat or nano to browse through them real quick. Look for one that seems about right with similar input mappings (I looked for analog, hat directions, misc buttons but particularly Z and start)
sudo nano <that file that looks about right>, ctrl-o, write out with new memorable name (I appended "hacked_" to name)
convert the vid/pid from lsusb step from hex to dec. google it. replace values in the hacked file from above, resave, close nano
mv the autocreated config to some arbitrary new extension so it won't be read by retroarch
restart retroarch and it worked for me
These users thanked the author psomero for the post:
odroid (Mon Feb 22, 2021 9:28 am)

Post Reply

Return to “OGST-XU4”

Who is online

Users browsing this forum: No registered users and 0 guests