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

N64 USB controllers and others not mapping as expected #4889

Closed
Hew-ux opened this issue Oct 26, 2021 · 13 comments
Closed

N64 USB controllers and others not mapping as expected #4889

Hew-ux opened this issue Oct 26, 2021 · 13 comments
Labels
feedback awaiting user feedback

Comments

@Hew-ux
Copy link

Hew-ux commented Oct 26, 2021

Issue: When mapping a controller, Up and Left can be mapped properly for the analog sticks, but Down and Right do not function in game.

Expected behaviour: To be able to use both up/down and left/right on the analog stick mappings.

Reproduction steps: Get a controller that doesn't use negative axis values for polar inputs (listed below) and map it using the "Configure a controller" menu. Down and Right on whatever has been used for the analog sticks does not function.

Info: In the "Configure a controller" menu, you can only assign left/right analog sticks for the Retropad by pushing Up and Left. Batocera then assumes that the "opposite" value on that axis must be the polar direction. Eg. if the axis starts at a value of 0, and increases to 124 as the user maps the Up direction, then -124 is assigned as the Down direction.

Mapping only left/up and relying on the inverse axis causes a large group of controllers to be unusable in Batocera (ie. only be able to map up and left, but not down and right). Allowing the mapping independently to left/up/down/right directions (like how Retropie and Recalbox's EmulationStation does it) would allow for basically any controller, not just ones that use negative axis values for polar directions, to be mapped. Examples of controllers that don’t use a negative axis value for certain inputs:

Batocera's current controller config: https://github.com/batocera-linux/batocera.linux/blob/master/package/batocera/core/batocera-configgen/configgen/configgen/controllersConfig.py
Recalbox's controller config which does support this: https://gitlab.com/recalbox/recalbox-configgen/-/blob/master/configgen/controllers/controller.py

This might require also tinkering with the controller inputs for certain emulators, some may be hard-coded to the axis/negative axis behaviour.

The critical line for changing this behaviour might be https://github.com/batocera-linux/batocera.linux/blob/master/package/batocera/core/batocera-configgen/configgen/configgen/controllersConfig.py#L184, but I'm not sure about it or what would be needed to be replaced here. Maybe the behaviour for the trigger axis mapping can be used.

@Hew-ux
Copy link
Author

Hew-ux commented Nov 4, 2021

batocera-support-20211105103625.tar.gz
Here's a support file from after attempting to bind a BrawlerGen USB controller to the N64's layout. Only C Up and Left are working correctly.

batocera-support-20211105104622.tar.gz
This one has axis values on its buttons and digital inputs for its analog sticks. In this instance, only C up and C left function for the right stick, and only left and up work on the analog stick.

@JMToth
Copy link

JMToth commented Nov 13, 2021

I would love to see a controller configuration fix for N64, Sega, and Sega Saturn native USB controllers. Thank you for the above info.

@tommylee464
Copy link

tommylee464 commented Nov 13, 2021

can you add Xbox One controller Right analog stick (right or left) not working in retroarch overall for mapping only in retroarch

(right analog stick) right and left direction

@Hew-ux
Copy link
Author

Hew-ux commented Dec 1, 2021

A workaround has been discovered, though unrelated to this issue you can just edit the es_input.cfg manually as mentioned here: https://wiki.batocera.org/systems:n64#controls
Original source: https://www.reddit.com/r/batocera/comments/r4gqu2/brawler64_controller_setup_with_default_n64/

@tommylee464
Copy link

tommylee464 commented Dec 1, 2021 via email

@Hew-ux
Copy link
Author

Hew-ux commented Dec 2, 2021

What are you talking about @tommylee464 ? Are you sure that's related to this issue?

@KevinLeenders
Copy link

Hi,

I want to demystify the problem. So for my case I assume:

  • USB N64 controller (original layout, or brawler64 also works)
  • Controller has no Home button no select button
  • Controller has no right analog stick
  • Batocera cant assign right analog stick to button layout
  • We use Retroarch not standalone emulator Mupen64
  • You are able to determain button numbers / dinput numbers aka "button 7" = Start etc.

The Problem:

In Batocera you cant assign right analog stick to match the C buttons of the N64, Thus using a Orign. N64 via USB or Brawler gen USB you alway have to remap various buttons and in the case of orign. N64 controller you are also missing select button and home button to use as hotkey.

The Solution:

In Batocera you need to configure setup your controller in a smart way, so that if you plugin a Xbox360 style controller or a N64 controller it will always work. To do so I present my controller layout. This is based upon the org. n64 controller but the same layout can be used for Brawler USB (or wireless).

N64

You will need to skip every button that is not presented here!
Batocera will ask on reconfigure this question:

  • No hotkey button has been assigened. This is required for exiting games with a controller. Do you want to use select button as your hotkey? Awnser: Do not assign hotkey.

Wait your not done yet!

The problem now is you dont have a hotkey, and Retroarch functions like change shader on R2 button are now actived without hotkey! So if you press C-Right in Mario64 it will trigger next shader fuction (thats bad).

So in order to exit a game and not use hotkey functions we need to adjust batocera.conf file ( userdata\system\batocera.conf )
First enable this fuction: Open the RetroArch Quick Menu by holding Start for 2 seconds
add this line:

global.retroarch.input_menu_toggle_gamepad_combo=7 (mine start button is 7, you must figgure out your start button) or use:

Then to disable all other hotkey buttons add these lines (this sets all the hotkey functions to disable aka nul:

## Exit the current emulator. Equivalent to [HOTKEY]+[START].
n64.retroarch.input_exit_emulator_btn=nul

## Open RetroArch's Quick Menu. Equivalent to [HOTKEY]+[SOUTH].
n64.retroarch.input_menu_toggle_btn=nul
## Save current state to the selected slot. Equivalent to [HOTKEY]+[WEST].
n64.retroarch.input_save_state_btn=nul
## Load the state from the selected slot. Equivalent to [HOTKEY]+[NORTH].
n64.retroarch.input_load_state_btn=nul
## Reset the emulated system (can cause bugs with certain settings/games). Equivalent to [HOTKEY]+[EAST].
n64.retroarch.input_reset_btn=nul
## Increase the currently selected save state slot. Equivalent to [HOTKEY]+[D-PAD UP].
n64.retroarch.input_state_slot_increase_btn=nul
## Decrease the currently selected save state slot. Equivalent to [HOTKEY]+[D-PAD DOWN].
n64.retroarch.input_state_slot_decrease_btn=nul

## Toggle the AI translation service. Equivalent to [HOTKEY]+[R1]
n64.retroarch.input_ai_service_btn=nul
## Fast-forward (hold). Equivalent to [HOTKEY]+[D-PAD RIGHT]
n64.retroarch.input_hold_fast_forward_btn=nul
## Rewind. Equivalent to [HOTKEY]+[D-PAD LEFT]
n64.retroarch.input_rewind_btn=nul
## Take a screenshot. Equivalent to [HOTKEY]+[L1].
n64.retroarch.input_screenshot_btn=nul
## Next shader. Equivalent to [HOTKEY]+[R2].
n64.retroarch.input_shader_next_btn=nul
## Previous shader. Equivalent to [HOTKEY]+[L2].
n64.retroarch.input_shader_prev_btn=nul

## Hotkey (for holding). Setting this to anything but nul will re-enable the combo requirement.
n64.retroarch.input_enable_hotkey_btn=nul
## Eject the virtual disc.
n64.retroarch.input_disk_eject_toggle_btn=nul
## Select the next disc.
n64.retroarch.input_disk_next_btn=nul
## Select the previous disc.
n64.retroarch.input_disk_prev_btn=nul
## Toggle the FPS display.
n64.retroarch.input_fps_toggle_btn=nul
## Advance one frame.
n64.retroarch.input_frame_advance_btn=nul
## Slow-motion (hold).
n64.retroarch.input_hold_slowmotion_btn=nul
## Record movie toggle.
n64.retroarch.input_movie_record_toggle_btn=nul
## Netplay watch toggle.
n64.retroarch.input_netplay_game_watch_btn=nul
## Netplay host toggle.
n64.retroarch.input_netplay_host_toggle_btn=nul
## OSK toggle.
n64.retroarch.input_osk_toggle_btn=nul
## Pause emulation.
n64.retroarch.input_pause_toggle_btn=nul
## Input recording toggle.
n64.retroarch.input_recording_toggle_btn=nul
## Runahead toggle.
n64.retroarch.input_runahead_toggle_btn=nul
## Streaming toggle.
n64.retroarch.input_streaming_toggle_btn=nul
## Fast-forward toggle.
n64.retroarch.input_toggle_fast_forward_btn=nul
## Slow-motion toggle.
n64.retroarch.input_toggle_slowmotion_btn=nul
## Turbo default button.
n64.retroarch.input_turbo_default_button=nul

Result:

  • Best solution for using a org. n64 via USB or clone USB controller
  • You can use the N64 controller or a regular Xbox (xinput) controller without have to change
  • You can use N64 controller for other RA emulator's (as long as you configure global.retroarch.input_menu_toggle_gamepad_combo=7 to be able to Exit Retroarch and use save/load etc functions.

Q & A:

Q: Why dont I use any of the C buttons or R1, L1 button as Hotkey?
A: Because try playing Goldeneye (example there are more games that utilize almost every button on the N64 controller) not using any of the N64 button combinations, its inpossible.

@Hew-ux
Copy link
Author

Hew-ux commented Dec 14, 2021

That's a novel workaround but https://www.reddit.com/r/batocera/comments/r4gqu2/brawler64_controller_setup_with_default_n64/ seems to be much simpler and easier to comprehend. It could be combined with your hotkey combo to still be able to exit games.

Fundamentally, if we could just assign r-stick down etc. like recalbox in the menu then the issue would be fixed.

@KevinLeenders
Copy link

Yea this works best for me. I appreciate the reddit solution verry much! I will look into it. But this is only a solution for 1 type of controller. I have 2 saffun n64 usb controllers and 2 Retrolink n64 usb controller both have a different key mapping in dinput mode. So for me it takes longer to find out what button id belongs to each controller then setting up a remap in RetroArch.

Also my solution is only for RetroArch emulators not for standalone Mupen64.

What you are saying is true: "Fundamentally, if we could just assign r-stick down etc. like recalbox in the menu then the issue would be fixed" than atleast for my N64 style usb controller you will only need to fix the missing hotkey.

BTW you helped me on discord for setting this up:
Open the RetroArch Quick Menu by holding Start for 2 seconds. In the global config.

Thnx Atari!

@dmanlfc
Copy link
Collaborator

dmanlfc commented Jul 30, 2023

@Hew-ux worth closing now?

@Hew-ux
Copy link
Author

Hew-ux commented Jul 31, 2023

The issue is unchanged. I have since given up on this gaining any traction though.

@n2qz
Copy link

n2qz commented Dec 29, 2023

The issue is unchanged. I have since given up on this gaining any traction though.

Is the issue filed in the correct repository? The mapping is done in ES, and so it's ES that would need to allow mapping the additional axes.

If you agree, I can move this issue to the ES repository.

@n2qz n2qz added the feedback awaiting user feedback label Dec 29, 2023
@Hew-ux
Copy link
Author

Hew-ux commented Mar 27, 2024

Fabrice has already made it clear to me that he does not intend to re-add the Down and Right inputs back to the input configuration screen, but that was years ago and maybe he's changed his mind. Either way, I don't want to be stirring up any more about this issue; users have already made their own unique workarounds and I've since written up instructions on how to manually configure controller mappings on the wiki (bypassing the UI limitation). A genuine fix might also break users' existing workarounds unintentionally. Feel free to open up an issue in relation to this, but I'll be closing this ticket.

@Hew-ux Hew-ux closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback awaiting user feedback
Projects
None yet
Development

No branches or pull requests

6 participants