Setting up a Ipac2
-
@riverstorm said in Setting up a Ipac2:
I always considered A-B-X-Y as labels and nothing more really. It probably started as an A-B joystick (like NES) and then X-Y was added later (like SNES). I imagine a Wiki has the history behind the ABXY naming convention.
Here's the story on the RetroPad abstraction: https://buildbot.libretro.com/docs/specs/retropad/
-
@caver01 said in Setting up a Ipac2:
I am talking about the code level. I realize it is all dynamic, but Button 1 in MAME is coded, whether it represents Jump or Fire is ROM dependent, but in the General Settings, there is a universal default. On the retroarch side, the same applies for Button A for example. When a MAME Libretro core is built, some coder has to make a choice about what button A in retroarch maps to in MAME, regardless of how a user actually choses to configure their controls. It sounds like A --> Button 1, but I'd like to see the list of all of them. That way, if we build a retroarch.cfg file for IPAC users, assuming they leave the keystrokes for their IPAC default, we can ensure that those MAME mappings actually do lead through retroarch and into the correct MAME buttons.
There is a very active discussion about this topic among libretro developers on github right now. I know you have a lot of experience with controls, you may have something to contribute: https://github.com/libretro/fbalpha/issues/141
-
@markwkidd said in Setting up a Ipac2:
Here's the story on the RetroPad abstraction: https://buildbot.libretro.com/docs/specs/retropad/
Good info. Do you know if there is a reference to how the abstracted RetroPad controls were mapped to the MAME buttons in lr-mame2003? If I knew where to look I suppose it is probably in one of the source files. Having that, I think we really could build a standard reference .cfg for IPAC owners, at least where defaults are used.
-
@caver01 said in Setting up a Ipac2:
@markwkidd said in Setting up a Ipac2:
Here's the story on the RetroPad abstraction: https://buildbot.libretro.com/docs/specs/retropad/
Good info. Do you know if there is a reference to how the abstracted RetroPad controls were mapped to the MAME buttons in lr-mame2003? If I knew where to look I suppose it is probably in one of the source files. Having that, I think we really could build a standard reference .cfg for IPAC owners, at least where defaults are used.
I think it's somewhere in here: https://github.com/libretro/mame2003-libretro/blob/master/src/input.c
You may need to refer to this: https://github.com/libretro/mame2003-libretro/blob/master/src/input.h
I will try to look for the specific place in the code once I have some time. @dankcushions might know that answer right off the bat though.
-
@markwkidd said in Setting up a Ipac2:
There is a very active discussion about this topic among libretro developers
Thanks for that link. I think my voice would be drowning in hand-held gamepad users, as that seems to align with the way the abstraction was conceived which is fine, but when the dust settles, there can be a standard MAME mapping for folks who use keyboard controllers and organize their buttons as one might expect on an arcade control panel: first button 1, then button 2, and so on. A typical arcade layout won't resemble the most common gamepad button positions, which is why there is so much discussion.
-
@caver01 said in Setting up a Ipac2:
@markwkidd said in Setting up a Ipac2:
There is a very active discussion about this topic among libretro developers
Thanks for that link. I think my voice would be drowning in hand-held gamepad users, as that seems to align with the way the abstraction was conceived which is fine, but when the dust settles, there can be a standard MAME mapping for folks who use keyboard controllers and organize their buttons as one might expect on an arcade control panel: first button 1, then button 2, and so on. A typical arcade layout won't resemble the most common gamepad button positions, which is why there is so much discussion.
As someone who regularly uses mame 2003 with SNES controllers and an X-Arcade control panel, I can only sigh. :) 'Oh, the huge manatee'
Edit: But to be more serious @caver01 , I think there is consensus developing that the libretro arcade cores should provide an option to switch between two layouts: the SNES retropad mapping and a standardized arcade control panel layout with certain coded exceptions for games/arcade drivers where that is not appropriate.
I think you are right that there is more expertise in that crowd with the SNES format than the arcade buttons.
-
@markwkidd said in Setting up a Ipac2:
There is a very active discussion about this topic among libretro developers on github right now. I know you have a lot of experience with controls, you may have something to contribute: https://github.com/libretro/fbalpha/issues/141
Uff-da, the that looks like it's going to take some programming skills and know how of the internal workings. I think that would be incredibly handy for the casual user that mainly focuses on gaming vs. the group that heavily modifies everything manually. Honestly I spend more tinkering than actually playing...like a 70/30...kind of sad! ;)
-
WOW this thread got so long and a little hard to decipher.
I greatly appreciate all the discussion here. I still feel confused and dumb.
So, I still am unsure what to do when it comes to NON-MAME4ALL and NON-ADVMAME emulators such as NEOGEO or FBA.
I am using a Raspberry Pi 3, 32 gig SD class 10 card
When I first installed Retropie I did go through the initial setup which says "No Gamepads Detected" "Hold a button on your device to configure it."I hold down the button P1 which is wired to the iPac2's player1 button. This is a keyboard command of the number 1. This triggers the setup sequence for the key mappings for Emulation Station Front End.
My button layout is very rudimentary.
I have two joysticks each with 6 buttons like this:
UP SW1 SW2 SW3
LEFT RIGHT
DOWN SW4 SW5 SW6I have a Player One and a Player Two button
Button P1 - Button P2I have a working coin door wired to the area labeled 1coin. The iPac2 translates this to 5.
When going through the initial startup configuration RetroPie setup asks for NON-Keyboard items such as Left Analog Stick. Of course the whole setup is designed to be used with a gamepad not a keyboard or keyboard encoder I do realize.
The problem is then what button on the setup should be pressed to correlate to what button press on the setup screen?
QUESTION 01
I get that up on Player 1 joystick is up and down on Player 1 joystick is down. What should each of the 6 Player one action buttons be mapped to when it starts asking for A, B, X, Y, L1 ETC?QUESTION 02
How do you get non MAME4ALL / ADVMAME emulators to accept P1+P2 (keyboard ESC) to exit the game? I found that with my current setup I can get into FBA just not out of it without rebooting.QUESTION 03
How do you get Player 2's Joystick and buttons to work? This is something I think that gamepad users have had issues with as well.Thanks again for putting up with this. I am sure that these questions may have been answered in some way and I just didn't see it.
BC -
There is much to unpack here, but great questions. First:
@battlecat said in Setting up a Ipac2:
So, I still am unsure what to do when it comes to NON-MAME4ALL and NON-ADVMAME emulators such as NEOGEO or FBA.
We have to get clear about the fact that there are two fundamentally different kinds of emulators in RetroPie
- Retroarch/Libretro cores. These are the emus that start with
lr-
- Standalone
#1 emulators are all running inside the Retroarch framework. Consequently, you can configure their controls using retroarch.cfg files. Most noteably, this one:
/opt/retropie/configs/all/retroarch.cfg
which is the effective base configuration file for ALL emulators in category #1. Then, the other config folders allow additional retroarch.cfg files which can override this default.
#2 emulators have their own way of doing things. AdvanceMAME is a good example. Notice how AdvanceMAME has everything configured its advmame.rc file? AdvanceMAME configuration doesn't have anything to do with retroarch configs.So, before we tackle the other emulators, we need to remember the distinction between the libretro ones and the standalone. Here's the thing. . . it would be a whole lot easier if all we had were libretro cores because they can share configs (while allowing individual overrides). But the reality is, people like some of the standalones too because they sometimes offer better performance or different features (or even different ROMset compatibility). There's no getting around it--we have a complicated environment, but each emu can be grouped into either #1 or #2.
So, when we start to move forward with FBA (or even NES, SNES emulators), we have to know exactly which category of emulators we are talking about.
QUESTION 01
I get that up on Player 1 joystick is up and down on Player 1 joystick is down. What should each of the 6 Player one action buttons be mapped to when it starts asking for A, B, X, Y, L1 ETC?Your joystick layout sounds exactly like mine, including the positions of SW1 SW2 SW3, SW4 SW5 SW6. So, for me, I have them mapped to ABX,YLR respectively. I did this on first-run just like you did, but to ensure that it is set that way for every libretro core (emulators in category #1 above) I added the mapping to
/opt/retropie/configs/all/retroarch.cfg
like THIS POST ABOVE.QUESTION 02
How do you get non MAME4ALL / ADVMAME emulators to accept P1+P2 (keyboard ESC) to exit the game? I found that with my current setup I can get into FBA just not out of it without rebooting.There is a bit of confusion here. First of all, when dealing with category #1 emulators, you can configure a hotkey for exit. By default, it's P1_Start + P1_Select(coin). It is note P1_Start + P2_Start. Furthermore, pressing the hotkey combination does not send "escape". On default IPAC configuration, it would be like pressing "num1" + "num5", or P1_Start + P1_Coin. So, for you, if configured with default, your coin deposit switch maps to SELECT. This can be inconvenient for those of us building arcade cabinets, so it is handy to dedicate some OTHER key to the hotkey, or to disable the hotkey altogether
input_enable_hotkey = nul
and configure another switch on the IPAC to send the ESC key and then setinput_exit_emulator = escape
which would allow single button exit. Remember, we are talking about Libretro emulators category #1 ONLY with this.Now, hotkeys etc. don't apply to #2 standalone emus, so AdvanceMAME will need to have its own exit setup. By default, it happens to be the escape key which is why it makes sense to do the same thing for #1 emulators. I repeat--you don't get hotkeys in AdvanceMAME--because it is not a Libretro core emulater, it's standalone.
When you reference MAME4All, are you talking about "mame4all-pi" emulator? Because that too is STANDALONE. Hotkeys don't apply.
In conclusion to Question 2, I think you need to think about the fact that pressing P1+P2 is not keyboard ESC at all, it's "num1"+"num2" which is probably why it isn't working the way you expect.
QUESTION 03
How do you get Player 2's Joystick and buttons to work? This is something I think that gamepad users have had issues with as well.For this, again, you have to consider what kind of emulator you are using. If Libretro core #1 above, you can configure your keys in
/opt/retropie/configs/all/retroarch.cfg
as I have in the post I linked to above (year ago this thread). All of my Player 2 mappings are there, but you will have to double-check that the keys I have mapped to the switches on my IPAC are the same as yours. If not, replace as needed, but note that each of my keys are specified in my retroarch.cfg to correspond to Start, Select(coin), UP,DOWN,LEFT,RIGHT, ABX,YLR just like player 1.Now, if you are trying to map Player 2 for standalone emulators, well, you will need to specify the keys you use inside each standalone emulator's configuration (i.e. AdvanceMAME's
advmame.rc
file).Sorry, I wish it was easier, but I think the confusion lies in the type of emulators you are using (#1 or #2 above). Note that when you reply with more specific examples, like when you are trying to configure FBA, it is CRUCIALLY important to specify EXACTLY what emulator you are trying to setup. Is it lr-fbalpha or PiFBA? The same is true for other emulators. It's not enough to just throw out the system mane (like NES) unless you are clear about which emulator you are using to run NES--as the approach to configuring keys will differ if it is libretro or standalone.
- Retroarch/Libretro cores. These are the emus that start with
-
@caver01 said in Setting up a Ipac2:
In conclusion to Question 2, I think you need to think about the fact that pressing P1+P2 is not keyboard ESC at all, it's "num1"+"num2" which is probably why it isn't working the way you expect.
I think we do some things differently. By default P1+P2 (1+2) send the escape key with IPAC's. That's why I match Libretro hotkeys so I can exit standalone and Libretro cores with the same set of keys.
I think it's important to understand what @caver01 wrote so you know when it's Libretro or standalone and how they effect each other. Once you get the basics down then dive deeper into individual emulators and game specific configs. It's important to understand the hierarchy of input configuration.
I also have the same button organization as you guys except the rows are reversed and in a Hori layout (slightly offset). When I configure my input I use either the keyboard or IPAC because as once configured both work the same.
- Joystick/Keyboard - Up, Down, Left, Right
- Start - 1
- Select - 5
- A - lctrl (lalt if you want to swap A&B to match a controller)
- B - lalt (lctrl if you want to swap A&B to match a controller)
- X - space
- Y - lshift
- Left Shoulder - z
- Right shoulder - x
The rest of the keys I hold the space key down and skip defining any other keys because I only have 6 buttons. Plus player 1 & 2 start (1 & 2) and coin in (5).
To get escape to work as 1+2 I modify /opt/retropie/configs/all/retroarch.cfg
- input_enable_hotkey = "num1"
- input_exit_emulator = "num2"
I do the A&B button swap mentioned in the input configuration so my arcade control panel matches a controller. When I play Mario Bros. in NES with my arcade control panel buttons 1 & 2 match a controller. This works with several older consoles like Atari, NES or SNES but not for example a N64 that requires an analog joystick vs. an arcade joystick or a more complex button layout.
My inputs are configured to match MAME but also when you configure input with ES it's what Libretro cores use. That's why it works for both standalone and Libertro cores.
For controllers I have never had an issue. I configure input within the ES menu and fill in all the inputs using an XBOX joystick. Once complete I turn on a 2nd controller (same model) and jump right into a game of Metal Slug for example. Both P1 + P2 sticks work with no extra configuration.
-
P1+P2 (1+2) send the escape key with IPAC's
AHH yes. This refers to the IPAC "Shift" feature. I forget about this. One more layer of confusion!
@battlecat So, your description about the combo of P1_Start and P2_Start is probably correct (ESCAPE). Sorry, I think I disabled that one a long time ago on mine because I have a switch mapped to ESCAPE with a dedicated button.
-
@riverstorm said in Setting up a Ipac2:
To get escape to work as 1+2 I modify /opt/retropie/configs/all/retroarch.cfg
input_enable_hotkey = num1
input_exit_emulator = num2But if the IPAC is configured to go to SHIFT FUNCTION with P1_Start + P2_Start = Escape, it will not send a num1+num2. The IPAC is smarter than that. It won't even send num1 until you release it (just in case you do a shift).
-
@caver01 said in Setting up a Ipac2:
But if the IPAC is configured to go to SHIFT FUNCTION with P1_Start + P2_Start = Escape, it will not send a num1+num2. The IPAC is smarter than that. It won't even send num1 until you release it (just in case you do a shift).
Ah that makes sense now! I could never quite figure out why instead of 1+2 you need to press 2+1.
Is there a time delay setting between hotkey presses in Libretro cores that could be adjusted or does it need to detect them simultaneously?
-
@riverstorm I dunno. I have also never tried to invoke the IPAC shift in reverse order.
Remember, I have hotkeys disabled.
-
@riverstorm Thinking about what you said again, I wonder if the IPAC shift function just doesn't happen if you do it in reverse order, so when you do 2+1, maybe that combo actually DOES get through to retroarch and invokes the hotkey. That is interesting. And if you do 1+2, that won't go to retroarch because IPAC SHIFT takes over and sends "escape". This sounds logical.
-
@caver01 said in Setting up a Ipac2:
@riverstorm I dunno. I have also never tried to invoke the IPAC shift in reverse order.
Remember, I have hotkeys disabled.
You're not really invoking the IPAC shift in reverse order. You're just sending 2+1 to exit Libretro cores then 1+2 sends escape in a standalone emulators such as AdvMAME.
-
@riverstorm said in Setting up a Ipac2:
You're not really invoking the IPAC shift in reverse order. You're just sending 2+1 to exit Libretro cores then 1+2 sends escape in a standalone emulators such as AdvMAME.
Exactly. So in reverse, no SHIFT, but Hotkey is picked up by retroarch, but done in 1+2 order, no hotkey (nor 1 nor 2, because IPAC SHIFT grabs it and sends ESC)
-
@caver01 said in Setting up a Ipac2:
@riverstorm Thinking about what you said again, I wonder if the IPAC shift function just doesn't happen if you do it in reverse order, so when you do 2+1, maybe that combo actually DOES get through to retroarch and invokes the hotkey. That is interesting. And if you do 1+2, that won't go to retroarch because IPAC SHIFT takes over and sends "escape". This sounds logical.
You got it! That's what I am doing and it works pretty decent. It's also handy for some of the older consoles on an arcade control panel too, button layout that is!
The Atari, NES and SNES had really simple button layouts that can be mimicked on the control panel and are playable. Atari needs analog input so want to continually go in one direction if that makes sense. It's not perfect but playable. Like Mario Bros. on NES works fine. Newer more complex controllers can't match the button layout or analog control.
-
@riverstorm But here's the problem I kept running into (which had me disable BOTH the SHIFTED ESC and the hotkeys: When I would play games like Metal Slug, SmashTV, or any game where you press START to continue, there was a chance of two players doing it at the same time and BANG, the game exits, either because ESCAPE was picked up by MAME as a RAW key, or because RetroArch picked up the hotkey exit command.
This was especially driving me nuts when my hotkey was enabled with default exit of Start+Select(coin). I'd be single-player running and gunning through Metal Slug, and need to drop coins to add credits. I would press my coin button rapidly, and sometimes pressing start to get back into the game and BANG, it exits! That was driving me nuts.
For me, the solution might have been to consider other hotkey options or other exit keys, but in the end, since I have a dedicated button, I just disabled hotkeys completely, and set that dedicated key to EXIT with the WinIPAC utility, configured retroarch to exit with ESC as well.
-
@caver01 said in Setting up a Ipac2:
For me, the solution might have been to consider other hotkey options or other exit keys, but in the end, since I have a dedicated button, I just disabled hotkeys completely, and set that dedicated key to EXIT with the WinIPAC utility, configured retroarch to exit with ESC as well.
Ah that makes sense. For some reason the IPAC4 doesn't have a dedicated ESC input but the IPAC2 does so I wired it to the side of the box in addition to hotkeys. It wasn't really needed but I still use it once in a while.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.