Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Find replace keys for default mame configuration  (Read 1864 times)

0 Members and 1 Guest are viewing this topic.

spratkobasa

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:January 23, 2019, 09:10:43 am
  • I want to build my own arcade controls!
Find replace keys for default mame configuration
« on: December 10, 2013, 11:12:00 am »
Hi Everyone,

I have made a custom ipac4 mapping to make it easier to configure my emulators without having issues with ctrl, alt, etc.  What I want to do now is do a find and replace the default keys to my new keys.  For example,  Find the LCtrl mappings and replace them with the Enter key.  Is it possible to do this or am I stuck having to go through the MAME program itself to remap all of this?

My hope is that I could open the default MAME control configuration file in say notepad and do a find and replace.  The default mapping that I found in the cfg folder doesn't have any mappings in it if I open it in notepad it just displays the following:

<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="default" />
</mameconfig>

So my question is where are the default mappings being saved and how can I open them to do an easy find and replace using notepad?

Cheers

spratkobasa

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:January 23, 2019, 09:10:43 am
  • I want to build my own arcade controls!
Re: Find replace keys for default mame configuration
« Reply #1 on: December 14, 2013, 09:31:44 am »
Anyone?  :dunno

Am I the only one who is crazy enough to want to do this?

drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Find replace keys for default mame configuration
« Reply #2 on: December 14, 2013, 10:01:40 am »
You may have accidentally done all your mapping config in mame in a "game specific" way as opposed to the default. That means those config setting you changed would be in the specific game CFG file instead of DEFAULT.CFG.

Look in the CFG folder and sort by date descending, that'll show you the most recently modified files. I'll bet you'll find the cfg with your mods in it that way.

But you can mod certainly hand modify those CFG files to do search and replaces, etc.

I'd recommend making a backup, and picking up a good file compare utility (like wincompare) to make working on it easier. It's pretty easy to botch the XML and cause the file not to load. and mame is pretty unforgiving about the syntax.
« Last Edit: December 14, 2013, 10:04:13 am by drventure »

spratkobasa

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:January 23, 2019, 09:10:43 am
  • I want to build my own arcade controls!
Re: Find replace keys for default mame configuration
« Reply #3 on: December 15, 2013, 11:12:43 pm »
Thanks drventure but after fooling around with it I found out what is going on with my cfg files.  The default.cfg file that is generated when I modify the original default configuration in MAME is just incremental configuration file. 

For example if I just change player 1 start and coin buttons to two different buttons than the MAME default, the following shows in my default.cfg file:

<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
    <system name="default">
        <input>
            <port type="P1_START">
                <newseq type="standard">
                    KEYCODE_T
                </newseq>
            </port>
            <port type="P1_SELECT">
                <newseq type="standard">
                    KEYCODE_Q
                </newseq>
            </port>
        </input>
    </system>
</mameconfig>

Based on this it must be looking at an original MAME default file stored somewhere else and just making this other default file in my folder.  I want to get after the original default file as I would need that to do the find and replace.




drventure

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4152
  • Last login:April 23, 2024, 06:53:06 pm
  • Laser Death Ray Bargain Bin! Make me an offer!
Re: Find replace keys for default mame configuration
« Reply #4 on: December 16, 2013, 12:35:50 am »
Ahh.. I see. Unfortunately, I'm pretty sure the defaults you're talking about are actually compiled into the Mame.exe. They aren't defined somewhere as part of a cfg file that I know of. You use default.cfg to +override+ the defaults built into mame itself.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:Yesterday at 01:30:54 pm
  • ...
Re: Find replace keys for default mame configuration
« Reply #5 on: December 16, 2013, 10:38:17 am »
Just open the in-game menu in any game (TAB) and choose the option to map the controls for all games.

Not sure what your button layout is, but MAME assumes you have this layout:
123
456

If you have that "straight six" layout and map them in that order, nearly all games will be mapped correctly.

spratkobasa

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:January 23, 2019, 09:10:43 am
  • I want to build my own arcade controls!
Re: Find replace keys for default mame configuration
« Reply #6 on: December 16, 2013, 11:40:08 am »
I am doing the map but certain things I don't know how to map.  I'm using a joystick for movement (u360) and a ipac for buttons.  Should I map the diagonal directions to key or just make them none?  On default they are letters.  Also I can't find the default for gear shift in outrun, I had to make a custom configuration file for that game as it wasn't in the default control list.

So I have two questions really:
1) Should I map the diagonals or just leave them as none (considering I use all u360 joysticks)
2) Which controller functions should I not map or disable (as there seems to be so many different ones I don't know what to do with) (i.e.  Mouse X analog Dec is left key by default, should I remap that to Joy Left? or leave it alone, same with AD stick, Track, Dial, Positional, etc).

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9270
  • Last login:Yesterday at 01:30:54 pm
  • ...
Re: Find replace keys for default mame configuration
« Reply #7 on: December 16, 2013, 12:11:00 pm »
I am doing the map but certain things I don't know how to map.  I'm using a joystick for movement (u360) and a ipac for buttons.  Should I map the diagonal directions to key or just make them none?  On default they are letters.  Also I can't find the default for gear shift in outrun, I had to make a custom configuration file for that game as it wasn't in the default control list.

So I have two questions really:
1) Should I map the diagonals or just leave them as none (considering I use all u360 joysticks)
2) Which controller functions should I not map or disable (as there seems to be so many different ones I don't know what to do with) (i.e.  Mouse X analog Dec is left key by default, should I remap that to Joy Left? or leave it alone, same with AD stick, Track, Dial, Positional, etc).

1) I don't remember seeing diagonals.  If you mean the ones that say "Left Up" "Left Right" ect, those are for games where each player has two joysticks like Smash TV.  It means left joystick up, left joystick right. (left joystick being the joystick that is held in the left hand)

2) Depends on which games you expect to play.  If you do not have a spinner, but want to try playing spinner games with your joystick, then yes, map your joystick to those.  Most games that had analog or optical controls will require you to tweak the analog settings in each game for them to play correctly though.  That has to be done in each game individually.

spratkobasa

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 92
  • Last login:January 23, 2019, 09:10:43 am
  • I want to build my own arcade controls!
Re: Find replace keys for default mame configuration
« Reply #8 on: December 16, 2013, 12:28:47 pm »
Thanks Badmouth, I thought they were for diagonals but that was exactly what I was talking about.  I don't have a spinner so I guess I can leave all those controls alone.  So I guess I should just map the basic controls and not touch anything else.

Emmalyn33

  • Trade Count: (0)
  • Newbie
  • *
  • Offline Offline
  • Posts: 1
  • Last login:December 17, 2013, 02:56:45 am
  • I want to build my own arcade controls!
Re: Find replace keys for default mame configuration
« Reply #9 on: December 17, 2013, 02:57:31 am »
Good supportive language are used in this post I like very much the review of this fashionable post and subscribe it so give more details about.Thanks.