Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Wii U Pro controller analog sticks not recognized by Mame in RetroPie  (Read 4646 times)

0 Members and 1 Guest are viewing this topic.

ogbuehi

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:July 19, 2017, 07:20:46 pm
  • I want to build my own arcade controls!
Pi Model: 3
Power supply: 2.5A
RetroPie version: 4.2.7
Built from: ??
USB devices: Rii Keyboard Mouse Combo model RT518 (wireless bluetooth) and Mayflash Wireless Wii U Pro Controller to PC adapter
Controller: Mame

I apologize if this seems like a simplistic request but I'm fairly new to the the Pi world. 
The issue that I'm having with the Mame is that I can't get it to recognize the analog sticks when I go into the in-game Mame setup menu (the one you get to by pressing tab on a keyboard).  Some things I've figured out based on my own tinkering, Google and Youtube searches:
1) There are apparently different versions/types of Mame. On my other Pi (I have 3), that version of Mame was easy pretty simple to map my Wii U analog sticks in the Mame  GUI setup menu.  I notice my problem Pi however, that GUI menu looks different and it doesn't recognize the analog sticks when I try to map them (it does recognize the D-pad and the other buttons).

2) I have not been able to truly determine what version Mame I have on the Pi's.

3) I'm open to the idea that I may have to just try and install that same version of Mame on the Pi that I had no issues with.  However, I've realized that, through research, the roms may not work with the different version of Mame.  I'm not super comfortable trying to delete the emulator and installing the different version along with moving all the roms (2k+).

4) If it's possible, I'd like to just edit a config file with commands/text for the inputs.  I've done this with RetroArch because the GUI setup menu for some reason would not recognize the start button on the Wii U controller (annoying problem because I couldn't get the standard start&select button combo to exit the emulator working).  I simply figured out (through some heavy research) how to edit the config file with the necessary text to force RetroArch recognize the start button.  What I haven't found is exactly what config file I would need to edit for Mame (I've been looking through all the config files I can find on my Pi that are Mame related with no success).  I also haven't found the text you would need to input if I found the right config file to edit.

I know that was a mouthful but I appreciate any help anyone can offer.  Thanks in advance.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
First off: welcome to the board.

I have a few background questions:

1. Are you using EmulationStation or AttractMode or some other front-end?

2. Did you download a pre-made image? If so: which one?

3. What folder did you put your roms in?

4. Are you comfortable using the command line?

5. What version of MAME roms are you using?


To answer your questions/comments:
1. Yes. That's correct. The Pi/Retroarch supports a handful of Mame versions out of the box. The Libretro versions are all pretty similar. Mame4All-Pi and AdvanceMame are a bit different. You can find more about different supported versions here: https://github.com/RetroPie/RetroPie-Setup/wiki/MAME#mame4all-pi

2. It would help to know how you set up your pi. Pre-made image, compiled yourself, etc. In a standard  Retroarch/EmulationStation configuration, you could simply hit the A button as you start a game up to find out what version is being used for the particular rom you're launching (as well as make some configuration changes)

3. Unless you set it up from scratch... it's probably already on there. You might still have to move stuff or change a configuration, but we can figure that out later.

4. To help with determining buttons... you might need to use JSTest.

In any case, I'll need more detail to get going. Right now there are a lot of different possibilities I need narrowed down.


Raspberry Pi, AttractMode, and Skeletor enthusiast.

ogbuehi

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:July 19, 2017, 07:20:46 pm
  • I want to build my own arcade controls!
Thanks and I want to thank you for your help.  I’ve been searching the internet all over and I realized that this emulator world is kind of a niche.

To answer your questions:

1. Are you using EmulationStation or AttractMode or some other front-end?
Answer:  I use EmulationStation.  I do have the ability to use Attractmode but haven’t used it.

2. Did you download a pre-made image? If so: which one?
The pre-made image I’m using is a PiPiggies 128GB image.  I’m using this one because it had the Atari 5200 and Coleco emulators.  The other image that I have no issue with is Reys 128GB image.  But it doesn’t have the all the emulators I want.

3. What folder did you put your roms in?
They’re all in a folder called mame-libretro.

4. Are you comfortable using the command line?
I’m comfortable with the command line. I usually just need to know what config file to edit, what to edit it with and how to get to it (sounds like everything!!).

5. What version of MAME roms are you using?
I have not been able to truly determine for sure what version of roms I’m using.  But based on the RetroArch GUI I pulled up in game I think it’s Mame 2010 .169?

Also to address your other RFI’s:
4. To help with determining buttons... you might need to use JSTest.
I’ve never used JSTest but does it produces different results other than what I gathered from emulationstation below?

Button layout

D-pad up: Hat 0 up
D-pad down: Hat 0 down
D-pad left: Hat 0 left
D-pad right: Hat 0 right
Start: Button 9
Select: Button 8
A: Button 2
B: Button 1
X: Button 3
Y: Button 0
Left Shoulder: Button 4
Right Shoulder: Button 5
Left Trigger: Button 6
Right Trigger: Button 7
Left Analog stick (press down): Button 10
Right Analog stick (press down): Button 11
Left Analog up: Axis 1-
Left Analog down: Axis 1+
Left Analog left: Axis 0-
Left Analog right: Axis 0+
Right Analog up: Axis 3-
Right Analog down: Axis 3+
Right analog left: Axis 2-
Right Analog right: Axis 2+

Again, thanks for your help.

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
I checked the Pi Piggies image, and it looks like it has Mame2010. According to the RetroPie Wiki (https://github.com/RetroPie/RetroPie-Setup/wiki/MAME) those ought to be Mame .139 roms. I *think* Rey's image uses Advmame. Typically, regular Mame versions have a black or clear tab screen, and Advmame has a white tab screen. Advame uses .94 or .106 roms, so the roms you have there aren't interchangeable. Some might happen to work in Advmame if they haven't been updated in a long time. You can always try.

I'm sure Piggies image has thousands of roms, so I know it's not realistic to check them all. A better bet would be to remove them all, and just get the roms for games you actually want... a list that probably tops out orders of magnitude smaller than what's included. There's a list of all killer no filler games here on the board. It's a good place to start. http://forum.arcadecontrols.com/index.php/topic,149708.0.html

Anyway, that doesn't fix the problem... just an offhand suggestion.  ;D

Regarding switching... you shouldn't need to delete anything Retroarch includes multiple versions of Mame (including Advmame). You can probably just mv or cp the roms to the mame-advmame folder and restart. If Emulation is setup like the default, you won't need to do anything, it should update it's rom list for you (IIRC).

Regarding JSTest vs. EmulationStation, what you have there is probably good enough.

The mapping for joystick controls in libretro mame versions is the same as everything else in retroetrarch (by default). There's the main CFG file here:

/opt/retropie/configs/all/retroarch.cfg
and then mame specific version here:
/opt/retropie/configs/mame-libretro/retroarch.cfg

You can use the same mapping in the main retroarch.cfg file to make mame-specific configs in the mame-libretro retroarch.cfg file.

Quote
I also haven't found the text you would need to input if I found the right config file to edit.

In the past, the method I used to find the right key mappings was to use the tab menu and then map ALL of the controls to different commands in some specific rom. Then I could find that correct text/mapping of those controls and copy it elsewhere. You may need to edit the analog controls setting in Mame2010 to get your sticks to work.

If you end up using advmame, it's located /opt/retropie/configs/mame-advmame/MAME VERSION HERE. There's 2 or 3 versions available depending on your retropie version. Some sample mapping in my admame-0.94.rc file looks like this (several joysticks and a keyboard):

Quote
qbert/input_map[p1_left] joystick_digital[1,0,0,1] joystick_digital[1,0,1,1]
qbert/input_map[p1_right] joystick_digital[1,0,0,0] joystick_digital[1,0,1,0]
qbert/input_map[p1_down] joystick_digital[1,0,0,1] joystick_digital[1,0,1,0]
qbert/input_map[p1_up] joystick_digital[1,0,0,0] joystick_digital[1,0,1,1]
input_map[p1_button1] joystick_button[1,0] or keyboard[0,lcontrol]
input_map[p1_button2] joystick_button[1,1] or keyboard[0,lalt]
input_map[ui_configure] joystick_button[0,6] or keyboard[0,tab]
input_map[ui_cancel] keyboard[0,esc] or joystick_button[0,5]
input_map[start1] joystick_button[1,6] or keyboard[0,1]
input_map[coin1] joystick_button[0,4] or keyboard[0,5]
input_map[ui_up] joystick_digital[1,0,1,1] or keyboard[0,up]
input_map[ui_down] joystick_digital[1,0,1,0] or keyboard[0,down]
input_map[ui_left] joystick_digital[1,0,0,1] or keyboard[0,left]
input_map[ui_right] joystick_digital[1,0,0,0] or keyboard[0,right]
input_map[ui_select] joystick_button[1,6] or keyboard[0,enter]
input_map[p1_up] joystick_digital[1,0,1,1] or keyboard[0,up]
input_map[p1_down] keyboard[0,down] or joystick_digital[1,0,1,0]
input_map[p1_left] joystick_digital[1,0,0,1] or keyboard[0,left]
input_map[p1_right] joystick_digital[1,0,0,0] or keyboard[0,right]
galaga/input_dipswitch[coinage] free_play
excitebk/input_dipswitch[coinage] free_play
mspacman/input_dipswitch[coinage] free_play
mpatrol/input_dipswitch[coinage_mode_1] free_play
mpatrol/input_dipswitch[coin_a_mode_2] free_play
gyruss/input_dipswitch[coin_b] free_play
gyruss/input_dipswitch[coin_a] free_play


quick reference: All of the locations for the config files are listed on this page: https://github.com/RetroPie/RetroPie-Setup/wiki/MAME
Raspberry Pi, AttractMode, and Skeletor enthusiast.

ogbuehi

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:July 19, 2017, 07:20:46 pm
  • I want to build my own arcade controls!
Apologies for the late response.  Working on a power switch for each of my pi's.

The ADVMAME tab menu has white letters and a dark grayish background.  MAME2010 tab menu has slightly yellowish lettering with a blue background.  Working with ADVMAME, I have no issues mapping the controller's analog sticks.  (Needed for games like Smash TV).  But I'm trying to do the exact same thing for MAME 2010.  The GUI interface for MAME 2010 doesn't recognize the analog sticks.  Retroarch and ES recognize the analog sticks.  Now if I could find the config file for MAME 2010 that has the controller command lines and what the commands are for controller inputs for MAME 2010 (like how you found in ADVMAME), I feel like that would solve my problem. Or at least that's my next step, before I try the shaky idea of trying to remove MAME 2010, and install ADVMAME. :dizzy:

mahuti

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 2757
  • Last login:March 02, 2022, 09:51:19 pm
  • I dare anything! I am Skeletor!
I'll see if I can look something up for you on the configs.

Meanwhile, you shouldn't have to install anything. You'll just need to put roms in the right spot... and a few other things... but Advmame should already be installed.

Speaking of power switches... I use a momentary with the input wire on 21 (the last one next to the usb ports) and the ground on it's mate. In my autostart.sh I call a script:

/opt/retropie/configs/all/autostart.sh

Code: [Select]
python /home/pi/.off-button.py &
emulationstation

the contents of that script:
 
Code: [Select]
#!/bin/python

import RPi.GPIO as GPIO
import os

gpio_pin_number=21
# number may be different in other Pi versions. This is for Pi3
# pin must be an input so as to not short the Pi

GPIO.setmode(GPIO.BCM)

GPIO.setup(gpio_pin_number, GPIO.IN, pull_up_down=GPIO.PUD_UP)

try:
    GPIO.wait_for_edge(gpio_pin_number, GPIO.FALLING)
    #Use falling edge detection to see if pin is pulled low to avoid repeated polling
    os.system("sudo shutdown -h now")
except:
    pass

GPIO.cleanup()

That's the cleanest way I've figured out to setup a power switch. Sounds like you've got a method... just posting this here for reference. Anyway, i'll see what I can find out about the analog controls.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

ogbuehi

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 4
  • Last login:July 19, 2017, 07:20:46 pm
  • I want to build my own arcade controls!
I appreciate the heads up for the switch.  I already utilized a board that would allow a professional fit with a pre-made case and had the circuit for use of an IR receiver so I can use a remote control to power on/off the pi.