Jump to content
LaunchBox Community Forums

Need help with MAME input configuration


vgbox

Recommended Posts

1. How to enable both DPAD and the left analog stick for character movement in standalone MAME? For xbox series x\one controllers. With the following configuration neither DPAD nor the left analog stick work.

How my general input movement for player 1 looks like: 

1.thumb.jpg.684d16b8e9190539531346078adc6100.jpg

2. How to exchange the places of "xinput Player 1" (JOYCODE 1) between "real arcade pro 3" arcade stick (JOYCODE 4) with a press of a button (JOYCODE 4 turns into JOYCODE 1 and vise versa)? I bet there is a command line for it.

Reason: Generally, fighting games are more suitable for arcade stick so i would like the option to use my arcade stick for JOYCODE_1 only for those type of games.

My Mame64\ctrlr\Controls.cfg configuration:

2.thumb.png.aa425795b0781d7483625164e13dc3c9.png

Edited by vgbox
Link to comment
Share on other sites

Couple things. Your first screen shot has a controller setup that is telling MAME that "up" is D-Pad Up AND Joystick Up.  You have no "OR" between the commands so it is combined.  

1842977241_MameScreenshot2021_03.18-14_53_35.17_cr.thumb.jpg.5bf133c49aeff969d08701e1668c05a0.jpg

So need to look at mapping.  

It also looks like you have JOYCODE_1 and JOYCODE_2 possibly swapped in CTRL file along with having no commands listed for button/controller mapping. So your settings won't "stick" necessarily.  Lastly, make sure you MAME.ini is referencing your CTRL file correctly.

 For example, my CTRLR file is called xbox2player.cfg (an XBOX One controller) and is referenced as such:

ctrlr                     xbox2player

Also here is example of my controller file:

 

xbox2player.cfg

 

 

 

Edited by sundogak
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

43 minutes ago, sundogak said:

Couple things. Your first screen shot has a controller setup that is telling MAME that "up" is D-Pad Up AND Joystick Up.  You have no "OR" between the commands so it is combined.  

1842977241_MameScreenshot2021_03.18-14_53_35.17_cr.thumb.jpg.5bf133c49aeff969d08701e1668c05a0.jpg

So need to look at mapping.  

It also looks like you have JOYCODE_1 and JOYCODE_2 possibly swapped in CTRL file along with having no commands listed for button/controller mapping. So your settings won't "stick" necessarily.  Lastly, make sure you MAME.ini is referencing your CTRL file correctly.

 For example, my CTRLR file is called xbox2player.cfg (an XBOX One controller) and is referenced as such:



ctrlr                     xbox2player

Also here is example of my controller file:

 

xbox2player.cfg 7.25 kB · 1 download

 

 

 

How to know which button commands to add for each controller in Controls.cfg? Where does mame save its "General Inputs" configuration? I think to copy the general inputs to Controls.cfg to make sure i write the right commands instead of copy paste your own commands that may not suit my configuration.

Edited by vgbox
Link to comment
Share on other sites

If you launch MAME and then select tab you can setup your controller.  Those commands are initially stored in your MAME\cfg\default.cfg file.  You can copy those to your custom CTRLR file.  There are various Google resources but this is example for more info.   Alternatively, you can just setup in your default.cfg and then make it read only file so it doesn't get overwritten.  

  • Thanks 1
Link to comment
Share on other sites

12 hours ago, sundogak said:

If you launch MAME and then select tab you can setup your controller.  Those commands are initially stored in your MAME\cfg\default.cfg file.  You can copy those to your custom CTRLR file.  There are various Google resources but this is example for more info.   Alternatively, you can just setup in your default.cfg and then make it read only file so it doesn't get overwritten.  

I copy the controls from cfg\Dafault.cfg to my custom ctrlr\Controls.cfg but now only JOYCODE 2 and JOYCODE 4 buttons configured and the DPAD and left stick movement still does not work. JOYCODE 1 and JOYCODE 3 does not work at all, not the buttons and not the DPAD and stick movements.

What's next?

Here is my updated Controls.cfg:

Controls.cfg

Mame.ini input:

3.jpg.81b1568dbae489d61003d1d3c5a59181.jpg

Edited by vgbox
Link to comment
Share on other sites

I would just go to your mame/cfg folder and delete the default.cfg. Then either launch mame, or launch it with a game and set your "general" controls (these will be used for every game, but can be overridden with "this machine" controls if you so desire). Then once the controls are set, go back into the cfg folder, right click the default.cfg file and go to properties and check the read only box.

  • Thanks 1
Link to comment
Share on other sites

@vgbox If you look at your CFG file you will see you are again not mapping the controls separately and they are all jammed together.  There is no "OR" statement between the DPAD and stick commands.  That would be the case when you looked at the TAB view as well (should look like my screenshot).  You are basically telling it that "UP" means stick up AND DPAD up.  When you are mapping commands in MAME you have to complete the first map (i.e., stick) before doing the second. You also have Player 1 and 2 swapped in Joystick references.  I did quick stab at one you attached as example.

Controls.cfg

  • Thanks 1
Link to comment
Share on other sites

What @sundogak is saying is you have no "or" between your inputs. So are you for example on "Up" pressing the dpad up and the stick up at the same time? I'm gonna say you are, and thats your problem, that then means that when in game you have to press up on the dpad and the stick at the same time to move up, its not dpad "or" stick, it has to be both. All you need to do is hit enter on "up" then press up on the dpad, then hit enter again and this time press up on the stick. That entry will now say dpad up "or" stick up, repeat for all directions.

  • Thanks 1
Link to comment
Share on other sites

So i edit my cfg\default.cfg - configure all the controllers inputs to my liking, check the file with "read only" and also backup it. Now the 1, 2, and 3 Xinput controllers function as wanted (JOYCODE 1, 2, and 3), great! But for some reason mame refuses to accept my REAL ARCADE PRO.3 inputs (JOYCODE 4),

EDIT:

I noticed default.cfg JOYCODE 4 inputs are different than the General inputs in mame menu, i guess because this arcade stick has 3 different configuration modes. Anyway, i configured JOYCODE 4 inputs again and for some reason after it mame finally reflect the change in game. Its sorted.

Here is my updated and fully working cfg\default.cfg file:

default.cfg

What about question .2? Rephrased it and edited the opening message:

"2. How to exchange the places of "xinput Player 1" (JOYCODE 1) between "real arcade pro 3" arcade stick (JOYCODE 4) with a press of a button (JOYCODE 4 turns into JOYCODE 1 and vise versa)? I bet there is a command line for it.

Reason: Generally, fighting games are more suitable for arcade stick so i would like the option to use my arcade stick for JOYCODE_1 only for those type of games."

 

Edited by vgbox
Link to comment
Share on other sites

On #2, unless get fancy with AHK script, the easiest is just to setup two CTRLR files with the order you want.  Then setup two MAME emulator instances which point to those CTRLR files. The MAME command line options are here.  -ctrlr is the command line to reference CTRLR path.  I am not sure you specify a specific file so may have to place in separate directories.  Any command line options you place in the Default Command Line Parameters like below.  You could also reference separate MAME.ini files with the ctrlr pointing to your specific one which you can also reference in the LB command line parameter entry. 

Capture.thumb.JPG.49671325675c2980c777ac349b1c60b5.JPG
 

EDIT:  Also, not really sure need to go to all the bother. Why not just set controller commands for both XBOX controller and your stick controller?  That is the whole point of the "OR" setup in MAME.  For example, mine above can be used with either keyboard or controller. In your case would just add both XBOX and stick controls.  

Edited by sundogak
  • Thanks 1
Link to comment
Share on other sites

2 hours ago, sundogak said:

Why not just set controller commands for both XBOX controller and your stick controller?

I was going to suggest that myself, but what would happen when playing 4 player games?

Wouldn't Player 4 end up controlling player 1 as well?

Edited by IainSA
Link to comment
Share on other sites

@IainSA

Correct, if indeed the intent is to always have access to 4 player with Xbox Controller 1 through 3 and Arcade Stick 4 then you cannot map Stick 4 and Xbox Controller 1 to Player 1 or will conflict.   Now you are back to messing with INI and/or CFG files specific to the game. 

Ultimately each "Player" can have multiple control devices assigned in MAME (e.g., Keyboard, hand held controller, arcade stick, light gun) but each player's device must be unique when actively playing the game.  

Edited by sundogak
Link to comment
Share on other sites

I was just thinking, are there any 4 Player fighting games? I don't think there is, but I could be wrong.

If not, you're solution could work.

What If he sets the stick controls through "this machine" and not the general controls, would that help avoid the conflicts with 4 player games?

The only downside to this, is you would have to set the controls for each game separately.

Edited by IainSA
Link to comment
Share on other sites

1 hour ago, IainSA said:

are there any 4 Player fighting games?

According to the Arcade Database, there are 18, [up to] four-concurrent-players, "Working" (vs "Working and imperfect" or "Imperfect") Fighter [genre] games in MAME.  This is Parent roms only. 

But on the upside, there are only 18. :)  (Unless you want all clones too.  Then there's like 105.)

Spoiler



Name:             Description:
batcir            "Battle Circuit (Euro 970319)"
captcomm          "Captain Commando (World 911202)"
crimfght          "Crime Fighters (World 2 players)"
ddcrew            "D. D. Crew (World, 3 Players) (FD1094 317-0190)"
ddsom             "Dungeons & Dragons: Shadow over Mystara (Euro 960619)"
ddtod             "Dungeons & Dragons: Tower of Doom (Euro 940412)"
growl             "Growl (World, Rev 1)"
hook              "Hook (World)"
karatblz          "Karate Blazers (World, set 1)"
kov2nl            "Knights of Valour 2 New Legend / Sanguo Zhan Ji 2 Guang Sao Yu Jun (V302, Oversea)"
knckhead          "Knuckle Heads (World)"
orleg2            "Oriental Legend 2 (V104, Oversea)"
silentd           "Silent Dragon (World)"
tmnt2             "Teenage Mutant Ninja Turtles - Turtles in Time (4 Players ver UAA)"
tmnt              "Teenage Mutant Ninja Turtles (World 4 Players, version X)"
ninjak            "The Ninja Kids (World)"
simpsons          "The Simpsons (4 Players World, set 1)"
vendetta          "Vendetta (World, 4 Players, ver. T)"


 

 

Link to comment
Share on other sites

@sundogak

Since LB categorize fighting games by "Fighter / Versus", would it be possible to tell lb or mame to exchange controllers only for games in the "Fighter / Versus" genere instead of creating a new mame instance?

Also, if i create a new mame instance i would have to import all the fighting games again just for that instance, right? I mean, it would be unrealistic to edit "edit game/emulation" of hundreds of fighting games one by one. 

I'm trying to keep things as simple as possible.

@IainSA

The intent is to exchange places of joycode 4 between joycode 1 for fighting games, like SF2, and having xinput 1-3 for joycode 1-3  and the arcade stick for joycode 4 for everything else.

 

Edited by vgbox
Link to comment
Share on other sites

3 hours ago, vgbox said:

Since LB categorize fighting games by "Fighter / Versus", would it be possible to tell lb or mame to exchange controllers only for games in the "Fighter / Versus" genere instead of creating a new mame instance?

If you've created your 2 controller configuration files, then yes.

Let's say you have your default one "Controls.cfg" that you created.  This one has your Joy1 thru 3, and Arcade Stick as Joy4.  This will be the one you have set in your mame.ini for all games.

Now create one (let's call it "ArcadeStick.cfg") that has your Arcade Stick as Joy1 and then the others as Joy2 thru 4.

Then for the games you want to use the alternate controls [ArcadeStick.cfg] for, I see 2 options:

Option 1:   Edit the games. Under Emulation, check Use Custom Command-Line Parameters: and type in

-keyboardprovider dinput -ctrlr ArcadeStick

image.thumb.png.d5fa7f31a125713f21a97eb232276a98.png

4 hours ago, vgbox said:

it would be unrealistic to edit "edit game/emulation" of hundreds of fighting games one by one. 

That said, I'd recommend Option 2.

Option 2:  Download and install this..

Then in LaunchBox, in the upper left, select Playlist and then select Arcade Fighting Games.  (assuming you have this playlist)

image.png.f3caf812b16af53387fa448d822fed93.png

Click on one of the games, hit Ctrl+A (selecting all games), then right click and select Bulk Command Line Editor.  Fill in the above command-line and click Finish.

Should be simple enough. ;) 

  • Thanks 1
Link to comment
Share on other sites

@JoeViking245

I did option 2. It made the exchange but for some reason now the arcade stick (joycode 1 for fighting games, joycode 4 for the rest) inputs are messed up a bit in fighting games. Outside of fighting games the inputs are correct. How to make the arcade stick inputs carry correctly in fighting games? Maybe another command line is needed?

Here is my ctrlr\ArcadeStick.cfg which calls cfg\default.cfg in fighting games.

Edited by vgbox
Link to comment
Share on other sites

4 hours ago, vgbox said:

inputs are messed up a bit in fighting games.

Sounds like your default.cfg is dialed in nicely for all your regular games.  But changes need to be made when loading ArcadeStick.

You might want to first combine these to files similar to what @sundogak shows in his 'example controller file' in the 1st reply above.  Which will look a lot like this.. ArcadeStick.cfg

Next, figure out exactly which "inputs are messed up a bit" and change those in ArcadeStick.cfg.

I don't think you can simply load ArcadeStick, make your input changes and have it save to "ArcadeStick.cfg".  Not really sure how that part works.

I'm going to take a wild guess that the joystick works, but some of the buttons are in the wrong order or don't work at all. If you look at the file I attached (which is your 2, combined) and scroll down to where the "P1_BUTTON..." section starts, you have:

Button-1 reassigned to Button-3. 
Button-2 to Button-1. 
Button-3 to Button-2.  
(4, 5, and 6 ok).  
Button-7 is reassigned to the "left trigger".  
And so on.

I've no idea what the button assignments are on the Real Arcade Pro 3.  I've only seen pictures (and didn't see any "triggers" ;)). 

  • Thanks 1
Link to comment
Share on other sites

@JoeViking245

Yes, the joystick works fine (character movement directions). The problem is that all of the button inputs are in the wrong order.

I wonder what makes the buttons change order after the exchange. Maybe a bug?

For the Xinput player 1-3: button 1 is 3, button 2 is 1 and button 3 is 2 because the genius microsoft decided that for xbox controllers the button count starts from the bottom button which is A. I much prefer the playstation buttons layout count in terms of ergonomics (X is attack and A is jump, and so on, this is how buttons are configured in most old consoles controllers and in the arcades and for good reason), that is why i assigned button 1 to X (button 3 in ms world) and so on. Anyway, it seems to me that the buttons are configured correctly in the default.cfg because they work in the right order in non fighting games.

Maybe a solution is to create a second cfg\default.cfg, call it, say, default2.cfg, with different JOYCODE 4 buttons order and make the arcadestick.cfg call that? If so, which command lines are needed? I need to create second mame.ini as well with "ctrlr                     ArcadeStick"?

 

Edited by vgbox
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...