Cant get controls to work correctly using a J-Pac with lr-mame2003
-
I have tried that.
There is actually another issue in the software - sometimes is shows multiple button hits so when you hit button 2 it will register as button 3 & 4 not just one button.
I tried to reset it a few different ways and it does not seem to just be a simple re-map.
-
@Chewable you might have stumbled into an issue I discovered a while back when I was trying to setup a special mapping in MAME2003 using a <CODE_NOT> technique. Basically, I was setting up a complex control input configuration for arcade games like Vindicators that use dual sticks to steer a tank. Using Boolean AND and OR settings, it is possible to steer a tank using a single joystick and the mapping converts 8-way inputs on a single stick into the dual tankstick inputs. Got all of that?
So, my problem described here was that because I was using a keyboard controller (early model IPAC4) and I had configured retroarch inputs already, lr-mame2003 was seeing two inputs for every one--first via retroarch virtual gamepad, and second, the actual raw keyboard key press. We confirmed this at about post 29 in that thread. I could not use MAME's <CODE_NOT> mapping technique (a double-tap) because it was always detecting two simultaneous inputs. The workaround was to map evrything for Player 1 to "nul" in the retroarch config (I actually just used a per-rom .cfg for the games in question). With player 1 inputs mapped to NUL according to retroarch, MAME only saw my raw key presses, and I was able to setup the tankstick mapping no problem.
It also turns out that despite the double inputs when using a keyboard, MAME is not causing the game to trigger double actions. For most cases, the simultaneous inputs are just seen as an AND pair and together, they trigger single action in the game when pressed.
Sorry if this is confusing. Most people are not doing complex Boolean input mapping, but if you do, and you use a keyboard, you run into problems and this is the reason. It also explains why you are seeing two inputs. I logged it as an issue, but I doubt it is being addressed. Besides, it is not really doing harm--just confusing some of us with keyboard controllers.
In your case, it is important to recognize that MAME2003 is seeing the raw keys and the retroarch virtual inputs at the same time. You could block the virtual inputs like I did by setting everything to NUL. Then when you hit TAB and map buttons in the MAME GUI menu, you will only see the inputs you expect from your winipac configuration.
-
That is super interesting.
I will now have to try that.
For now I ended up doing what I did not want to do, which is I am using Final Burn Alpha for the 6 button games.
My guess is that this is why few people seem to discuss this issue is that they just go over to that. I would like to get it working in lr-mame2003 and will try that "NUL" idea.
I have now gotten everything to at least work and made an image of the drive so I can now really go about messing it up......
-
@Chewable You should not have to use Final Burn for 6-button games if you don't want to. Given your image from WinIPAC, I assume this is a layout for ipac switches 1,2,3 4,5,6 7,8 for players 1 and 2. I am curious what you have in your
/opt/retropie/configs/all/retroarch.cfg
for mapping these to ABXYLR etc. as I suspect we have similar configs. Even with the dual mapping that appears in the GUI menu in lr-mame2003, it still follows MAME defaults, and most games work. Those that are mixed up would be anyway, even without retroarch and virtual gamepad inputs. Mapping controls right there in the MAME gui works for most games.Yet, to get it really clean, you could just build a per-rom cfg. file (i.e.
sf2.zip.cfg
) and override all of the inputs for player 1 and 2 buttons by setting them to "nul". Then, if you have to map controls in the MAME gui, you only see the raw keypresses. -
it should be possible to disable mame2003's double keyboard stuff. i'll look into the this.
-
@dankcushions That would be cool!
One of the pieces of documentation that goes hand in hand with this is the "missing" controller diagram for arcade. We have the concept of UP DOWN LEFT RIGHT which maps easily enough, but what are the default mapping of retropad ABXYLR to the buttons 1,2,3,4,5,6 etc. in MAME? I don't know if I have seen that listed anywhere, but it must exist for every MAME libretro core, right? But what about the equivalent for pressing TAB? Is there a RetroArch "invoke core MENU" input? I am just thinking "out loud" here about how it could/should work.
Could you ignore retropad inputs if they come from a keyboard device? Do gamepads show up in lr-mame2003 differently than keyboard-generated retropad inputs? I only use a keyboard controller right now so I have not looked.
-
@caver01 Seems like you would either have to block the retropad virtual keyboard, or block the raw keyboard. Either, way, we will have use cases that present specific challenges to overcome. Yet, hasn't this been solved in more recent lr-mame cores?
-
the more i think about it, the less i think this is a core problem really. retroarch maps a keyboard to both a virtual keyboard, and a virtual joypad. mame2003 is capable of reading from both but it shouldn't have to make a decision as to what is 'valid' or not. if this is an issue i think it needs to be raised in retroarch, but i think they will just say to sort it out via the config.
The workaround was to map evrything for Player 1 to "nul" in the retroarch config
this makes sense to me. now your keyboard is only mapped to a virtual keyboard, rather than two things.
-
@dankcushions said in Cant get controls to work correctly using a J-Pac with lr-mame2003:
the more i think about it, the less i think this is a core problem really. retroarch maps a keyboard to both a virtual keyboard, and a virtual joypad. mame2003 is capable of reading from both but it shouldn't have to make a decision as to what is 'valid' or not. if this is an issue i think it needs to be raised in retroarch, but i think they will just say to sort it out via the config.
The workaround was to map evrything for Player 1 to "nul" in the retroarch config
this makes sense to me. now your keyboard is only mapped to a virtual keyboard, rather than two things.
I don't mind the workaround, as I can make sense of it and get what I need out of the controls mapping process. However, didn't we determine that newer cores behave differently? I am not able to test right now, but I thought it was maybe lr-mame2010 that did not have the double inputs with keyboard.
-
@caver01 i'm unable to test either but if mame2010 does something different i could look into it, but i would have thought it wouldn't be respecting the api if it did anything different!
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.