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 about a way to get button mappings through MAME?  (Read 2660 times)

0 Members and 1 Guest are viewing this topic.

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
How about a way to get button mappings through MAME?
« on: October 07, 2004, 12:27:10 pm »
  Now that I'm all moved in to my new pad and the Ghost Arcade has it's own room, I've been inspired to upgrade it and to play around with all the new fun utilities out there again, like upgraded FEs, upgraded emus, control panel viewers, ctrlr-file converters, etc.

  So, I finally got around to setting up a control-panel viewer (CPViewer) and have it launch in MAMEWAH.  Everything works awesome and almost all the games in the controls.dat database show up correctly, except for the controls that I've explicitely remapped in my ctrlr.cfg file.  :-\  I thought about writing to the author and ask about this, and I was all set to do this this morning when I left for work.

  ...But on my way to work, something weird happened. I had a thought!  :)

  Why not, instead of all these applications (CPViewer, CPMaker, etc) making thier own routines to figure out these mappings, patch the MAME executable to accept a command-line switch that will simply let MAME figure out the mappings like it always does, output them to STDOUT, then exit?

  I spent some time yesterday going through the MAME source, but even though I'm *not* a C programmer, it seems like the MAME source is built very nicely for something like this.

  This kind of organization of features seems like it would be so much more beneficial to the community, than for one application after another implementing the same feature.

  What do you think?

-Steve

2600

  • Trade Count: (+7)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1630
  • Last login:June 05, 2017, 10:20:56 am
  • I want my own arcade controls!
Re:How about a way to get button mappings through MAME?
« Reply #1 on: October 07, 2004, 01:03:38 pm »
Already done(better implementation then what you said) and one of the best reasons to compile your own version of MAME.

It allows the image of the CP "viewers" "makers" to be displayed when you press Pause in mame.

Patch for 0.87
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=25058;start=msg205549#msg205549

Original Thread
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=22096;start=0

Edit: I don't think CPviewer supports this function only Johnny5 and CPmaker.
« Last Edit: October 07, 2004, 01:05:37 pm by 2600 »

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re:How about a way to get button mappings through MAME?
« Reply #2 on: October 07, 2004, 01:25:34 pm »
Yeah, this is great and all, but I'm not going to use it. Why?

1) Because I run multiple emulators on my cab.

  It will be a lot easier, cheaper, and more universal if the CP viewing functionality were implemented at the FE level, a-la CPViewer (or built in!). If it's in MAME, it's reasonable to expect it in all the other emulators as well.  Getting the other emulators to provide such functionality will be more trouble than it's worth, especially when those mappings are pretty static anyway.

2) It would require me to have a pause button on my CP.
3) There's a training issue that I don't want to, and shouldn't have to deal with.

  In my skin for my FE, I show everyone what the buttons do. I don't need to explain anything to the users in order for them to play any one of the 10,000 games across emulators.  I like it that way. :)

-Steve

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How about a way to get button mappings through MAME?
« Reply #3 on: October 07, 2004, 03:29:20 pm »
Well, there's issues with that which were all discussed when controls.dat started.  Second, the mame devs are picky about what new things go into mame.  I don't see it happening.

I don't really like that right now the only way to use the controls.dat project is througha  3rd party viewer.  I think the project will take off once an frontend has direct support within it.

Quote
Yeah, this is great and all, but I'm not going to use it. Why?
Why? Because you are stubborn :)

Quote
1) Because I run multiple emulators on my cab.
 How many ARCADE emulator?  Console emulators don't need something like this, we know what button A is and button B is.  now if yu want to know what they do you are going to have to plea the console people to make something for that.  But most people will just tell you to goto gamefaqs.com and look up the controls.

Quote
2) It would require me to have a pause button on my CP.
well, most people do have a way on their control panel to pause.  So nothing isn't going to change for just one person.  I don't know if Buddabing is still looking into having a dedicated key to show CPMaker which would be more helpful.  Either way you could have it setup so something like player 1 start and player 1 button 1 brings up th controls.  So you don;t need a dedicated pause button or cpmaker button etc...  You can put this info in the skin of your FE telling your users what to do.  Frankly, I'd put something like that on an instruction card on the cabinet though, would be very arcade like :)

Quote
3) There's a training issue that I don't want to, and shouldn't have to deal with.
Bah, you are going to ge this whether or not you have your entire bezel as an instruction card.  People don't like to read when they can just ask.  Also having a pause button so you can read the info is helpful.



screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re:How about a way to get button mappings through MAME?
« Reply #4 on: October 07, 2004, 04:19:51 pm »
Well, there's issues with that which were all discussed when controls.dat started.

  Care to share?  I searched in the Controls.dat forum but couldn't find anything regarding it.

-Steve

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How about a way to get button mappings through MAME?
« Reply #5 on: October 07, 2004, 08:30:49 pm »
well, like I said, the biggest reason is it probably wouldn't get into official mame without a fight.

I know NoNameMame would put it in.  

Most of the talk was here, BTW.
Right now Buddabing's idea of having an image generator then show the image in mame on pause is the closest thing you got.
Many people talked about having a dedicated tab menu, the problem with that is mame treats that interesting sometimes and you couldn't get a high enough resolution out of it to understand what is going on, especially with games that have weird controls and many labels.

Like I said, I think the perfect location for the controls.dat project is built into an FE.  Before you run the emulator itself.  That way if you want to hack to console emus you can if you follow the same format.

Also, at the time when the project started people asked why not just have it in the tab menu when you goto map the keys for that game, have those menu options as the labels.  The problem with that is then you don't know what button is button 1 or where on the realy machine kick actually was.  Mame's button order isn't always the button order on the control panel.
Then there's all the changes that have been happening to the control system.  The project would have to be rewritten over and over if it were directly in mame.

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re:How about a way to get button mappings through MAME?
« Reply #6 on: October 07, 2004, 09:21:47 pm »
 Now that I'm all moved in to my new pad and the Ghost Arcade has it's own room, I've been inspired to upgrade it and to play around with all the new fun utilities out there again, like upgraded FEs, upgraded emus, control panel viewers, ctrlr-file converters, etc.

  So, I finally got around to setting up a control-panel viewer (CPViewer) and have it launch in MAMEWAH.  Everything works awesome and almost all the games in the controls.dat database show up correctly, except for the controls that I've explicitely remapped in my ctrlr.cfg file.  :-\  I thought about writing to the author and ask about this, and I was all set to do this this morning when I left for work.

  ...But on my way to work, something weird happened. I had a thought!  :)

  Why not, instead of all these applications (CPViewer, CPMaker, etc) making thier own routines to figure out these mappings, patch the MAME executable to accept a command-line switch that will simply let MAME figure out the mappings like it always does, output them to STDOUT, then exit?

  I spent some time yesterday going through the MAME source, but even though I'm *not* a C programmer, it seems like the MAME source is built very nicely for something like this.

  This kind of organization of features seems like it would be so much more beneficial to the community, than for one application after another implementing the same feature.

  What do you think?

-Steve

I see what you're saying. It's pretty impractical, though, because MAME takes so long to load. You'd have to load MAME once to get your control mappings, then load it again to run a game! Then what would you do with the control mappings once they were sent to stdout? Display plain text, or create a nice picture like CPViewer et al do? If you're going to patch the executable, you might as well go whole hog and put in the display code.

As far as having a separate viewer from the MAME executable, I'm working on unifying the whole display thing into one patch. That way it should be cross-platform compatible for the DOS and Linux people.

I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How about a way to get button mappings through MAME?
« Reply #7 on: October 08, 2004, 01:07:48 am »
As far as having a separate viewer from the MAME executable, I'm working on unifying the whole display thing into one patch. That way it should be cross-platform compatible for the DOS and Linux people.

Another good point.  This is why HowardC made the viewer.  You would have though he would have just put it in Dragon King and be done with t.  But no, we wanted FE Devs to start using the project which in turn would get more people interested which in turn will make the project grow quicker
So to make it easy on the FE devs he made the viewer.

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re:How about a way to get button mappings through MAME?
« Reply #8 on: October 08, 2004, 10:01:10 am »
I see what you're saying. It's pretty impractical, though, because MAME takes so long to load. You'd have to load MAME once to get your control mappings, then load it again to run a game!

  Hmm.. good point. Then how about a MAME executable that had all it's innards ripped out and was simply a stub used only to print out the key mappings?  It would be cross platform AND quick, no?

  Also, the key mappings are exactly the same within the same MAME version, so they can be cached. You run a process once in the beginning and you could have a whole database of key mappings ready to go!  Or if you didn't want to run the whole thing at once, whenever you run for that particular game you cache it!  MAME has a --version switch already, doesn't it?

Then what would you do with the control mappings once they were sent to stdout? Display plain text, or create a nice picture like CPViewer et al do?

  What would you do?  Anything you want!  If they were output in a standard format, similar even to the old-style ctrlr.ini files:

^\s*(P{1,2,3,4}_BUTTON{1,2,3,4,5,6,7,8})\s+(KEYCODE_A\s+[\||\&]\s+KEYCODE_B)\s*$

(my regex is a little rusty, but you get the idea)

   ...You could use them in a FE, CP viewer, anything!  When a program builds a gamelist, it could very easily run this program to figure out the key mappings for each game.  Sure it would take a while, but it only needs to be done once!  Compared to the several hours (sometimes days) required to set up an entire front-end, this is a very minor step.

If you're going to patch the executable, you might as well go whole hog and put in the display code.

  True, as long as there were still just a way to JUST extract the key mappings.  Remember, ideally you want this to be universal, or compartmentalized, in order to extend the functionality as much as possible. The less work that needs to be duplicated, the faster new programs with new functionality could be developed.

  Would your patched MAME executable be able to display a static image (like a CP mapping for you NES list that doesn't change every game)?

As far as having a separate viewer from the MAME executable, I'm working on unifying the whole display thing into one patch. That way it should be cross-platform compatible for the DOS and Linux people.

  That's a great idea! I think that the work you're doing is sorely needed.  Keep up the great work!

-Steve

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How about a way to get button mappings through MAME?
« Reply #9 on: October 08, 2004, 10:49:46 am »
 What would you do?  Anything you want!  If they were output in a standard format, similar even to the old-style ctrlr.ini files:

^\s*(P{1,2,3,4}_BUTTON{1,2,3,4,5,6,7,8})\s+(KEYCODE_A\s+[\||\&]\s+KEYCODE_B)\s*$

(my regex is a little rusty, but you get the idea)

   ...You could use them in a FE, CP viewer, anything!  When a program builds a gamelist, it could very easily run this program to figure out the key mappings for each game.  Sure it would take a while, but it only needs to be done once!  Compared to the several hours (sometimes days) required to set up an entire front-end, this is a very minor step.

Oh, I think I understand what you are talking about.  There's another good reason to not have mame tell you what controls and mappings.  Well, you can get the key mappings in the new versions of mame easy enough.  if you use ctrlr files just parse that.  Then there is the cfg files.  Both of which are in XML.

However, one of the reasons for the controls.dat project is the fact mame is pretty inaccurate about telling you what controls it needs.  There are many games that list more buttons as needed because of reused macros and such.  Devs to some shortcuts in many of the drivers.  Until all of that is fixed in mame FIRST then you could do something like this and have accurate information.

screaming

  • Sweet! I'mma go make me some popovers!
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2124
  • Last login:August 14, 2019, 03:15:34 pm
  • Registered lUser
    • shift eight (*) generation
Re:How about a way to get button mappings through MAME?
« Reply #10 on: October 08, 2004, 10:58:44 am »
However, one of the reasons for the controls.dat project is the fact mame is pretty inaccurate about telling you what controls it needs.  There are many games that list more buttons as needed because of reused macros and such.  Devs to some shortcuts in many of the drivers.  Until all of that is fixed in mame FIRST then you could do something like this and have accurate information.

  So you don't think that even the MAME output filtered through the controls.dat database would be useful?

-Steve
« Last Edit: October 08, 2004, 11:30:33 am by screaming »

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:Yesterday at 11:04:07 pm
  • The Bears Still Suck!
Re:How about a way to get button mappings through MAME?
« Reply #11 on: October 08, 2004, 12:03:16 pm »
No, because you could just parse the controls.dat file.  Why would it have to go through mame?

Actually, what I'd like to see is controls.dat support in mame, but have it like the history.dat file.  It would be a menu option in mame that would bring up a scrolling text box like the history.dat support.  A summary of the game's controls could be listed then.

Buddabing's stuff is pretty cool too even though it, too, has disavantages such as the graphics have to adhear, somewhat, to the resolution/orientation the game is running at.

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:How about a way to get button mappings through MAME?
« Reply #12 on: October 11, 2004, 10:46:56 am »
Edit: I don't think CPviewer supports this function only Johnny5 and CPmaker.
Do you have a link for CPmaker???
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

2600

  • Trade Count: (+7)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1630
  • Last login:June 05, 2017, 10:20:56 am
  • I want my own arcade controls!
Re:How about a way to get button mappings through MAME?
« Reply #13 on: October 11, 2004, 11:25:06 am »
Here's the thread for the released version:
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=25555;start=msg210228#msg210228

Here's the thread for Buddabing's Beta and Development.
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=23986;start=0

I haven't had a chance to try the released, but some info in the thread my help if you get stuck.  I don't have the link to Johnny5 off hand, but I think you'll need that to make your own layout.

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re:How about a way to get button mappings through MAME?
« Reply #14 on: October 11, 2004, 11:50:28 am »
Here's the thread for the released version:
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=25555;start=msg210228#msg210228

Here's the thread for Buddabing's Beta and Development.
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=23986;start=0

I haven't had a chance to try the released, but some info in the thread my help if you get stuck.  I don't have the link to Johnny5 off hand, but I think you'll need that to make your own layout.


I can't find a link to Johnny either. Howard may have taken it down. CPViewer uses XML for its layout files, so I can make CPMaker work with both Johnny and CPViewer layouts.

Or you can do what I did and hand-edit the layout files. :) Maybe not.

Please contact me if you have problems getting CPMaker to work.

I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:How about a way to get button mappings through MAME?
« Reply #15 on: October 11, 2004, 11:57:30 am »
Here's the thread for the released version:
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=25555;start=msg210228#msg210228

Here's the thread for Buddabing's Beta and Development.
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=23986;start=0

I haven't had a chance to try the released, but some info in the thread my help if you get stuck.  I don't have the link to Johnny5 off hand, but I think you'll need that to make your own layout.


I can't find a link to Johnny either. Howard may have taken it down. CPViewer uses XML for its layout files, so I can make CPMaker work with both Johnny and CPViewer layouts.

Or you can do what I did and hand-edit the layout files. :) Maybe not.

Please contact me if you have problems getting CPMaker to work.


Okay, I have Johhny 5 already.  It works under Win2K if I hand edit the layout files like you said.  It crashes and burns under Win98.

Is CPmaker a standalone replacement for Johnny5, or do I still need Johnny 5 to use it?
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re:How about a way to get button mappings through MAME?
« Reply #16 on: October 11, 2004, 12:11:08 pm »

Okay, I have Johhny 5 already.  It works under Win2K if I hand edit the layout files like you said.  It crashes and burns under Win98.

Is CPmaker a standalone replacement for Johnny5, or do I still need Johnny 5 to use it?

What crashes and burns? CPMaker or Johnny?

CPMaker does not have the handy editing functions that Johnny and CPViewer have. It's just a batch process that takes some input files and produces an output file. It's not necessary to have any other program in order to use CPMaker.

CPMaker also has a PHP version, so if you are a web page guru you could dynamically generate web pages that take a user input and produce a CP image from it.
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

Tiger-Heli

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5447
  • Last login:January 03, 2018, 02:19:23 pm
  • Ron Howard? . . . er, I mean . . . Run, Coward!!!
    • Tiger-Heli
Re:How about a way to get button mappings through MAME?
« Reply #17 on: October 11, 2004, 12:14:33 pm »

Okay, I have Johhny 5 already.  It works under Win2K if I hand edit the layout files like you said.  It crashes and burns under Win98.

Is CPmaker a standalone replacement for Johnny5, or do I still need Johnny 5 to use it?

What crashes and burns? CPMaker or Johnny?

CPMaker does not have the handy editing functions that Johnny and CPViewer have. It's just a batch process that takes some input files and produces an output file. It's not necessary to have any other program in order to use CPMaker.

CPMaker also has a PHP version, so if you are a web page guru you could dynamically generate web pages that take a user input and produce a CP image from it.
Johnny crashes and burns - I haven't tried CPMaker yet.
It's not what you take when you leave this world behind you, it's what you leave behind you when you go. - R. Travis.
When all is said and done, generally much more is SAID than DONE.