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: how to get full listing of key mappings in mame?  (Read 2750 times)

0 Members and 1 Guest are viewing this topic.

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
how to get full listing of key mappings in mame?
« on: April 10, 2008, 01:43:38 am »
I'm working on my key mappings right now and I'm reminded once again that whenever I want to assign a key to some function I always worry "what else is this key assigned to", and then I have to go on a hunt through the "input (general)" menus.

I'd really ultimately like a way to list mappings in one complete list based on key, not function. In other words, "x is mapped to function1 and function2" kind of thing.

I don't supposed there's some program out there that can do this, is there?

I'm tempted to write a program to do it, but the problem is getting that information to begin with. Default.cfg only lists the changes, not ALL the mappings. Is there some way to call into mame for the full list, or some file other than default.cfg that contains a full list?

If not, I guess the alternative would be to "import" the defaults from the mame source. But that's not ideal because I would either have to assume that the inputs never change from one release of mame to the next, or rebuild the program for every release. I know the mappings don't change frequently, but you never know, and I'd hate to generate incorrect information because I didn't update the program after a default mapping change.
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: how to get full listing of key mappings in mame?
« Reply #1 on: April 10, 2008, 02:20:47 pm »
I'm working on my key mappings right now and I'm reminded once again that whenever I want to assign a key to some function I always worry "what else is this key assigned to", and then I have to go on a hunt through the "input (general)" menus.

I'd really ultimately like a way to list mappings in one complete list based on key, not function. In other words, "x is mapped to function1 and function2" kind of thing.

I don't supposed there's some program out there that can do this, is there?

I'm tempted to write a program to do it, but the problem is getting that information to begin with. Default.cfg only lists the changes, not ALL the mappings. Is there some way to call into mame for the full list, or some file other than default.cfg that contains a full list?

If not, I guess the alternative would be to "import" the defaults from the mame source. But that's not ideal because I would either have to assume that the inputs never change from one release of mame to the next, or rebuild the program for every release. I know the mappings don't change frequently, but you never know, and I'd hate to generate incorrect information because I didn't update the program after a default mapping change.

Yup, the best source for the full list is, ehem, the source files (src/emu/inptport.c, line ~450, default_ports_builtin[] array).  I think easyemu has a very old list.  The defaults rarely changes, but as you say, you never can predict when it will happen.

I've thought of hacking mame to output all defaults to default.cfg a few times, but it's pretty easy to cut and paste from the source to a spreadsheet or DB and sort from there.  If you edit the source to save all maps, I'd edit save_default_inputs() (if just the defaults) or save_game_inputs() (if all games).  You might want to do it differently, but that's the quickest hack, IMO.
Robin
Knowledge is Power

TheShanMan

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1912
  • Last login:October 22, 2024, 11:51:12 am
    • My Arcade (updated 1/30/13)
Re: how to get full listing of key mappings in mame?
« Reply #2 on: April 10, 2008, 02:57:17 pm »
Well that's a bummer, but at least I know what I have to work with. It would be nice if mame actually prompted the user when they change a mapping and cause a conflict - "x is already mapped to function1. Would you like to delete that mapping?"

Maybe if I decide to write a little program, I'll have it prompt for the location of the mame source (for default mappings) as well as the mame install (for changed mappings). That way the program won't become outdated and misleading if a default mapping does change.

Thanks for the info!
My Collection: Mame cab, 38 dedicated vids, pin, skeeball, coin op air hockey table, Ice Cold Beer, Megatouch, 2 token machines, and payphone (VAPS, pics at Arcade Crusade)

Add Ambience to your mame cab setup

u_rebelscum

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3633
  • Last login:April 21, 2010, 03:06:26 pm
  • You rebel scum
    • Mame:Analog+
Re: how to get full listing of key mappings in mame?
« Reply #3 on: April 10, 2008, 06:00:22 pm »
Well that's a bummer, but at least I know what I have to work with. It would be nice if mame actually prompted the user when they change a mapping and cause a conflict - "x is already mapped to function1. Would you like to delete that mapping?"

I know what you mean, but ...

I'd rather have mamedev code the harder emulation stuff than spend their limited voluntary time working on UI bells and whistles.  And if you look at the defaults, there are a lot of double/multiple mapped keys already; just most people don't notice.  Examples: the left stick of player 1's dual joysticks overlaps keys with player 2's buttons, and the arrow keys are mapped to 8-way 4-way, analog stick, spinner, TB, lightgun, and the in-game UI.  So doing so might add confusion in some places even if done correctly.

Quote
Maybe if I decide to write a little program, I'll have it prompt for the location of the mame source (for default mappings) as well as the mame install (for changed mappings). That way the program won't become outdated and misleading if a default mapping does change.

That would be cool.  You might want it to read the ctrlr file (and mame.ini for which ctrlr file if any is used), as well as the normal cfg files.  (But then you'd need to parent-clone and game-driver relationships is you wanted to parse the ctrlr like mame does.)  If you have any questions on mame's input structure and how it works, be sure to ask. :)  (Not that it's hard, just sort of different than most people think of inputs.) 

If you do decide to, good luck and please post it here; I'm sure others are interested. :applaud:
Robin
Knowledge is Power

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: how to get full listing of key mappings in mame?
« Reply #4 on: April 10, 2008, 07:23:14 pm »
TheShanMan: Check out CPWizards Data folder it has a file called std.ini that contains the Mame default keys.