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 10478 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!
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #40 on: September 12, 2004, 08:42:32 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?


Out of the box, I've got it set up with three panels. The first panel looks like a HotRod SE, with two players, seven buttons each. The second panel has a 4/8 way switchable, three buttons in a row, and a trackball. The third panel has a spinner, four buttons, and a flight stick.

For games that can be played on more than one panel, the program either picks what you choose for it in the .ini file, or it uses the "majority" panel from the ini file, or it picks a panel which may not be the panel you want. Out of the box, the "majority" panel is the trackball panel.

I'm working on a simpler example that uses pictures of a keyboard with the different control keys highlighted.

What game are you attempting to generate an image for?

I tried Robotron, and it doesn't use the correct panel because I didn't have the control type "doublejoy8way" as a possible control type. So that's a bug.
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 #41 on: September 12, 2004, 08:56:14 pm »
I tried pacman,  just like in install.txt.  Also, tried mslug cause Sirpoonga mentioned it.  Didn't actually try robotron just mentioned that because the image looks like those games when they first start, the video is all crazy.  Here's a pic.
« Last Edit: September 12, 2004, 08:56:43 pm 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 #42 on: September 12, 2004, 11:02:39 pm »
I tried pacman,  just like in install.txt.  Also, tried mslug cause Sirpoonga mentioned it.  Didn't actually try robotron just mentioned that because the image looks like those games when they first start, the video is all crazy.  Here's a pic.

Okay, thanks. There's probably an exception in the underlying graphics library that isn't being caught. What OS are you running, and how much memory do you have?

You should be getting something like below:
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 #43 on: September 13, 2004, 08:50:59 am »
I'm using Xp with a GB of memory.  Tried it on another PC with win2000 and got the controls to generate.

Anything you want me to try to help debug the first system?


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 #44 on: September 13, 2004, 11:09:02 am »
I'm using Xp with a GB of memory.  Tried it on another PC with win2000 and got the controls to generate.

Anything you want me to try to help debug the first system?



I reproduced your problem. I believe that the .png files produced by this application are not compatible with some .png readers. I generated a .png file, then opened the file with Internet Explorer. Junk. Then I opened it with Gimp. Good image. Then I regenerated the file as .jpg and displayed it with IE. Good image.

Since I'm not intimately familiar with the inner workings of PNG files, I can't elaborate on why this error occurs. However, the files do display correctly within my MAME artwork code.

How are you viewing the generated images? Do you still get an error when you generate a JPG image instead of PNG?

Regards,
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 #45 on: September 13, 2004, 11:14:27 am »
I'll try a few different viewers later tonight, can't remember which one's I used.  Let me know how to generate jpg's and I'll try those as well.


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 #46 on: September 13, 2004, 11:35:54 am »
I'll try a few different viewers later tonight, can't remember which one's I used.  Let me know how to generate jpg's and I'll try those as well.



To generate .jpg, just change the filename extension to .jpg.
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 #47 on: September 13, 2004, 07:22:28 pm »
Well feeling kinda dumb.  It's exactly like you said some .png readers can't read it, my default was the windows pictue and fax viewer.

Thanks for the help.

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #48 on: September 14, 2004, 12:37:04 am »
[I tried Robotron, and it doesn't use the correct panel because I didn't have the control type "doublejoy8way" as a possible control type. So that's a bug.

Download the FE dev package and use the files in it as lookup tables.

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 #49 on: September 15, 2004, 05:39:08 pm »
New version available here.

9-15-04
=======
- Added font control
- added red boxes which display the layout slots when verbose is turned on
- Fit text to size of layout slots
- added keyboard example (incomplete)
- Added 2 games to controls.xml (Star Trek and Red Baron)
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!

EndTwist

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 480
  • Last login:May 26, 2022, 05:04:49 pm
  • Arg.
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #50 on: September 15, 2004, 06:05:04 pm »
Great work, very cool!

Only thing I have to say is that, couldn't this be done in PHP more easily/efficiently? ??? Its got built in image functions (more/less) and build in XML reading/writing stuff. Plus, you could "compile" PHP in to an exe (along with some php-related DLLs) using "PriadoBlender" (http://priadoblender.com/).

Makes more sense to me...

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 #51 on: September 15, 2004, 06:20:42 pm »
Great work, very cool!

Only thing I have to say is that, couldn't this be done in PHP more easily/efficiently? ??? Its got built in image functions (more/less) and build in XML reading/writing stuff. Plus, you could "compile" PHP in to an exe (along with some php-related DLLs) using "PriadoBlender" (http://priadoblender.com/).

Makes more sense to me...

It probably could be done in PHP. It certainly would be more difficult for me personally to develop in PHP, since I don't work with it. I might try rewriting this application in PHP as an exercise.....
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!

EndTwist

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 480
  • Last login:May 26, 2022, 05:04:49 pm
  • Arg.
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #52 on: September 15, 2004, 07:07:12 pm »
Essentially, from my standpoint (pretty good php programmer), it would be easier due to the built-in image and XML functions. There is also the possibility of it running faster than the current cpmaker.

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #53 on: September 15, 2004, 07:56:49 pm »
Well, the built in functions for php are slow.  You;d have to run with the PEAR utilities.

I'd do something like this in c++ with all the libs out there.  For xml there expat, bison, etc..  for png there's libpng, for jpg there's libjpg.

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #54 on: September 16, 2004, 02:01:28 am »
- Added 2 games to controls.xml (Star Trek and Red Baron)

I see you finally registered onto fe.donkeyfly.com.  You can submit these if you have resources (IE control panel pics, manuls, other references.)  I know MrArcade had a Captains Chair so I can easily confer the star trek controls.  Red Barron was just a yoke and some buttons, right?  It was popular though so you should be able to find references for that.

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 #55 on: September 16, 2004, 12:04:56 pm »
Am I correct in saying clones aren't supported yet or is it a bug?

Ex.  "cpmaker pacman puckman" doesn't generate labels
"cpmaker puckman" or "cpmaker puckman puckman" does generate labels

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 #56 on: September 16, 2004, 01:37:28 pm »
Am I correct in saying clones aren't supported yet or is it a bug?

Ex.  "cpmaker pacman puckman" doesn't generate labels
"cpmaker puckman" or "cpmaker puckman puckman" does generate labels

Bug.
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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #57 on: September 16, 2004, 05:26:02 pm »
I finally got to download and try this out (stupid modem!).

pretty cool stuff.

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 #58 on: September 16, 2004, 05:36:10 pm »
Am I correct in saying clones aren't supported yet or is it a bug?

Ex.  "cpmaker pacman puckman" doesn't generate labels
"cpmaker puckman" or "cpmaker puckman puckman" does generate labels

Bug.

Should be fixed now. I also found a couple other small bugs and cleaned up the verbose output a bit.
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:July 13, 2025, 11:38:27 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #59 on: September 18, 2004, 02:38:13 pm »
Essentially, from my standpoint (pretty good php programmer), it would be easier due to the built-in image and XML functions. There is also the possibility of it running faster than the current cpmaker.

Just for the record, I agree and I'm not particularly good in either language.  I know xml is the hot new thing now, but imho it totally blows.  Excuse me for using the technical term there.  ;)

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 #60 on: September 22, 2004, 06:02:08 pm »
Essentially, from my standpoint (pretty good php programmer), it would be easier due to the built-in image and XML functions. There is also the possibility of it running faster than the current cpmaker.
Just for the record, I agree and I'm not particularly good in either language.  I know xml is the hot new thing now, but imho it totally blows.  Excuse me for using the technical term there.  ;)

I'm working on a PHP version of the control panel image generator. It blew my mind how easy it is! Right now the code is barely 1000 lines as opposed to the C version which is more than 2200 lines. Right now I can't tell the speed due to all the debugging code I have in it, but it does not appear to be any slower than the C version. And that's interpreted PHP, not compiled.

Howard, I don't disagree with you that XML "blows". But it's so darn easy to parse! I wish you would consider making your Johnny 5 layout files use XML. There are plenty of resources out there to use XML with VB, such as the Macrosoft MSXML SAX library. You have to use XML to read the .85 and newer ctrlr files anyway, why not use XML for the layout file as well?
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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #61 on: September 23, 2004, 12:44:49 am »
If you need php advise you may have noticed the controls.dat project is all php.  I have found a couple of decent IDEs too.


EndTwist

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 480
  • Last login:May 26, 2022, 05:04:49 pm
  • Arg.
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #62 on: September 23, 2004, 07:07:27 am »
Hehe, what'd I tell ya? And once its complete, you can "compile" it using PriadoBlender (www.priadoblender.com).
« Last Edit: September 23, 2004, 07:08:16 am by EndTwist »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19427
  • Last login:July 13, 2025, 11:38:27 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #63 on: September 23, 2004, 05:58:03 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.

That's how the old hierachy worked man...  If it didn't overwrite then you would have a ton of cross-input related errors and the hierarchy would be pointless.  It adds different inputs when they haven't be defined yet it overwrites the same inputs in a heirarchy.  Got it?

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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #64 on: September 23, 2004, 08:23:42 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.

That's how the old hierachy worked man...  If it didn't overwrite then you would have a ton of cross-input related errors and the hierarchy would be pointless.  It adds different inputs when they haven't be defined yet it overwrites the same inputs in a heirarchy.  Got it?


Right, what I said is what happened when I tested it out in .86

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 #65 on: September 25, 2004, 01:18:04 pm »
Hehe, what'd I tell ya? And once its complete, you can "compile" it using PriadoBlender (www.priadoblender.com).
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 #66 on: September 25, 2004, 01:22:41 pm »
The previous reply to this post has a sample of the output of the PHP image generator. There are two problems I want to correct.

1. There are magenta rings around the buttons. PHP doesn't do alpha blending the same way. So I defined a pure magenta color to be alpha. I created a blank pure magenta image in Gimp and overlaid the existing black button image on it. What do I need to do to not have Gimp blend the button image with the magenta background?

2. The text is not anti-aliased, but I don't have antialiasing turned off. What do I need to do to keep antialiasing?

TIA,
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 #67 on: October 04, 2004, 12:47:00 pm »
Here is Aaron Giles confirming what I said about the load order of control definitions:

Quote

(sirp)
> why is it when I put a definition for mslug before neogeo in the ctrlr cfg file
> that I end up with neogeo? Should it not matter what order you put the entries
> in?

(aaron)
Yes, the order matters. The file is scanned top-to-bottom, and anything that matches the current game will get applied in the order it is encountered. A match consists of any of the following:

the game name
the game's parent name
the game's driver file.c
default

It is done this way for simplicity.

Aaron

The PHP version of CPMaker is complete. I solved the magenta rings but changing what GIMP calls the "alpha threshold" of the piece images. However, this causes a bit of aliasing between the control image and the background image. The PHP version only requires one image per control instead of two. The program itself does the dimming instead of blending a separate pre-dimmed control like the C version does.  

The C version looks better due to antialiased text and better blending than the PHP version.
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:Demonstration: Dynamic Control Panel Background Image Generation
« Reply #68 on: October 04, 2004, 01:02:07 pm »
Buddabing, have you tried searching google groups for an answer to the antialiasing thing?  Or post a message there.

The quick search I did it seems you need a 3rd party image package.