barbudreadmon / fbalpha-backup-dontuse-ty

Deprecated port of Final Burn Alpha to Libretro (v0.2.97.43).
61 stars 43 forks source link

Neo Geo player 1 input controls player 2 as well #121

Closed j-m-harris closed 7 years ago

j-m-harris commented 7 years ago

libretro correctly configured for 2 joystick inputs, and fbalpha debug reports seeing the joystick on separate indexes.

However in play the player 1 controls are being sent for player 2 as well. The player 2 joystick is having no observable effect.

I've seen the 'Currently known input issues' issue #102 - should this instead be appended there?

barbudreadmon commented 7 years ago

Game ? Os ? There is no such issue for me, so it's probably a setup issue.

j-m-harris commented 7 years ago

Thanks for the response, that's good to hear it's probably setup but I'm struggling to see what's wrong. I'm certain in the libretro input setup that each player is using their respective stick, since binding the buttons only responds to input on the corresponding stick.

Happens at least in wjammers and mslug, so I'd assumed it wasn't game specific. The joysticks are identical devices, so the device IDs and names are identical. Only the joystick index will uniquely identify them.

I'll get the verbose output from fbalpha which showed it did detect multiple sticks and assigned the player each index.

OS is gentoo, running on a pi 3. Am running the latest code from head.

barbudreadmon commented 7 years ago

I also run gentoo on my rpi3 so i can confirm it's a setup issue. Do you use autoconfig ? What's your controller ?

j-m-harris commented 7 years ago

Thanks for your help. I don't use autoconfig. Controllers are created by uinput-mapper (https://github.com/MerlijnWajer/uinput-mapper). They're being sent over the network from a pi 0. Each stick is a separate device, with an identical config. It might be worth pointing out they work correctly in sdlmame and gngeo.

evtest shows:

Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x42 product 0xbebe version 0x1
Input device name: "UInputMapper: python-uinput"

RetroArch detects the joysticks:

RetroArch [INFO] :: [SDL]: Device #0 (0042:bebe) connected: UInputMapper: python-uinput.
RetroArch [INFO] :: [SDL]: Device #0 has: 2 axes, 10 buttons, 0 hats and 0 trackballs.
RetroArch [INFO] :: [SDL]: Device #1 (0042:bebe) connected: UInputMapper: python-uinput.
RetroArch [INFO] :: [SDL]: Device #1 has: 2 axes, 10 buttons, 0 hats and 0 trackballs.

On loading wjammers, RetroArch reports the players assigned to separate ports:

RetroArch [libretro INFO] :: MVS Neo Geo Mode selected => Set NeoSystem: 0x00 (asia-s3.rom [0x91b64be3] (MVS Asia/Europe ver. 6 (1 slot))).
RetroArch [libretro INFO] :: DIP switches offset: 25.
RetroArch [libretro INFO] :: drvname: wjammers
RetroArch [libretro INFO] :: boardrom: neogeo
RetroArch [libretro INFO] :: systemname: Neo Geo MVS
RetroArch [libretro INFO] :: genre: 16384
RetroArch [libretro INFO] :: hardware: -2063532032
RetroArch [libretro INFO] :: max players: 2
RetroArch [libretro INFO] :: has_analog: 0
RetroArch [libretro INFO] :: [P1 Coin         ] [p1 coin        ] nSwitch.nCode: 0x0006 - assigned to key [RetroPad Select Button   ] on port  0.
RetroArch [libretro INFO] :: [P1 Start        ] [p1 start       ] nSwitch.nCode: 0x0002 - assigned to key [RetroPad Start Button    ] on port  0.
RetroArch [libretro INFO] :: [P1 Select       ] [p1 select      ] nSwitch.nCode: 0x0004 - assigned to key [RetroPad Select Button   ] on port  0.
RetroArch [libretro INFO] :: [P1 Up           ] [p1 up          ] nSwitch.nCode: 0x4002 - assigned to key [RetroPad D-Pad Up        ] on port  0.
RetroArch [libretro INFO] :: [P1 Down         ] [p1 down        ] nSwitch.nCode: 0x4003 - assigned to key [RetroPad D-Pad Down      ] on port  0.
RetroArch [libretro INFO] :: [P1 Left         ] [p1 left        ] nSwitch.nCode: 0x4000 - assigned to key [RetroPad D-Pad Left      ] on port  0.
RetroArch [libretro INFO] :: [P1 Right        ] [p1 right       ] nSwitch.nCode: 0x4001 - assigned to key [RetroPad D-Pad Right     ] on port  0.
RetroArch [libretro INFO] :: [P1 Button A     ] [p1 fire 1      ] nSwitch.nCode: 0x4080 - assigned to key [RetroPad B Button        ] on port  0.
RetroArch [libretro INFO] :: [P1 Button B     ] [p1 fire 2      ] nSwitch.nCode: 0x4081 - assigned to key [RetroPad A Button        ] on port  0.
RetroArch [libretro INFO] :: [P1 Button C     ] [p1 fire 3      ] nSwitch.nCode: 0x4082 - assigned to key [RetroPad Y Button        ] on port  0.
RetroArch [libretro INFO] :: [P1 Button D     ] [p1 fire 4      ] nSwitch.nCode: 0x4083 - assigned to key [RetroPad X Button        ] on port  0.
RetroArch [libretro INFO] :: [P2 Coin         ] [p2 coin        ] nSwitch.nCode: 0x0007 - assigned to key [RetroPad Select Button   ] on port  1.
RetroArch [libretro INFO] :: [P2 Start        ] [p2 start       ] nSwitch.nCode: 0x0003 - assigned to key [RetroPad Start Button    ] on port  1.
RetroArch [libretro INFO] :: [P2 Select       ] [p2 select      ] nSwitch.nCode: 0x0005 - assigned to key [RetroPad Select Button   ] on port  1.
RetroArch [libretro INFO] :: [P2 Up           ] [p2 up          ] nSwitch.nCode: 0x4102 - assigned to key [RetroPad D-Pad Up        ] on port  1.
RetroArch [libretro INFO] :: [P2 Down         ] [p2 down        ] nSwitch.nCode: 0x4103 - assigned to key [RetroPad D-Pad Down      ] on port  1.
RetroArch [libretro INFO] :: [P2 Left         ] [p2 left        ] nSwitch.nCode: 0x4100 - assigned to key [RetroPad D-Pad Left      ] on port  1.
RetroArch [libretro INFO] :: [P2 Right        ] [p2 right       ] nSwitch.nCode: 0x4101 - assigned to key [RetroPad D-Pad Right     ] on port  1.
RetroArch [libretro INFO] :: [P2 Button A     ] [p2 fire 1      ] nSwitch.nCode: 0x4180 - assigned to key [RetroPad B Button        ] on port  1.
RetroArch [libretro INFO] :: [P2 Button B     ] [p2 fire 2      ] nSwitch.nCode: 0x4181 - assigned to key [RetroPad A Button        ] on port  1.
RetroArch [libretro INFO] :: [P2 Button C     ] [p2 fire 3      ] nSwitch.nCode: 0x4182 - assigned to key [RetroPad Y Button        ] on port  1.
RetroArch [libretro INFO] :: [P2 Button D     ] [p2 fire 4      ] nSwitch.nCode: 0x4183 - assigned to key [RetroPad X Button        ] on port  1.
RetroArch [libretro INFO] :: [Reset           ] [reset          ] nSwitch.nCode: 0x003d.
RetroArch [libretro INFO] :: [Test            ] [diag           ] nSwitch.nCode: 0x003c - controlled by core option.
RetroArch [libretro INFO] :: [Service         ] [service        ] nSwitch.nCode: 0x000a - WARNING! Button unaccounted.

Retroarch config has player 1 and 2 using a separate joypad index: retroarch.cfg.txt

barbudreadmon commented 7 years ago

The output you sent is fine, so it definitely seems like an issue about how retroarch read your controllers. Do you have remap files in "~/.config/retroarch/config/remaps" ?

I'll give you a summary on how i setup my controllers in retroarch. Make sure both controllers work correctly through jstest (i think it is part of games-util/joystick in portage)

I always use udev+autoconfig (i'm not sure autoconfig works with other drivers), it works like a charm once you get used to it, and it's mandatory if you use different controller models like i do. So i have the following in my retroarch config : input_autodetect_enable = "true" input_driver = "udev" input_joypad_driver = "udev"

Then i create a .cfg file in the autoconfig folder ("~/.config/retroarch/autoconf" for you), here is an example : input_driver = "udev" input_vendor_id = 3727 input_product_id = 12304 input_b_btn = "0" input_y_btn = "3" input_select_btn = "5" input_start_btn = "7" input_up_btn = "12" input_down_btn = "14" input_left_btn = "15" input_right_btn = "13" input_l_x_plus_axis = "15" input_l_x_minus_axis = "13" input_l_y_plus_axis = "12" input_l_y_minus_axis = "14" input_a_btn = "1" input_x_btn = "4" input_l_btn = "6" input_r_btn = "2" input_enable_hotkey_btn = "9" input_menu_toggle_btn = "7" input_exit_emulator_btn = "5" input_toggle_fast_forward_btn = "6"

I get the button values from jstest. And i get vendor_id and product_id from lsusb (i only need to convert hexdecimal to decimal), i'm not sure how you are supposed to get vendor_id+product_id in your specific setup though.

That's the most i can help you with, for any more help you'll need to ask on libretro's forum, retroarch's git or uinput-mapper's git.

j-m-harris commented 7 years ago

Excellent, the critical change for me was to use the 'udev' input driver. Now it's all working as expected. Thanks!