Advmame controller problem
-
@mediamogul Thanks for your help and just so you know, this is now my "landscape" mode setup, rather than "portrait". I'm basically exclusively reserving lr-mame2003 for portrait mode only, and intend to use advmame (or any other emulator/core that works) for landscape mode.
So I went into Ms Pacman via advmame, pressed TAB and I tried first by removing all joysticks inputs, and then remapping each key for players 1 and 2 to separate keys. I then changed the advmame.rc as so:
input_map[p1_up] keyboard[0,up] or keyboard[1,up] or keyboard[2,up] input_map[p1_down] keyboard[0,down] or keyboard[1,down] or keyboard[2,down] input_map[p1_left] keyboard[0,left] or keyboard[1,left] or keyboard[2,left] input_map[p1_right] keyboard[0,right] or keyboard[1,right] or keyboard[2,right] input_map[p1_button1] keyboard[0,lcontrol] or keyboard[1,lcontrol] or keyboard[2,lcontrol] input_map[p1_button2] keyboard[0,lalt] or keyboard[1,lcontrol] or keyboard[2,lcontrol] input_map[p1_button3] keyboard[0,space] or keyboard[1,space] or keyboard[2,space] input_map[p1_button4] keyboard[0,lshift] or keyboard[1,lshift] or keyboard[2,lshift] input_map[p2_up] keyboard[0,r] or keyboard[1,r] or keyboard[2,r] input_map[p2_down] keyboard[0,d] or keyboard[1,d] or keyboard[2,d] input_map[p2_left] keyboard[0,s] or keyboard[1,s] or keyboard[2,s] input_map[p2_right] keyboard[0,f] or keyboard[1,f] or keyboard[2,f] input_map[p2_button1] keyboard[0,a] or keyboard[1,a] or keyboard[2,a] input_map[p2_button2] keyboard[0,s] or keyboard[1,s] or keyboard[2,s] input_map[p2_button3] keyboard[0,q] or keyboard[1,q] or keyboard[2,q] input_map[p2_button4] keyboard[0,w] or keyboard[1,w] or keyboard[2,w]
And then I tried playing just with the keyboard. Again, player 2's movement was governed by player 1's keyboard controls.
When I checked the advmame.rc again, it basically gave me this for each line:input_map[p2_up] keyboard[0,r] or keyboard[1,scan0] or keyboard[2,scan0]
which might mean it can't find the extra virtual keyboards (?).
I've not invoked xboxdrv at the moment as I was just trying to see whether the keyboard commands would work.
-
That's pretty squirrely. I'm not sure if any of this is specifically buggy behavior, but rather the software trying to be too smart for it's own good by adapting to what it thinks are multiple controls. I'd be most interested for @edmaul69 to weigh in on this as well. He's been testing a version that is supposed to address these issues. For me, the method I landed on above is holding strong, but it's a kludgy resolution at best.
-
@ferdnand Hi. If you are using 1 controller only, it should be reasonably easy to map the controls.
Just make sure you've got a keyboard attached and press TAB. That will bring up a sub-menu with "Input - General" and "Input - Game". If this is the first time you've messed around with advmame, probably best to pick the second option in case you mess it up. Then with the keyboard just navigate, press "enter" and press the button on the joystick that you want to use. Same with the joystick axes.
After mapping everything, navigate with the keyboard down to "return to game". It will automatically save the inputs you've put in to advmame.rc.
-
@mediamogul Yeah, it's a bit weird. I was even thinking of forgetting advmame and just proceeding with fba or lr-mame2010, but that would be a bit of a pity, given that I've already got the advmame romset sorted out.
-
@ferdnand said in Advmame controller problem:
Also how do you exit a game , I would like "start+select", to exit.... Someone please come up with a script to map controller with, please
You can simply map to button presses at once to UI Cancel. In the mame GUI, map UI Cancel, and when it is time to press the key, press BOTH start and select, then wait for it to accept. It will create a <CODE AND> entry, which is to say, it will require both keys pressed at the same time to register the function, which is what you are asking for.
-
@spud11 I had a thought about your experience with mspacman. It strikes me that unless you have the virtual DIP switch set to cocktail mode, that this game does indeed use player 1 controls for player 2. Follow me here. Imagine the actual arcade system, a stand-up cabinet with a single joystick. Where is player 2 controls? There are none. On the real game, you have to share the same joystick. Well, that may be exactly why that game is behaving the way it is.
Now, if you enable Cocktail mode, which is for a specific kind of cabinet, with two sets of joysticks across from each other, you get the different controls for player 1 and 2 because they are actually different controls on the real system. Of course, the screen also flips.
This same effect happens in Black Tiger as well, where the controls for player 2 don't really do anything unless running in cocktail mode.
In the end, this might just be accurate emulation of the real hardware.
-
@caver01 Well, I've certainly learnt something new. I didn't realise the Advmame TAB setup was so sophisticated that it allowed this kind of key setup. That's really helpful. Thanks, caver01.
-
@caver01 That makes 100% sense to me. The only thing that strikes me though is why advmame would allow us to set up 2 Player controls that are different from 1 Player controls, if it's not going to allow us to use those controls. But I think you've got to the nub of the problem. I'll be posting a response to mediamogul's comments in a minute too.
-
@mediamogul I thought about this problem overnight. It strikes me that I should be able to use my existing lr-mame2003/xboxdrv setup to bypass this issue with advmame.
xboxdrv allows me to map all 4 joysticks to the same keyboard settings for lr-mame2003. So what I've done is map Joysticks 3 and 1 to Player's 1 keyboard controls and Joysticks 2 and 4 to Player 2's keyboard controls. What this means is that it doesn't matter whether the game is in Portrait mode or in Landscape mode, I can either use Joystick 1 or Joystick 3 for Player 1 depending on the orientation; same with Player 2, using Joystick 2 or 4. I've tested this with Ms Pacman "in game" and it appears to work as it records movement with Joysticks 1 and 3 whilst playing Player 1; same with Player 2 using Joysticks 2 and 4.
So what I'll probably do now is setup a new folder for the lr-mame2003 romset in landscape mode and remove the advmame romset for the time being. I'll post my new xboxdrv code in the "Advanced Mapping Guide" thread.
-
@spud11 I get your frustration about this. I thought the same thing with Black Tiger a while back. It is a horizontal game, and I wanted player 2 to use a second set of controls I have mounted in that orientation, but was angry when the game insisted I use player 1's joystick. Then I tried cocktail mode, which worked, but it was upsidedown for player 2.
So, the reason it lets you set separate controls for player 2 is for when you have a cabinet setup in cocktail mode that does indeed have separate controls. It would seem that the original game hardware would have to accommodate a second set of controls with this cabinet style. Otherwise, it all plays on the same joystick which is why the player 2 config is ignored on a regular cabinet. Makes sense, just doesn't make us very happy. It is easy to forget that the emulator is simply reproducing the capabilities of the original hardware, not merely adapting the gameplay to our modern control systems.
-
@caver01 Yep, it's really quite remarkable how far emulation has come, particularly in the last 3-4 years, as we can now much more easily create the "look" of an arcade machine with the Raspberry Pi as the guts of it.
Hopefully, the author of advmame will find a software solution to what is an issue caused by perfect hardware emulation (as you've said). In the meantime, I'll probably just use lr-mame2003 with xboxdrv. I started using that core in the first place because I found that with a 1920x1200 monitor I was able to implement "real" full screen resolution more easily, than with advmame .
I love your build, by the way. I took note of it when you first put the screenshots up. A labour of love.
-
@spud11 Thanks!
I wouldn't expect much to change in advancemame on this. By any account, the emulator is "working as designed" as they say. It is the game code that is ignoring player 2 controls, not mame. It simply checks the cocktail cabinet dip switch, and if it is set to upright, well there is only one joystick in the machine, so player 2 is going to share the player 1 joystick. Nothing to fix here. Not as much fun with friends, but you could use it as an opportunity to emphasize the quality of the emulation and explain how the original cabinet worked and chalk it up to "accuracy".
-
@caver01 Thanks for letting me know that - that it's unlikely to be "fixed" (not that it really needs fixing, as such, as it's just doing what it should be doing).
By the way, given that you are using arcade joysticks, could I ask please how you have addressed the 4-way/8-way joystick problem with older games like Ms Pacman? Are your joysticks already hardware (4 way) restricted? I ask because, with mediamogul's help, I turned to xboxdrv because of its ability to software restrict my 8-way joysticks for Ms Pacman etc.
-
@spud11 said in Advmame controller problem:
When I checked the advmame.rc again, it basically gave me this for each line:
input_map[p2_up] keyboard[0,r] or keyboard[1,scan0] or keyboard[2,scan0]
which might mean it can't find the extra virtual keyboards (?).
Edit: A proper solution to this can be found at the post below.
I noticed the same behavior today. Advance MAME/MAME can really be too smart for it's own good sometimes. It tries to set up everything automatically on every launch and ends up overwriting settings that I would prefer be set in stone.
There may be a better way, but I took a page out of the RetroPie playbook as to how RetroArch is set up and completely restricted the software's ability to make changes to the settings. From now on, I'll be configuring all the settings manually through a text editor. What I've done is added a command to
/opt/retropie/configs/all/runcommand-onstart
that removes write permissions to/opt/retropie/configs/mame-advmame/advmame.rc
on launch and paired it with a command in/opt/retropie/configs/all/runcommand-onend
that reinstates write permissions when the software exits. For anyone interested in this madness, the examples are below.runcommand-onstart
if [ "$2" = "advmame" ] || [ "$2" = "advmess" ] then chmod -w /opt/retropie/configs/mame-advmame/advmame.rc chmod -w /opt/retropie/configs/mame-advmame/advmess.rc
runcommand-onend
if [ "$2" = "advmame" ] || [ "$2" = "advmess" ] then chmod +w /opt/retropie/configs/mame-advmame/advmame.rc chmod +w /opt/retropie/configs/mame-advmame/advmess.rc
-
@mediamogul Okay, that's interesting. Ironically, over the weekend, I decided to ditch lr-mame2003 for the landscape roms (but leaving it for the portrait mode roms) and I have, once again, reinstalled my advmame setup with its romset, with a view to trying to get the Player 2 controls separately recognised, probably with xboxdrv. It is probably a forlorn hope for me, given that the roms themselves are acting consistently with their programming, but I might as well try and see if the keyboard workaround can be made to work on my system. I'll play around with your new runcommand-onstart/runcommand-onexit commands as part of my messing around.
One thing I was thinking of doing was, using xboxdrv, to tie all joysticks to Player 1's keyboard controls (up/down/left/right) etc, but the problem with that is that it no doubt will interfere with the 2 player simultaneous games. Having checked the forum and especially @caver01 's comments over the past 10 months, unlike the 4-way restricted games, there doesn't appear to be a comprehensive list of 2 player simultaneous games that can be "carved out".
-
@spud11 you don't have to break other games with a single rom control setup. Just add the
romname/
in front of the inputs in the .rc file and they will be just for that game. -
@caver01 Okay, thanks for that too.
-
@spud11 No prob. The .rc file is pretty sensitive to errors--mame won't launch if there is a mistake in the file. But you can use the rom prefix like a comment delimiter if it makes it easier for testing. For example, you could add the fake ROM name
comment/
in front of a line to effectively have Advancemame ignore it until you launch a ROM called "comment". -
Setting up reliable controls for Advance MAME has been a bit like wrestling a bear, but now that it's done, I'm amazed at the number of games that are finally playable on the Pi. Right off the bat I mapped a nice set of fully analog tank controls for 'Discs of TRON', and I was even able to play ATARI's 'Stun Runner', which was way past the tipping point previously. 'Tapper', 'Paperboy', 'Journey' and 'TRON' are also all performing well in the audio department after setting resample to 'internal' and the vector games are gorgeous after following your guide. Your name and insights have come up quite a few times while I've been researching all this, so I wanted to thank you personally.
-
@mediamogul Wow, that's real nice. Thanks. We each add what we can to the wealth of configuration knowledge and experience, and since my cabinet is primarily an arcade machine with real arcade controls, my contributions have been along those lines. Also, I started using another distribution--PiPlay which was built around AdvanceMAME, so I got pretty good at configuring it. We have come a long way since then, and everything keeps getting better.
I hope to payback the compliments soon, however, as my next build project will be a TV connected box with bluetooth 8bitdo controllers. At some point, I will be diving into many of the same challenges you faced configuring the games I love. I am especially curious about Tron, DOT, and other titles that can take advantage of analog sticks.
I am curious about a few arcade titles like Food Fight, Sinistar, and others that use either a 49-way or a hall-effect joystick. These perform clumsily on a digital 8-way stick. Do they translate better to an analog gamepad stick?
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.