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: Mapping two buttons to the same function?  (Read 7634 times)

0 Members and 1 Guest are viewing this topic.

PatentGeek

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:April 05, 2021, 02:35:31 pm
  • RPi4 + RetroPie + 2-Player Widescreen Bartop
Mapping two buttons to the same function?
« on: January 04, 2021, 01:17:54 pm »
I'm running RetroPie and my cabinet has pinball buttons on the sides, in addition to the usual joystick and 6-button layout. I want to use the pinball buttons for pinball games, obviously, but those games usually operate the flippers using Left-D and A. Is there any way I can also map the side pinball buttons to perform those same functions?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 08:55:04 am
  • Designated spam hunter
Re: Mapping two buttons to the same function?
« Reply #1 on: January 04, 2021, 03:03:16 pm »
I'm running RetroPie and my cabinet has pinball buttons on the sides, in addition to the usual joystick and 6-button layout. I want to use the pinball buttons for pinball games, obviously, but those games usually operate the flippers using Left-D and A. Is there any way I can also map the side pinball buttons to perform those same functions?
1. Make a list of the pinball games/tables/emulators you want to play.

2. Check what inputs they are looking for and whether they can all be mapped to the same controls.

Depending on what type of encoder, wiring, and microswitches you are using, there are several possible approaches.

Hardware approach:
Wire the two pinball buttons in parallel with the two desired MAME inputs or if "MAME Button" has a 3-tab microswitch you can use the "backwards wiring" trick used on "MAME Button" and "Pinball Button" in this Visual Pinball diagram.

Advantage: Works with any encoder.
Disadvantage: The pinball buttons are tied to those two inputs.  Any pinball game/table/emulator you want to run must be configured to use those inputs.



Software approach:
Wire the pinball buttons to two unused encoder inputs.

Advantage: Allows you to set those inputs to work with pinball games/tables/emulators that can't be reconfigured, if you run into that problem.
Disadvantage: Only works right with encoders that can be programmed to work with the pinball games/tables/emulators that can't be reconfigured.


Scott

PatentGeek

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:April 05, 2021, 02:35:31 pm
  • RPi4 + RetroPie + 2-Player Widescreen Bartop
Re: Mapping two buttons to the same function?
« Reply #2 on: January 04, 2021, 03:46:02 pm »
Well, I definitely want to go the software route -- I don't want to lose the ability to remap those buttons. But that's what I'm trying to get a bit more information about. When running RetroPie with Emulation Station, how do I map the side buttons to perform the same functions as the Left-D and A, respectively? The controller configuration wizard only lets you assign a single button per function.

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 08:55:04 am
  • Designated spam hunter
Re: Mapping two buttons to the same function?
« Reply #3 on: January 04, 2021, 04:46:30 pm »
I'm not the best one to answer your question so I'll ask for two (hopefully useful) clarifications and allow someone with more knowledge of RetroPie and Emulation Station to take it from there.

1. Make a list of the pinball games/tables/emulators you want to play.
We don't know this info so it's harder to give you relevant advice.

It might be helpful to be more specific about the systems and games you're interested in.
i.e. I want to play Pinball (NES), Devil Crush/Jaki Crush (SNES), Dragon's Fury (Megadrive) . . .

Depending on what type of encoder, wiring, and microswitches you are using
We don't know these details so we can't give relevant advice.


Scott

PatentGeek

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:April 05, 2021, 02:35:31 pm
  • RPi4 + RetroPie + 2-Player Widescreen Bartop
Re: Mapping two buttons to the same function?
« Reply #4 on: January 04, 2021, 05:58:24 pm »
Sorry, happy to provide more details. As one example, I’d like to play Pinball Dreams on SNES. The controls and encoders are just a basic EG STARTS USB kit off Amazon.

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!
Re: Mapping two buttons to the same function?
« Reply #5 on: January 04, 2021, 05:58:37 pm »
Using Emulation Station you can't do what you want. You can't map 2 buttons to the same thing. Can't even hard code it in a config file and make it work. I have a love/hate relationship with Retropie/Retroarch because of this... I think its a terrible design decision that I've never understood. Retroarch and Retropie are targeted towards off the shelf gamepads, not cabinets. Its a very rigid, system compared to the mappability of MAME, and just doesn't allow mixing and duplicating controls.

If using MAME you can remap like you normally would As long as you have RA set to allow the use of the MAME config tab. This only works for specific versions of Libretro MAME by the way.

If using other emulators you are likely out of luck going the software route. Hardware would be a better way to go.

That said, I'd tend to go the hardware route for flipper buttons anyway.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

PatentGeek

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:April 05, 2021, 02:35:31 pm
  • RPi4 + RetroPie + 2-Player Widescreen Bartop
Mapping two buttons to the same function?
« Reply #6 on: January 04, 2021, 06:10:05 pm »
Thank you, mahuti. That is disappointing but not surprising. I could still do a game-specific mapping though, right? To map only the pinball buttons to those functions?
« Last Edit: January 04, 2021, 06:13:49 pm by PatentGeek »

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!
Re: Mapping two buttons to the same function?
« Reply #7 on: January 04, 2021, 06:10:50 pm »
FYI, you can try:

try editing the config file retroarch.cfg;

input_player1_a_btn = "1"
input_player1_b_btn = "1"

Something like that. You should also try it from the RetroArch menu:

Step 1. open the Retroarch menu within game
2: It'll open in the quick menu. Back out of that to the top level menu,
3. then go to settings > inputs > port 1 binds (that's player 1) and try to set the keys there.
4. then save by either:
4a. back out to the top menu and go down to configuration > save current configuration. this will save a file to /opt/retropie/configs/snes (or whatever)/retroarch.cfg
4b. back out to the top menu, go to the quick settings > overrides > save game overrides. this will save a file to /opt/retropie/configs/all/retroarch/config/EMULATORNAME/ROMNAME.cfg (or .opt or something like that)

In the past this hasn't worked for me, but who knows, maybe they've changed things. Let me know how it goes.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

PatentGeek

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 7
  • Last login:April 05, 2021, 02:35:31 pm
  • RPi4 + RetroPie + 2-Player Widescreen Bartop
Mapping two buttons to the same function?
« Reply #8 on: January 04, 2021, 06:13:23 pm »
I’ll give that a try. Thanks again!

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Today at 08:55:04 am
  • Designated spam hunter
Re: Mapping two buttons to the same function?
« Reply #9 on: January 04, 2021, 06:34:26 pm »
The controls and encoders are just a basic EG STARTS USB kit off Amazon.
That's a gamepad encoder.

There's no way to change the output for a given input port like you can with an IPac or other programmable encoder.

If you can't sucessfully edit the config file like Mahuti suggested it looks like the only remaining possibility is the hardware approach.


Scott

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7901
  • Last login:Yesterday at 10:28:40 am
Re: Mapping two buttons to the same function?
« Reply #10 on: February 05, 2021, 05:58:57 pm »
Using Emulation Station you can't do what you want. You can't map 2 buttons to the same thing. Can't even hard code it in a config file and make it work. I have a love/hate relationship with Retropie/Retroarch because of this... I think its a terrible design decision that I've never understood. Retroarch and Retropie are targeted towards off the shelf gamepads, not cabinets. Its a very rigid, system compared to the mappability of MAME, and just doesn't allow mixing and duplicating controls.

If using MAME you can remap like you normally would As long as you have RA set to allow the use of the MAME config tab. This only works for specific versions of Libretro MAME by the way.

If using other emulators you are likely out of luck going the software route. Hardware would be a better way to go.

That said, I'd tend to go the hardware route for flipper buttons anyway.

This annoys me to death too.  So what do people do when they are playing something like Punch-Out! for NES?  The Start button is the Star Punch and the admin buttons are usually on the front of the cabinet or wherever - not easily accessible during a game where timing matters... I guess they just suffer through it? 

It's so stupid that if you have a 6 button layout you can't remap Start and Select to any one of the FOUR unused buttons.

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!
Re: Mapping two buttons to the same function?
« Reply #11 on: February 05, 2021, 06:17:15 pm »
Quote
So what do people do when they are playing something like Punch-Out! for NES?

For me... I just gave up on having console systems on an arcade machine. I figure I'll just have to suffer through only having 300 arcade games to play on the cabinet.

I ended up making a console system on the TV as well, and RA works fine for the gamepad. Since TVs are freaking enormous these days anyway, I can just wrap the console output in a TV overlay with a warped tv screen shader and get the full retro console experience.
Raspberry Pi, AttractMode, and Skeletor enthusiast.

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7901
  • Last login:Yesterday at 10:28:40 am
Re: Mapping two buttons to the same function?
« Reply #12 on: February 05, 2021, 11:00:07 pm »
Quote
So what do people do when they are playing something like Punch-Out! for NES?

For me... I just gave up on having console systems on an arcade machine. I figure I'll just have to suffer through only having 300 arcade games to play on the cabinet.

I ended up making a console system on the TV as well, and RA works fine for the gamepad. Since TVs are freaking enormous these days anyway, I can just wrap the console output in a TV overlay with a warped tv screen shader and get the full retro console experience.
You and me both.  Console games just don’t work in an arcade cabinet for the most part.


Sent from my iPad using Tapatalk

javeryh

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7901
  • Last login:Yesterday at 10:28:40 am
Re: Mapping two buttons to the same function?
« Reply #13 on: February 10, 2021, 10:53:39 am »
So I was able to easily solve my issue of mapping same function to two different buttons...  I don't know why I didn't figure this out earlier.  I'll use my Punch-Out!! (NES) example.  My bartop has a joystick and 6 buttons in curved SF layout with 4 admin buttons on the front of the CP and not easily accessed during gameplay. 

My initial setup was this ("*" is a button that is not used):

* * *
B A *

And on the front panel it was this:

* --- Select - Start --- *

So to play Punch-Out!! properly, I'd have to hit the Start button on the front if the CP for a Star Punch.  Not ideal.  To fix this, whil the ROM is running hit your hotkey (Select in my case) and whatever button is mapped to "X" (this is the middle button on my top row).  This opens Retroarch in the game.  Scroll down to "Controls" and then scroll down to where the buttons are assigned and moving left or right I changed button "2" (third button on my bottom row) to "Start"  so now there were two buttons that are assigned to "Start".  Once that is done, go up and select "Save Game Remap File" (or "Save Core Remap File" is you want to apply this change to ALL games in the emulator).  Exit back out to the game and you will see your new control layout works.

I tested the Star Punch with the original Start button on the front of the CP and the remapped Start button that is now the third button on the bottom row and BOTH performed as expected.  So now for Punch-Out!! the controls are:

* * *
B A Start

And on the front panel it remains this:

* --- Select - Start --- *

Easy!  Now I can go through and make this change to other NES games that utilized the Start button like Zelda, etc.  I should note that I could not figure this out with an iPAC2 as my encoder but I switched to a Zero Delay (gamepad) encoder and it works great.