Advmame controller problem
-
@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?
-
@spud11 I guess I overlooked your question/comment about 4-way vs. 8-way joysticks. But before I get into it, I wanted to mention that in the .rc file, if you specify your keyboard device as RAW, then all keyboards look like ONE keyboard to MAME. That saved me so much headache once I figured that out I can't even tell you. On AUTO, it was detecting multiple keyboards, and depending on USB ports and whether I had a real external keyboard attached, Keyboard [1] would get written into the config file when configuring my IPAC controls, and later, when I unplugged the external keyboard, it would move, so the inputs would no longer be recognized (the IPAC would now move to Keyboard [0]). Anyway, once I specified RAW those problems disappeared and ALL keyboard key presses were interpreted as if they were coming from a single keyboard. It no longer mattered if I attached an external. "J" was always "J" no matter where it came from.
Now, for the 4-way and 8-way sticks, this is a real problem for folks using actual arcade controls. The only true solution is a physical restrictor plate. I'd love to try one of the expensive 360 joysticks from Ultimarc to effectively pull this off in firmware, or the Mag-stik that allows you to switch this on the fly. On Happ Supers or Competition sticks, you can make some adjustments with the actuator on the bottom of the joystick but all you are really doing is making it easier or harder to hit both microswitches in the corners.
@mediamogul describes a way to overcome these issues with software using the xboxdriver, but from what I have heard to date, this solution is for gamepad users and won't really apply to folks like me using a keyboard controller. That's a real bummer, as I would love to have reliable 4-way control for games without giving up my 8-way setup. For now, I just have to pretend, and watch the frustration of friends when Mario gets stuck on a ladder, or PacMan doesn't turn. People usually chalk it up to user error, with the nostalgia overshadowing the bad gameplay--but I know better.
If there is one weakness in my build, it is the 8-way sticks for 4-way games. I hate it. But whadayagonnado.
-
if you specify your keyboard device as RAW, then all keyboards look like ONE keyboard to MAME.
...and with that valuable tip, you've just remedied the last problem I had with Advance MAME. Restricting write access to the preferences, as I mentioned above, allowed for a hackneyed solution to set keyboard controls that wouldn't shift, but it came at the price of not being able to use the GUI and one other insurmountable problem. I always map save state an load state to 'select+r' and 'select+l' respectively, but MAME was throwing up a notice to specify the slot location that would only accept input from keyboard 0. Setting
device_keyboard
to 'raw' solves the whole shebang. I'll make note of it in my post above, so that no one else wastes time going in that direction. -
@mediamogul Yeah, I don't know if I have ever mentioned raw keyboard for AdvMAME on this forum. I kinda forgot about it, to be honest, and with each new image I configure, I always pull in the changes I have made to my .rc file(s).
I can see a possible use case for individual keyboards detected, as you could get really creative with multiple controllers, but there are more than enough keys to go around, so it doesn't make much sense to have them separated.
I'm glad this tip helped. I was really pulling my hair out over this a long time back, almost to the point of maintaining my .rc file with a complicated spreadsheet so I could output changes that would include mapping to all "possible" keyboards attached. That would have been a big mess, especially given some of the complex mapping I have setup for games like Sarge where I am using a single joystick to drive a tank by leveraging <CODE NOT> boolean mapping for tanksticks.
-
@caver01 Oh, this is very good information - raw format. Over the past 3 or 4 days, I haven't had a chance to experiment with Advmame to see if I can make things happen the way I want them to. But I'll set things to raw mode and play around with that and xboxdrv and see if there might be some options.
Regarding the physical restrictor gates, this is true, but you'd be surprised how well the software solution can work (at least using the joysticks I have). I'm lucky that I went the DragonRise/USB encoder route rather than IPAC, as my encoder isn't recognised as a keyboard and so it actually works well with xboxdrv. (For me, with Ms Pacman, if xboxdrv is in "8-way mode", Ms Pacman's head spins around like Linda Blair in The Exorcist, whereas it doesn't in "4-way mode". It's very funny.)
However, before going down the xboxdrv route, I looked at other options. One such option we haven't mentioned is:
I have not tested one of these. These guys don't ship to my country and, although I have relatives in the US who I could ship it to, it is fairly expensive (if you buy 4, as I was contemplating). Because of my setup, getting under my arcade table is a real pain, so a solution that slots over the top was what I was looking for. The seller has 3 or 4 different varieties and a proper non-ebay website too if you want to know more.
-
@spud11 I appreciate those options, and if I was starting from scratch it would be hard to ignore those possibilities. However, I can't really modify the top surface of my panel. My best option for improving 4-way is via software, or replacing my sticks with ones that are a lot more expensive that let me trigger restrictors electronically, or with digital sticks that emulate 4 way action. The fancy digital sticks like the Ultimarc 360 would be preferable, as I could also leverage this for games that want a 49-way, or hall effect pseudo-analog input.
Still, I am VERY interested in seeing how far I could go with an IPAC and the xboxdrv. I had thought not very far, but perhaps there is a way to emulate a gamepad by way of keyboard presses? I just have not researched it.
-
Did anyone ever figure out the 2 joystick issue (without using xboxdrv)? I’m using 2 different 8bit do controllers and both p1 and p2, even after mapping separately, utilize only joy1
-
@spud11 I’m sure you have this figured out now, but in your config I can see a few things that would cause your controllers to have input problems and also crossover.
In this line you are missing or between the two joysticks:
input_map[p1_button4] joystick_button[2,1] joystick_digital[0,0,2,1]
Should be:
input_map[p1_button4] joystick_button[2,1] or joystick_digital[0,0,2,1]
Also on the raspberry each controller port has a number starting with 0. In the config it’s the first number after the [ bracket. On your line above the P1 joystick_button[2,1] is mapped to Controller 3, but joystick_digital[0,0,2,1] looks good and is mapped correctly to Controller 1.
0 = port 1 (Should be P1) Controller 1
1 = port 2 (Should be P2) Controller 2
2 = port 3 (Should be P3) Controller 3
3 = port 4 (Should be P4) Controller 4You would want to line all of these up this way. Theough your config I can see Player 1 mapped to Player 2 and vice versa. Also there are crossovers on the UI and Coin settings. Not your fault bro and I felt your pain.
Made this video and hope it helps as far as understanding the config and how to line things up. It’s for PS3 controllers but the same principles apply. Any questions reach out.
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.