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: Demonstration: Dynamic Control Panel Background Image Generation  (Read 10524 times)

0 Members and 1 Guest are viewing this topic.

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!
Hello,

I have been experimenting with a way to generate control panel background images on the fly. I've written a program which will take image pieces and compose them into an image for use either as input into a control panel viewer (johnny5, cpviewer) or directly into MAME to be displayed there via my control panel display patch.

If there's any interest in this, I can flesh this out into an application that will take a game name and create an image with the unused controls dimmed.

Hopefully this demo image will display.
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!

Goz

  • KOTA
  • Trade Count: (+10)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3421
  • Last login:June 25, 2024, 10:06:41 pm
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #1 on: August 30, 2004, 01:30:05 pm »
Damn.... looks good


visciouslymamed

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 68
  • Last login:December 02, 2011, 08:38:46 pm
  • I want to Build My Own Arcade Controls!!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #2 on: August 30, 2004, 06:29:40 pm »
Quote
If there's any interest in this, I can flesh this out into an application that will take a game name and create an image with the unused controls dimmed.

Interested! 8) ;D 8)

walls83

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1146
  • Last login:July 10, 2017, 02:58:45 pm
  • beer is good
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #3 on: August 30, 2004, 06:34:31 pm »
Yes Yes Yes.  Is there anyway to get it to come up when you hit pause.?  So when people are playing they can just hit pause to see what buttons are being used?
"A true warrior enters the arena with all his powers at the ready." ~ Gouki

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #4 on: August 30, 2004, 07:36:09 pm »
Looks very good :)

Haven't had chance to check out your patch yet...must do so...

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #5 on: August 30, 2004, 11:41:30 pm »
Yes Yes Yes.  Is there anyway to get it to come up when you hit pause.?  So when people are playing they can just hit pause to see what buttons are being used?

Yep.

See the "proof of concept of Howard's idea" thread. Howard's idea was to make his Johnny 5 viewer into a batch process, which MAME could then call to generate an image which would be displayed on pause. Long story short, skip to the end of the thread and you can download my patches.

This application, if I create it, would go in front of Johnny. I would create the background image, Johnny would put the labels on it, then MAME would display 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!

walls83

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1146
  • Last login:July 10, 2017, 02:58:45 pm
  • beer is good
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #6 on: August 30, 2004, 11:55:17 pm »
Very Nice work.  Thanks so much for doing this.   ;D
"A true warrior enters the arena with all his powers at the ready." ~ Gouki

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #7 on: August 31, 2004, 09:23:16 am »
I really like it, but it won't work the way you want it to. Johnny5 dynamically remaps buttons according to ctrlr files, so button 5 isn't always in the same place, or what have you.  

Example:  Mortal kombat II

It has five buttons, but it is totally unplayable unless you remap the buttons.  The way you remap it is a sf2 conversion layout as described in the mk2 manual.  The bottom row is low punch, block, low kick.  The top row is high punch, block (a double binding), high kick.

Anyway, my point is without the dynamic reading of the ctrlr files, your viewer is simply going to activate the bottom row and two buttons on the top, which will just look odd.  This will happen quite often for anyone who remaps their buttons for anything.  :(

Now proper dynamic generation can be done, but only on my end.  Atm, however, I need to concentrate on improving accuracy and speed.  Dynamic generation may be added in the future, however.  

Btw I hope to credited frosty for the images.  ;)

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #8 on: August 31, 2004, 12:13:26 pm »
Cool, I know this is a demo but a couple of suggestions.

First, what HowardC said.  Physically each button on your control panel is mapped as sometype of keypress (or joystick button press, etc..).  It could be wired to more than one input, I have seen people do that.  There can be duplicates, like duplicate KEYCODE_A because someone setup a 7 button layout.  SO what you have to do, like the johnny5 viewer, is associate a keycode to the buttons on screen.  THEN use the ctrlr files (and now possibly the XML cfg files which parse exactly the same as the ctrlr files :) ) to display the correct control.  

After that it is taking the idea to the next step, allowing for rotating panels, swappable panels (esentially the same thing as rotating panels for this project), and modular panels.  Modular would be extremely hard as there are different modular sysstems/ideas though a person using a modular system would probably figure something out on how to make this idea work with what they use.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #9 on: August 31, 2004, 02:00:30 pm »
Exactly.... which is why I say it'll be far easier to do on my end as johnny 5 is already setup to do most of that.  I'll have have to wait until i can get a break from the big part of the code and see what i can do.  

I think it's cool, I'm just not sure about the functionality.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #10 on: August 31, 2004, 05:40:03 pm »
I think the functionality is great.  Being visually able to see hwich buttons are used, even if the labels are added.

PedroSilva

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 373
  • Last login:August 01, 2018, 08:37:57 am
  • Grettings !
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #11 on: September 02, 2004, 05:34:48 am »
Forgive my ignorance but ... isn't it more simple to display the "actual" Control Panel image ?

<<---

or am I missing something ?

hunky_artist

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 179
  • Last login:April 15, 2006, 06:39:21 pm
  • I want my own arcade controls!
    • www.pennylanepictures.com
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #12 on: September 02, 2004, 07:05:08 am »
you're missing something my friend :)

most people don't have a replica of an actual CP... they have one with maybe 2 joysticks... and 6 buttons per joystick.

so for newcomers to the machine, and for people playing a new game, they will know what buttons to use  ;D
www.pennylanepictures.com

(my art website) :)

PedroSilva

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 373
  • Last login:August 01, 2018, 08:37:57 am
  • Grettings !
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #13 on: September 02, 2004, 07:29:28 am »
you're missing something my friend :)

most people don't have a replica of an actual CP... they have one with maybe 2 joysticks... and 6 buttons per joystick.

so for newcomers to the machine, and for people playing a new game, they will know what buttons to use  ;D

So the project isn't only for showing the controls, but to associate de ones we have on our machines to the originals ? Is that it ?
If so ... there must also exist a config file per machine with the cp config for that machine, right ?

Yap ... like that ... I thing it's most useful  :)

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #14 on: September 02, 2004, 10:11:17 am »
Also the control panel images are of poor quality, have fun reading them.  Also many of the control panel pics can be generic setups or conversion kits so they aren't the right controls anyway :(  yeah, it's crazy to figure this all out :)
« Last Edit: September 02, 2004, 10:12:48 am by SirPoonga »

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #15 on: September 02, 2004, 08:13:44 pm »
After that it is taking the idea to the next step, allowing for rotating panels, swappable panels (esentially the same thing as rotating panels for this project), and modular panels.  Modular would be extremely hard as there are different modular sysstems/ideas though a person using a modular system would probably figure something out on how to make this idea work with what they use.
I have some ideas on how to handle swappable or rotating panels. Modular can be done, but will be a big headache.

I shamelessly thieved the controls artwork from Frosty.  ;D
I resized Frosty's collage so that his buttons would be the same size as the buttons on my template image. Should have done it the other way. I cut out and saved each little piece (the black button, joystick, etc) from Frosty's collage that I would use. To create the dim pieces, I used gimp and changed the opacity. Very simple, once I found the right menu. I also used gimp to remove all artwork from the picture of the HotRod SE that I'm using.

The purpose of this project is to educate myself on gimp and on the use of the ImageMagick graphics libraries, not to "one up" the cpviewer guy or Howard. I had not originally intended to put labels on the image, but there's a whole bunch of interesting API functions to draw text, so I will probably do so.

Getting the correct pieces to dim has certainly been an adventure.  :)

I think the next iteration of this program will blow your socks off.
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!

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1962
  • Last login:June 30, 2025, 02:20:39 pm
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #16 on: September 03, 2004, 12:26:11 am »
I had not originally intended to put labels on the image, but there's a whole bunch of interesting API functions to draw text, so I will probably do so.

Generated text fed from the controls.dat would be awesome!

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #17 on: September 03, 2004, 12:47:38 am »
Out of curiosity, why gimp?  I'm a hardcore linux fan.  But I hate gimp.  It is not as easy to use as photoshop.  Ok, soi it is free, but you have to jump through hoops sometimes to get things done in it.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #18 on: September 03, 2004, 03:03:23 am »
Agreed.... you get what you pay for when it comes to design software and gimp is free.... enough said.

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #19 on: September 03, 2004, 09:48:25 am »
Out of curiosity, why gimp?  I'm a hardcore linux fan.  But I hate gimp.  It is not as easy to use as photoshop.  Ok, soi it is free, but you have to jump through hoops sometimes to get things done in it.
Gimp certainly can be awkward. But I have two reasons to use it.

1. It's free.
2. Adobe screwed me in a business deal ten years ago and I vowed never to spend another dime on their software.

#2 more important than #1. :)
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!

Minwah

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 7662
  • Last login:January 18, 2019, 05:03:20 am
    • MAMEWAH
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #20 on: September 03, 2004, 09:52:36 am »
Gimp certainly can be awkward. But I have two reasons to use it.

1. It's free.
2. Adobe screwed me in a business deal ten years ago and I vowed never to spend another dime on their software.

#2 more important than #1. :)

Good reasons, but screw Adobe and get on Kazaa/similar  ;) ::)

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!
More than just a demo....
« Reply #21 on: September 03, 2004, 07:04:59 pm »
Hello,

I thought I would get a preliminary version of the dynamic control panel background image generator posted. I call it CPMaker.

There are some bugs. Most notably, only the default controller configuration works, special entries in the ctrlr files don't work. Also, the program may wrongly object if any of the optional files are not used.

Installation of this program is a bit cumbersome.

[EDIT: Remove dead links and installation instructions]

I'll try to iron out the known bugs soon.

Regards,
Buddabing

EDIT: removed the environment variables and changed the font link.

« Last Edit: September 10, 2004, 10:53:55 pm by Buddabing »
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!

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #22 on: September 09, 2004, 03:23:59 pm »
I thought I would post a screen shot of the next version of this program. There will be new features, including multi-panel support.

This image was generated for the game mk. Notice that the controls for player 2 are in weird positions and that there is only one block button, compared to two on player 1. That is because I have ctrlr file entries that remap the player 1 buttons and not the player 2 buttons.
« Last Edit: September 09, 2004, 03:27:23 pm by Buddabing »
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!

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #23 on: September 09, 2004, 04:56:52 pm »
That's pretty nice Buddabing.  I've been using Howard's viewer and can't wait for his new release.  It seems this upcoming release of your's may be pretty functional, would that be a fair assesment?

Really great work with all of your controls work.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #24 on: September 09, 2004, 11:13:55 pm »
Cool, Now, I just want to make sure you are reading the ctrlr files correctly.  you have the heirarchy down, right?  Also which version of the ctrlr files are you currently using?

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #25 on: September 09, 2004, 11:29:39 pm »
Cool, Now, I just want to make sure you are reading the ctrlr files correctly.  you have the heirarchy down, right?  Also which version of the ctrlr files are you currently using?

Uh, there's a hierarchy to ctrlr files? Please explain. All I'm doing is reading the default and overriding it if there is a game-specific "system" section.

For debugging purposes, it would be nice if you send me some more complex examples and what the result should be. My email is buddabing at houston dot rr dot com.

The XML-style ctrlr files will be required.
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!

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1962
  • Last login:June 30, 2025, 02:20:39 pm
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #26 on: September 10, 2004, 04:45:26 am »
Budda, where are you getting the "High Kick" "Low Kick" and stuff from?  Is that in the MK ctrl file?  Or are you extracting that from controls.dat?

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #27 on: September 10, 2004, 09:10:24 am »
Budda, where are you getting the "High Kick" "Low Kick" and stuff from?  Is that in the MK ctrl file?  Or are you extracting that from controls.dat?

From controls.xml. The new XML version will be required in order for labels to show. Hopefully it'll be an incentive for people to submit their favorite games to the database.

Required files will be:
cpmaker.ini (my own comma-delimited file which tells what controls each panel has)

Optional files:
.lof file (Johnny 5 format, to tell where to put the labels)
controls.xml (new XML format, to tell what the labels are and which controls are to be dimmed)
ctrlr file (new XML format, to tell how to map the controls to keycodes)
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!

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #28 on: September 10, 2004, 09:47:35 am »
I'm sure SirPoonga or HowardC will elaborate, but besides games specific settings and the default you can have controls by system.  I.E.  you could have controls labeled neogeo and all neogeo games would be set up for that control.  There's a few more settings besides system too, but I forget off hand. SirPoonga and HowardC have the whole heirachy thing down, It's been posted a few times before, but forget which post.  As for controls, you should try some of the default ones.  I know slikslik and a few of the others have a few different control files already setup.

Found a link, where Howard describes it:
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=24089;start=msg197877#msg197877

« Last Edit: September 10, 2004, 10:17:20 am by 2600 »

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #29 on: September 10, 2004, 11:21:00 am »
I'm sure SirPoonga or HowardC will elaborate, but besides games specific settings and the default you can have controls by system.  I.E.  you could have controls labeled neogeo and all neogeo games would be set up for that control.  

Found a link, where Howard describes it:
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=24089;start=msg197877#msg197877

That thread describes the old controller format.

Here's a snippet of code which tells MAME whether or not to ignore a "system" entry:

   curfile.data.ignore_game =
      (strcmp(attributes[attr + 1], "default") != 0
&& strcmp(attributes[attr + 1], Machine->gamedrv->name) != 0
&& strcmp(attributes[attr + 1], Machine->gamedrv->source_file) != 0
&& (Machine->gamedrv->clone_of == NULL || strcmp(attributes[attr + 1], Machine->gamedrv->clone_of->name) != 0)
&& (Machine->gamedrv->clone_of == NULL || Machine->gamedrv->clone_of->clone_of == NULL || strcmp(attributes[attr + 1], Machine->gamedrv->clone_of->clone_of->name) != 0));

This tells MAME to ignore the "system" if
1) the system name is not "default"
2) the source file is not the same as the system name. So, if you had <system name="namcos2.c"> you would have to process that system if the target game is defined anywhere in namcos2.c, even if it is not a clone.
3) the system name is not "target gamename". This will take care of <system name="mk"> for Mortal Kombat.
4) the system name is not a cloneof or romof of "gamename", so <system name="neogeo"> will be processed for mslug or other neogeo games. Mslug has "romof neogeo".
5) the system name is not a clone of a cloneof of "gamename". What a mess. Can't think of any examples.

I don't see any hierarchical structure in the loading. As far as I can tell, it applies the systems in the order it loads them.

I also don't see where MAME would acknowledge a system name of "raster" or "vector".

In order to accurately get which systems to apply in the ctrlr file, it looks like it is necessary to parse the listxml output of MAME first. What a pain.

Quote

There's a few more settings besides system too, but I forget off hand. SirPoonga and HowardC have the whole heirachy thing down, It's been posted a few times before, but forget which post.  As for controls, you should try some of the default ones.  I know slikslik and a few of the others have a few different control files already setup.

I'm testing off the HotRod SE ctrlr file. The Slikstik has a few other game-specific systems set up.
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!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #30 on: September 10, 2004, 01:32:54 pm »
Read what 2600 said.... he's dead on.  

It's far too complicated to describe, but lets just say a good 10-15 pages of code are dedicated to getting it right in the viewer.  :)

It is indeed loaded in a heirarcy.  For example....  all keys are first remapped using default remappings (std.ini, which isn't actually read, but those are the mame defaults), then any changes made in the default entry are added, then any at the driver level then any at the clone and finally the parent.  Lets say you remap p1_button 1 in the default entry and p1_button 2 at the game level.... BOTH will get remapped because the game level entry didn't explicitly remap button 1 and it's already been set when the default entry was loaded.

Btw.... ini files have vector and raster not ctrlr files.  This is confusing as the old ctrlr files had the ini extension as well.  What's holding up the new viewer is due to changes the only way to accurately determine controls is to load and parse both.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #31 on: September 10, 2004, 04:26:03 pm »
Buddabing.

I have to look to see if my ctrlr file hacks are current with the new ctrlr stuff.  But I put my hacks in the correct location in the heirarchy.

Basically mame's heirarchy is it loads the most general ctrlr file first (default.cfg).
Then display type (raster, vector, horizontal, vertical, but this is my hacks)
Then I believe it goes to control type (like mouse, lightgun, etc...)
Then driver (neogeo, cps1, etc...)
then parent,
then game

So as it goes down the line the it overwrites the more general controls as needed.

For example, if I have a default.cfg that maps keys A,S,D,Z to buttons 1, 2, 3, 4.  Then have a neogeo.cfg that maps Z,X,C,V to buttons 1,2,3,4, then a mslug.cfg that maps A,S,D,F to 1,2,3,4 when it reads in the ctrlr files for mslug it is going to first load default.cfg, so our button configuration will look like
A=1, S=2, D=3, F=, Z=4, X=, C=, V=.  Then it will readin in neogeo.cfg and overwrite creating A=1, S=2, D=3, F=, Z=1, X=2, C=3, V=4.   Then it will read in mslug.cfg and we will end up with A=1, S=2, D=3, F=4, Z=1, X=2, C=3, V=4.

BTW, you can see this heirachy if you turn verbose on in the mame.ini file, it tells you which files it loads if they exist when loading the game

I don't think this heiarchy changed for the new xml system but I haven't been able to look at the code and see if my hacks still work..

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:Today at 02:45:49 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #32 on: September 10, 2004, 05:27:08 pm »
The hierarchy did change.... since analog axis can now be dynamically changed, they removed the paddle.ini and ect... so that layer is dead.

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #33 on: September 10, 2004, 06:59:13 pm »
It is indeed loaded in a heirarcy.  For example....  all keys are first remapped using default remappings (std.ini, which isn't actually read, but those are the mame defaults), then any changes made in the default entry are added, then any at the driver level then any at the clone and finally the parent.  Lets say you remap p1_button 1 in the default entry and p1_button 2 at the game level.... BOTH will get remapped because the game level entry didn't explicitly remap button 1 and it's already been set when the default entry was loaded.

As of MAME version 0.84, your statement is true and the ctrlr files are loaded in a hierarchy. I checked the source and the order is just like what 2600 said.

As of MAME version 0.85, your statement is false. Here's how I proved it and you can confirm this if you like.

Consider the HotRod SE. It has a joystick and seven buttons for each player. There are three buttons on the top row and four buttons on the bottom row. The keys for the bottom row of player one are C, left-control, left-alt, and space. In the ctrlr file for the SE, the player one button one in the "default" system is left-control. In the "neogeo" system, player one button one is C. Start up MAME v0.86 with ctrlr hotrodse in your mame.ini file and try a neogeo game to confirm that player one button one is indeed C. You don't need an actual HotRod, just press C on the keyboard. Now edit the hotrodse.cfg and cut and paste all the lines of the "default" system to come -after- the "neogeo" system. Then start the same game again. You'll find that the player one button one is now left-control!

The source code snippet that I posted earlier tells the whole story. The systems are loaded in the order in which they occur in the ctrlr file, not in any hierarchy.

Long story short, make sure your ini-to-xml converter converts the various ctrlr .ini files in the correct order. And, for anyone who writes their own ctrlr files, make sure that your systems are in the correct order, default first, then system-specific, then the parents, then the game, or else your controls will behave differently than you may expect.
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!

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #34 on: September 10, 2004, 11:07:53 pm »
It's time for a new release of this application. The old release was so cumbersome to install, I don't think anyone even downloaded it.

There are just two zips you have to download.

Here is the link to cpmaker.zip. Unzip it into c:\cpmaker.

Here is the link to the Ghostscript fonts. Pick a mirror (I like University of Minnesota), download it, and unzip it into c:\cpmaker also. I would have combined the two but there is a 5 megabyte download limit on my web page.

The application includes controls.xml, sample layout files, and sample ctrlr files. The new XML format files are required for the controls and ctrlrs. It should work out of the box.

Not bad for 2200 lines of source code.  ;D

Regards,
Buddabing

[EDIT: changed links, GeoCities sucks]
« Last Edit: September 12, 2004, 11:39:55 am by Buddabing »
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:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #35 on: September 10, 2004, 11:19:02 pm »
I heard in one of the whatsnew there's a fix for that hotrod issue.

goofy

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 143
  • Last login:January 03, 2005, 01:11:10 am
  • I'm a llama!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #36 on: September 12, 2004, 12:04:07 am »
hmmm, the links don't seem to be working. The app looks cool though.

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #37 on: September 12, 2004, 11:42:27 am »
hmmm, the links don't seem to be working. The app looks cool though.

I've changed the links, for some reason GeoCities didn't allow access to the files.

I'm now working on integrating this with my MAME artwork display code, which will display these control panel images when pause is pressed.
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:July 17, 2025, 11:04:07 pm
  • The Bears Still Suck!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #38 on: September 12, 2004, 06:01:32 pm »
I downloaded mame 86 to verify the heirarchy.  The heirarchy is working.  They changed how it reacts though.  The old version did what I said.  The new version doesn't "add on" the keycoded to a button.  So if you look at my attached file when you play mslug P1_BUTTON1 is only Q, not A, Z, and Q like the old ctrlr files would have done.  So basically it overwrites nd doesn't add.

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #39 on: September 12, 2004, 07:17:14 pm »
Buddabing,
Trying out your app.  I can't seem to get the controls to generate correctly.  I thought you had said it was set up with some defaults so I type in the example like in the install.txt, but I get a controls.png that looks like robotron is starting up.  Everything is installed like in the install.txt, turned on verbose in cpmaker.ini, but nothing popped out as an error.

Can you point out what I'm doing wrong or where I should look?