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: CPMaker v0.88 - some major changes  (Read 6079 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!
CPMaker v0.88 - some major changes
« on: October 28, 2004, 11:11:08 am »
Hello everyone.

I have made CPMaker version v0.88 available. Download it from here. There are no binaries included.

Here's what's new:
- integrated artwork display code and artwork generation code into one big patch to be compiled directly into mame.

- added CPMAKER option to makefile. If you want to use an external artwork generator, you can comment out the CPMAKER line in the makefile to not build the internal generator.

- removed MAME option nomakectrl.

- added MAME options intmakectrl and extmakectrl. Use -intmakectrl if you want to use the internal controls artwork generator, or -extmakectrl if you want to use an external artwork generator. Option -intmakectrl is on by default and -extmakectrl is off by default. If both options are on, -intmakectrl is ignored. Obviously, -intmakectrl will not work if the artwork generator is not compiled into MAME.

- added support for CPViewer layout files

- added text and background color support

If you want to build CPMaker as a separate executable, there is a makefile for that. Due to size restrictions, I may split the patch again into a version-dependent part that changes and a version-independant part that doesn't. My eventual goal is to make a cross-platform patch that works under DOS and Linux.

Please either post bug reports, feature requests, or other comments here or PM me.
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!

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:CPMaker v0.88 - some major changes
« Reply #1 on: October 28, 2004, 11:24:28 am »
From readme.txt
Quote
Further documentation is in the cpmaker\doc subdirectory.

directory structure of .zip file:

cpmaker/
cpmaker/images

....

  I can't wait to get it home to try it out!

-Steve

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:CPMaker v0.88 - some major changes
« Reply #2 on: October 28, 2004, 11:29:19 am »
From readme.txt
Quote
Further documentation is in the cpmaker\doc subdirectory.

  Oh, I need to apply the patch first and the files will be created (found out after browsing the patch.txt)! :)

-Steve

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #3 on: October 28, 2004, 12:16:18 pm »
I am so confused! I thought that CPMaker was a standalone app, but from this post it looks like it's a mame patch.
Can someone enlighten me?
I can't get Johnny5 to work, so I'd like to give this a try but I'm not even sure where to start!


Edit: I think I'm confusing CPViewer and CPMaker? I still need enlightened though.
« Last Edit: October 28, 2004, 12:18:41 pm by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #4 on: October 28, 2004, 01:54:32 pm »
I am so confused! I thought that CPMaker was a standalone app, but from this post it looks like it's a mame patch.
Can someone enlighten me?
I can't get Johnny5 to work, so I'd like to give this a try but I'm not even sure where to start!


Edit: I think I'm confusing CPViewer and CPMaker? I still need enlightened though.

CPMaker can be a standalone program. I integrated it with my artwork display code so it could be compiled into MAME. There's a separate makefile to create CPMaker as a standalone program.

CPMaker is just a command line program, no GUI, so you'll want to use Johnny or CPViewer to create your layouts. CPMaker just takes a game name, your layouts, images, ctrlr files and makes a png or jpg image with everything on it.

Johnny5 and CPViewer are layout programs which also can produce images but have a GUI. So you don't really need CPMaker at all, and you don't have to compile it to use the artwork display code, just comment out the CPMAKER line of the makefile and put -extmakectrl 1 in your mame.ini.

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

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #5 on: October 28, 2004, 02:34:58 pm »
Thanks for the clarification. I had figured it out on my own and posted in another thread.

I need to read up on CPViewer to figure out how its layout works to understand the cpmaker/images directory.

As screaming pointed out, there is no cpmaker/doc directory. Are the docs available somewhere else?

Also when I enter path -p1 <patch_cpmaker_088.txt nothing happens (I renamed the patch file obviously) and if I try to make again the target is already up to date. and the makefile is unchanged.

Is the patch utility part of the mingw install or do I have to install it separately?

EDIT: nevermind, used the patch utility from the MAME download  page.
« Last Edit: October 28, 2004, 02:55:56 pm by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #6 on: October 28, 2004, 02:45:47 pm »
Buddabing couple of comments:

1. Won't compile because of erros in avi.c, 1 warning I think with semaphore also.  Compiled on a fresh source of Mame88 and no obj directory.
Let me know what you need to help debug this.

2. Why did you get rid of -nomakectrl?  Just wondering.

3. Does the splitting of the patch mean one patch without internal "cpmaker" and one with.

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:CPMaker v0.88 - some major changes
« Reply #7 on: October 28, 2004, 03:07:06 pm »
Buddabing couple of comments:

1. Won't compile because of erros in avi.c, 1 warning I think with semaphore also.  Compiled on a fresh source of Mame88 and no obj directory.
Let me know what you need to help debug this.

2. Why did you get rid of -nomakectrl?  Just wondering.

3. Does the splitting of the patch mean one patch without internal "cpmaker" and one with.

What version of the compiler are you running? Are you running "mingw for mame" as described on mame.net? You can ignore the semaphore warning. I'll try to reproduce your problem.

I got rid of -nomakectrl because I replaced it with -intmakectrl and -extmakectrl.

I haven't decided about splitting the patch. I thought it would be easier with just one patch and a separate makefile to compile the standalone executable.
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!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #8 on: October 28, 2004, 03:23:54 pm »
other comments: the patch installs both source/compilation related material and runtime material.
I would be nice if the two were separate, or at least documented because I don't run mame from the directory I build it on (in fact I don't build it on the same machine).

- I assume the error.log is just leftover garbage.
- you probably want to leave mingw.bat out (or I might install mingw in a "daniel" directory  ;) )
- is the mame.ini also garbage or does it illustrate something that needs to be ported in the real thing?
- makectrl.bat should be earmarked as something need at runtime but not need for the build. Since it's also in the docsw dir maybe it should be removed altogether frm the root dir?
- same for cpmaker.ini
- Wow! the doc is in the patch, I now have cpmaker/doc!


These are not complaints! just suggestions I love what you did!

Again I missing cpmaker/doc so maybe some of this is documented.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #9 on: October 28, 2004, 04:04:40 pm »
1. Won't compile because of erros in avi.c.

same problem here.
I just installed my build environement using the downloads from the Main Downloads page on mame.net (mingw/mingw_over/dx7...).
Fresh source.

Can't find jpeglib.h:

Code: [Select]
Compiling src/cpmaker/coders/avi.c...
src/cpmaker/coders/avi.c:71:21: jpeglib.h: No such file or directory
src/cpmaker/coders/avi.c:72:20: jerror.h: No such file or directory
src/cpmaker/coders/avi.c:97: parse error before "boolean"
src/cpmaker/coders/avi.c:97: warning: no semicolon at end of struct or union
src/cpmaker/coders/avi.c:99: warning: data definition has no type or storage cla
ss
src/cpmaker/coders/avi.c:104: field `manager' has incomplete type
src/cpmaker/coders/avi.c:115: parse error before "JOCTET"
src/cpmaker/coders/avi.c:115: warning: no semicolon at end of struct or union
src/cpmaker/coders/avi.c:119: warning: data definition has no type or storage cl
ass
« Last Edit: October 28, 2004, 04:07:02 pm by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #10 on: October 28, 2004, 04:42:51 pm »
1. Won't compile because of erros in avi.c.

same problem here.
I just installed my build environement using the downloads from the Main Downloads page on mame.net (mingw/mingw_over/dx7...).
Fresh source.

Can't find jpeglib.h:

Code: [Select]
Compiling src/cpmaker/coders/avi.c...
src/cpmaker/coders/avi.c:71:21: jpeglib.h: No such file or directory
src/cpmaker/coders/avi.c:72:20: jerror.h: No such file or directory
src/cpmaker/coders/avi.c:97: parse error before "boolean"
src/cpmaker/coders/avi.c:97: warning: no semicolon at end of struct or union
src/cpmaker/coders/avi.c:99: warning: data definition has no type or storage cla
ss
src/cpmaker/coders/avi.c:104: field `manager' has incomplete type
src/cpmaker/coders/avi.c:115: parse error before "JOCTET"
src/cpmaker/coders/avi.c:115: warning: no semicolon at end of struct or union
src/cpmaker/coders/avi.c:119: warning: data definition has no type or storage cl
ass

Darn it!

In the file src\cpmaker.mak you will find a line that looks like this:
$(CPOBJ)/coders/%.o:

Two lines below that you will see a line that looks like:
@gcc -I$(CPSRC) -I$(CPSRC)/magick -I$(CPSRC)/wand -I$(CPSRC)/ttf/include

Insert this right after the ttf/include:
-I$(CPSRC)/jpeg -I$(CPSRC)/png

Make sure you still have a tab before the @gcc or else make will not go. Command Line Edit will strip the tabs out.

EDIT: added the -I png
« Last Edit: October 28, 2004, 05:06:58 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:CPMaker v0.88 - some major changes
« Reply #11 on: October 28, 2004, 05:31:33 pm »
Still get png.c error, even after your last update.  Possibly because missing libpng.h.  Here is the error

Compiling src/cpmaker/coders/png.c...
src/cpmaker/coders/png.c:77:20: libpng.h: No such file or directory
src/cpmaker/coders/png.c: In function `ReadPNGImage':
src/cpmaker/coders/png.c:5561: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
src/cpmaker/coders/png.c:5561: (Each undeclared identifier is reported only once

src/cpmaker/coders/png.c:5561: for each function it appears in.)
src/cpmaker/coders/png.c: In function `WritePNGImage':
src/cpmaker/coders/png.c:8588: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
MAKE: *** [obj/mamepp/cpmaker/coders/png.o] Error 1

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:CPMaker v0.88 - some major changes
« Reply #12 on: October 28, 2004, 06:25:31 pm »
Still get png.c error, even after your last update.  Possibly because missing libpng.h.  Here is the error

Compiling src/cpmaker/coders/png.c...
src/cpmaker/coders/png.c:77:20: libpng.h: No such file or directory
src/cpmaker/coders/png.c: In function `ReadPNGImage':
src/cpmaker/coders/png.c:5561: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
src/cpmaker/coders/png.c:5561: (Each undeclared identifier is reported only once

src/cpmaker/coders/png.c:5561: for each function it appears in.)
src/cpmaker/coders/png.c: In function `WritePNGImage':
src/cpmaker/coders/png.c:8588: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
MAKE: *** [obj/mamepp/cpmaker/coders/png.o] Error 1

I found that after I posted, and edited my correction.
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:CPMaker v0.88 - some major changes
« Reply #13 on: October 28, 2004, 06:56:28 pm »
Okay. I updated the patch with a new makefile.

Papa - The cpmaker.ini needs to stay there so that it will run "out of the box". You can move the artwork files anywhere you want, so long as the path is reflected in the cpmaker.ini. I deleted the mame.ini, makectrl.bat, error.log, and mingw.bat as you suggested.

The patch can be downloaded from here
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!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #14 on: October 28, 2004, 08:44:19 pm »
so the patch posted in the thread above doesn't have a corrected makefile?
Because I redownloaded the patch and started over with a fresh source and I'm getting:

Code: [Select]
Compiling src/cpmaker/coders/png.c...
src/cpmaker/coders/png.c:77:20: libpng.h: No such file or directory
src/cpmaker/coders/png.c: In function `ReadPNGImage':
src/cpmaker/coders/png.c:5561: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
src/cpmaker/coders/png.c:5561: (Each undeclared identifier is reported only once

src/cpmaker/coders/png.c:5561: for each function it appears in.)
src/cpmaker/coders/png.c: In function `WritePNGImage':
src/cpmaker/coders/png.c:8588: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
make: *** [obj/mame/cpmaker/coders/png.o] Error 1


Edit: this is what the coders rule looks like in my current makefile, which seems to have the right include path in it per your previous post:
Code: [Select]
$(CPOBJ)/coders/%.o: $(CPSRC)/coders/%.c $(CPSRC)/magick/magick_config.h $(CPSRC)/magick/studio.h
   @echo Compiling $<...
   @gcc -I$(CPSRC) -I$(CPSRC)/magick -I$(CPSRC)/wand -I$(CPSRC)/ttf/include -I$(CPSRC)/jpeg -I$(CPSRC)/png -D_LIB -c $< -o $@

Edit again: can't find libpng.h anywhere in the source tree, so that's the problem!
« Last Edit: October 28, 2004, 08:53:09 pm by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #15 on: October 28, 2004, 09:02:23 pm »
so the patch posted in the thread above doesn't have a corrected makefile?
Because I redownloaded the patch and started over with a fresh source and I'm getting:

Code: [Select]
Compiling src/cpmaker/coders/png.c...
src/cpmaker/coders/png.c:77:20: libpng.h: No such file or directory
src/cpmaker/coders/png.c: In function `ReadPNGImage':
src/cpmaker/coders/png.c:5561: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
src/cpmaker/coders/png.c:5561: (Each undeclared identifier is reported only once

src/cpmaker/coders/png.c:5561: for each function it appears in.)
src/cpmaker/coders/png.c: In function `WritePNGImage':
src/cpmaker/coders/png.c:8588: `PNG_LIBPNG_VER_STRING' undeclared (first use in
this function)
make: *** [obj/mame/cpmaker/coders/png.o] Error 1


Edit: this is what the coders rule looks like in my current makefile, which seems to have the right include path in it per your previous post:
Code: [Select]
$(CPOBJ)/coders/%.o: $(CPSRC)/coders/%.c $(CPSRC)/magick/magick_config.h $(CPSRC)/magick/studio.h
   @echo Compiling $<...
   @gcc -I$(CPSRC) -I$(CPSRC)/magick -I$(CPSRC)/wand -I$(CPSRC)/ttf/include -I$(CPSRC)/jpeg -I$(CPSRC)/png -D_LIB -c $< -o $@

Edit again: can't find libpng.h anywhere in the source tree, so that's the problem!

I'll make a new patch. For the time being, copy src\cpmaker\png\png.h to src\cpmaker\png\libpng.h (don't rename)
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:CPMaker v0.88 - some major changes
« Reply #16 on: October 28, 2004, 09:48:47 pm »
Okay,missing libpng.h is fixed, and the patch is updated.
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!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #17 on: October 29, 2004, 12:27:27 am »
Cool! builds fine now. Thanks!
Now off to making a layout and trying this puppy out...

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #18 on: October 29, 2004, 03:13:01 am »
install.txt for image generation within mame appears to be totally wrong: it tells me to put makectrl.bat in the MAME root because that gets called by MAME, the the file called by the batch file doesn't even exist?

I copied cpmaker from the build directory to the MAME root and I do get a picture of some CP when I pause the game (albeit badly distorded, probably a graphic scaling issue, I was playing puckman with bezel turned on).

I have a layout that I made in Johnny5 for my own panel but now I have no clue how I tell cpmaker where to find that layout and how to use it.

It seems to involve cpmaker.ini, the ini files defined in the panel subdirectory and possibly the cfg files in the ctrlr subdirectory but I have no clue what the globbledygook in those files means.  The comments don't help much becasue I think I'm missing something about the basic concept of how it all ties in together.

Is the streching of the image a result of my doing something wrong or is it due to the resolution of the game vs the resolution the image in produced at? Some of the labels are almost unreadable
« Last Edit: October 29, 2004, 03:19:53 am by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #19 on: October 29, 2004, 03:43:34 am »
install.txt for image generation within mame appears to be totally wrong: it tells me to put makectrl.bat in the MAME root because that gets called by MAME, the the file called by the batch file doesn't even exist?

I copied cpmaker from the build directory to the MAME root and I do get a picture of some CP when I pause the game (albeit badly distorded, probably a graphic scaling issue, I was playing puckman with bezel turned on).

I have a layout that I made in Johnny5 for my own panel but now I have no clue how I tell cpmaker where to find that layout and how to use it.

It seems to involve cpmaker.ini, the ini files defined in the panel subdirectory and possibly the cfg files in the ctrlr subdirectory but I have no clue what the globbledygook in those files means.  The comments don't help much becasue I think I'm missing something about the basic concept of how it all ties in together.

Is the streching of the image a result of my doing something wrong or is it due to the resolution of the game vs the resolution the image in produced at? Some of the labels are almost unreadable

I take it that you built the standalone version, since the makectrl.bat is not called by the internal version.

Some of the documentation is dated, thank you for bringing that to my attention.

You will need a -artres 2 in your mame.ini. If you don't have it, the labels will be hard to read. You'll also need a -extmakectrl 1 if you are CPMaker standalone.

The cpmaker.ini tells you the paths for the various components. If you don't want your images to be in the directory they are in, just change the cpmaker.ini to point to where you want.

The .ini files are just comma-delimited files, there's no gobbledygook about them. All parameters in the .ini files are defined in cpmaker\doc\iniparam.txt.

To use your own layout, you will need a panel description file, which tells CPMaker what controls you have on your panel and where they are located on your image. There's a line in there for your template image which is the background image onto which the labels are displayed. There's a line in there for your layout file (.lof for Johnny and .lay for CPViewer). By default, the path to the panels is cpmaker\panels and the path to the layout files is cpmaker\layout.

The files in the cpmaker\ctrlr directory are controller descriptor files. MAME comes with some samples. I didn't create the file format for these, nor do I have any documentation on them. You might try searching past threads for that.

The artwork display code is not perfect and for some games the image may be stretched a bit. But it shouldn't be distorted too badly.
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!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #20 on: October 29, 2004, 10:47:02 am »
No I'm not using the standalone version, which is why I pointed the makectrl bit in the instructions.

Thanks for the explamations, I had missed the requirement for the addtional step of manually writing the panel file. IT's a bit tedious to do but I got it to the point where I can get the viewer to display my own panel when you pause the game.

The problem is that:
- no button is dimmed
- there are no labels

I believe this is related to the ctrlr file because if I try point it to one of your files, then all the buttons are "lit" even for a game like 1941 where only 2 buttons are used.
I was getting labels using the "out of the box" setting (but for the hotrod panel) but I'm not getting them for my own panel, so I broke something in the setup, or maybe it's again a ctrlr issue.

I need to read up on ctrlr files, I use the default MAME setting so I never bothered learning about them since games work fine.
I assume I can change the ctrlrpath to point to MAME's ctrlr directory rather than the one in cpmaker? ("ctrlrpath,CTRLR," in cpamker.ini)
I tried to change the control to standard.cfg ("controller,standard.cfg," in the panel file) but it didn't make a difference.

Does CPMAker has a "debug" mode were it would log what it's doing so I could see what file it's missing or not happy about?

FYI here's what my panel  file lloks like (comments removed, and I haven't gotten to fix the start button entries either):
Code: [Select]
control,button,360,50,revkey_1.jpg,revkey_1.jpg,KEYCODE_1,
control,button,440,50,revkey_2.jpg,revkey_2.jpg,KEYCODE_2,
controller,standard.cfg,
layout,chriskade.lof,
template,chriskade.jpg,
control,joy8way,553,251,joystick.jpg,joystick_dim.jpg,KEYCODE_UP,KEYCODE_DOWN,KEYCODE_LEFT,KEYCODE_RIGHT,
control,trackball,349,326,trackball.jpg,trackball_dim.jpg,MOUSECODE_1_UP,MOUSECODE_1_DOWN,MOUSECODE_1_LEFT,MOUSECODE_1_RIGHT,
control,p1button,96,299,blue.jpg,blue_dim.jpg,KEYCODE_LCONTROL,
control,p1button,154,300,red.jpg,red_dim.jpg,KEYCODE_LALT,
control,p1button,214,297,green.jpg,green_dim.jpg,KEYCODE_SPACE,
control,p1button,260,339,bottomyellow.jpg,bottomyellow_dim.jpg,KEYCODE_LSHIFT,
control,p1button,94,240,topyellow.jpg,topyellow_dim.jpg,KEYCODE_LSHIFT,
control,p1button,155,243,purple.jpg,purple_dim.jpg,KEYCODE_Z,
control,p1button,214,245,black.jpg,black_dim.jpg,KEYCODE_X,


and cpmaker.ini:
Code: [Select]
verbose,0,
imagepath,cpmaker\images,
magickpath,cpmaker\magick,
xmlcachepath,cpmaker\xmlcache,
productpath,.,
ctrlrpath,CTRLR,
layoutpath,cpmaker\layout,
panelpath,cpmaker\panels,
fontpath,c:\windows\fonts,
controlsxmlpath,.,
product,controls.png,
panelfile,chriskade.ini,

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:CPMaker v0.88 - some major changes
« Reply #21 on: October 29, 2004, 11:33:22 am »
No I'm not using the standalone version, which is why I pointed the makectrl bit in the instructions.

Thanks for the explamations, I had missed the requirement for the addtional step of manually writing the panel file. IT's a bit tedious to do but I got it to the point where I can get the viewer to display my own panel when you pause the game.

The problem is that:
- no button is dimmed
- there are no labels

I believe this is related to the ctrlr file because if I try point it to one of your files, then all the buttons are "lit" even for a game like 1941 where only 2 buttons are used.
I was getting labels using the "out of the box" setting (but for the hotrod panel) but I'm not getting them for my own panel, so I broke something in the setup, or maybe it's again a ctrlr issue.

I need to read up on ctrlr files, I use the default MAME setting so I never bothered learning about them since games work fine.
I assume I can change the ctrlrpath to point to MAME's ctrlr directory rather than the one in cpmaker? ("ctrlrpath,CTRLR," in cpamker.ini)
I tried to change the control to standard.cfg ("controller,standard.cfg," in the panel file) but it didn't make a difference.

Does CPMAker has a "debug" mode were it would log what it's doing so I could see what file it's missing or not happy about?

FYI here's what my panel  file lloks like (comments removed, and I haven't gotten to fix the start button entries either):
Code: [Select]
control,button,360,50,revkey_1.jpg,revkey_1.jpg,KEYCODE_1,
control,button,440,50,revkey_2.jpg,revkey_2.jpg,KEYCODE_2,
controller,standard.cfg,
layout,chriskade.lof,
template,chriskade.jpg,
control,joy8way,553,251,joystick.jpg,joystick_dim.jpg,KEYCODE_UP,KEYCODE_DOWN,KEYCODE_LEFT,KEYCODE_RIGHT,
control,trackball,349,326,trackball.jpg,trackball_dim.jpg,MOUSECODE_1_UP,MOUSECODE_1_DOWN,MOUSECODE_1_LEFT,MOUSECODE_1_RIGHT,
control,p1button,96,299,blue.jpg,blue_dim.jpg,KEYCODE_LCONTROL,
control,p1button,154,300,red.jpg,red_dim.jpg,KEYCODE_LALT,
control,p1button,214,297,green.jpg,green_dim.jpg,KEYCODE_SPACE,
control,p1button,260,339,bottomyellow.jpg,bottomyellow_dim.jpg,KEYCODE_LSHIFT,
control,p1button,94,240,topyellow.jpg,topyellow_dim.jpg,KEYCODE_LSHIFT,
control,p1button,155,243,purple.jpg,purple_dim.jpg,KEYCODE_Z,
control,p1button,214,245,black.jpg,black_dim.jpg,KEYCODE_X,


and cpmaker.ini:
Code: [Select]
verbose,0,
imagepath,cpmaker\images,
magickpath,cpmaker\magick,
xmlcachepath,cpmaker\xmlcache,
productpath,.,
ctrlrpath,CTRLR,
layoutpath,cpmaker\layout,
panelpath,cpmaker\panels,
fontpath,c:\windows\fonts,
controlsxmlpath,.,
product,controls.png,
panelfile,chriskade.ini,

I presume you created the various images in your images subdirectory, such as green.jpg, etc?

Yes, you can use MAME's ctrlr files. In fact, that would be preferred, that way you don't have to maintain multiple copies. Do keep in mind that only XML ctrlr files are supported.

You can also set your layout path to whever you stored your Johnny5 or CPViewer layouts. That would be preferred as well. It wont work, though, if you use both layout programs, like I do.

CPMaker uses the MAME log file to log stuff, so use MAME with the -log option and see what it spits out. You can also turn verbose on in the cpmaker.ini for more detailed output. You'll still need to use .log.

The binary distribution of MAME has some sample ctrlr files in it. To use a specific controller file, use the -ctrlr option in MAME. "standard" is not one of the samples given in MAME.

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

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #22 on: October 29, 2004, 11:52:10 am »
Cool thanks. I'll have to try the -log option, it might help.
Yes I have all the artwork in the right place, as evidence by the fact that the CP shows properly (well, with either all buttons lit or not, but it shows that the art is fine.)
I'll get educated some more and post back if I'm stuck.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #23 on: October 29, 2004, 01:22:17 pm »
Weird, I had a standard.cfg but I'm not sure where it comes from, probably from an older version of mame or something.
Anyway, I cleaned up my CTRLR directory (it still had the old ini style CTRLR files too) and created what I think is a valid control file by hacking a copy of the hotrodse.cfg file.

The debug logging is awesome, I wish I had known about it earlier!

It allowed me to figure out  that CPMaker didn't like my layout file: I had a "TFontName" entry in the [General] section whereas your example have a "FontName" entry. Same with TFontSize/FontSize. remove the leading "T" caused just about everything to start working.
I use Johnny5 beta 0.7, maybe you use a different one and Howard changed the format bewteen the two?

So now I have labels. It looks like cpmaker doesn't respect the label assignment specified in the layout file though. (I designed the label around the joystick to be "hugging" the joystick, so for example left arrow is right aligned) they appear to all be centered.

I am missing the "joystick down" label. Still investigating that one, but I'm making progress  ;D
Edit: found the problem, I had two labels mapped to keydown by accident (left and down), looks like it dismissed the seconds one.

A couple other comments:

The "game name" and "misc details"  labels from the johnny5 viewer are not rendered (I'm guessing that CPMaker is not designed to handle them)

The text in different buttons appears to be in different font sizes. (see attached pic, for sf2, see how the Down label is too large?). Is this related to the size of the different "label boxes"?
I could manually go through the lof file and ensure that they are at least the same height.
« Last Edit: October 29, 2004, 01:45:59 pm by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #24 on: October 29, 2004, 02:15:03 pm »
Weird, I had a standard.cfg but I'm not sure where it comes from, probably from an older version of mame or something.
Anyway, I cleaned up my CTRLR directory (it still had the old ini style CTRLR files too) and created what I think is a valid control file by hacking a copy of the hotrodse.cfg file.

The debug logging is awesome, I wish I had known about it earlier!

It allowed me to figure out  that CPMaker didn't like my layout file: I had a "TFontName" entry in the [General] section whereas your example have a "FontName" entry. Same with TFontSize/FontSize. remove the leading "T" caused just about everything to start working.
I use Johnny5 beta 0.7, maybe you use a different one and Howard changed the format bewteen the two?

So now I have labels. It looks like cpmaker doesn't respect the label assignment specified in the layout file though. (I designed the label around the joystick to be "hugging" the joystick, so for example left arrow is right aligned) they appear to all be centered.

I am missing the "joystick down" label. Still investigating that one, but I'm making progress  ;D
Edit: found the problem, I had two labels mapped to keydown by accident (left and down), looks like it dismissed the seconds one.

A couple other comments:

The "game name" and "misc details"  labels from the johnny5 viewer are not rendered (I'm guessing that CPMaker is not designed to handle them)

The text in different buttons appears to be in different font sizes. (see attached pic, for sf2, see how the Down label is too large?). Is this related to the size of the different "label boxes"?
I could manually go through the lof file and ensure that they are at least the same height.

I'm glad you got it working.

You are correct, the game name and misc details fields are ignored. I thought some of the misc details fields were way too long to fit, mk for example.

I suppose I could put the game name on there, I didn't do it because I thought the user would know what the game name was, since he just launched it :)

I don't know what version of Johnny I have. Nevertheless I will fix the TFontName problem.

CPMaker scales the font size down to fit the text into the label. It doesn't adjust the other font sizes to be the same. That could be done.

I don't know if you know this, but CPMaker can split a label into two lines if your label slot is tall enough. The labels around "High Punch", etc. tend to get a little crowded. This only works for labels with exactly two words in them.

I'll also check your right justify issue.

Thanks for being a guinea pig beta tester. :)
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!

wj2k3

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 122
  • Last login:August 22, 2006, 12:23:48 am
  • Not!
Re:CPMaker v0.88 - some major changes
« Reply #25 on: October 29, 2004, 02:26:54 pm »
Budda,

I seem to be doing something wrong.  I get the following error while compiling...

Compiling src/cpmaker/coders/yuv.c...
Compiling src/cpmaker/filters/analyze.c...
Compiling src/cpmaker/cpmaker/cpmaker.c...
Compiling src/cpmaker/cpmaker/controls.tab.c...
Compiling src/cpmaker/cpmaker/joystick.tab.c...
Compiling src/cpmaker/cpmaker/johnny.tab.c...
Generating cpviewer.tab.c and cpviewer.tab.h...
process_begin: CreateProcess((null), bison -d -p cpv -osrc/cpmaker/cpmaker/cpvie
wer.tab.c src/cpmaker/cpmaker/cpviewer.y, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [src/cpmaker/cpmaker/cpviewer.tab.c] Error 2

I checked and ..src/cpmaker/cpmaker/cpviewer.tab.c and ..cpviewer.y both exist.  Any suggestions on what I should try next.  

I attempted twice.  Using Mame source and your patch downloaded today.  Using MinGW installed and used successfully on prior patches.

Thanks for the great work and any adise you can offer,

wj2k3

C:\MAMESO~1>

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:CPMaker v0.88 - some major changes
« Reply #26 on: October 29, 2004, 02:27:36 pm »
Budabing,
First thanks for supporting your patch.  One slight problem.

For testing, I switched 3panels.ini to just use panel1.  Mame's ctrlr is mapped to panel1.  All that is working, but the display is not always labeling.  I had a few problems with no labels, but I was changing things so I'll settle with user error on those until I can diagnose the problem.  Started fresth again, but I am having a problem with kchamp, maybe other 4-way's but can't test those now.  I am using the latest controls.dat which has kchamp(BTW, you may want to write something if the controls are not in controls.dat).  It wouldn't label anything, so I edited panel1.txt to add 4-ways which is how I understood the documentation.  Still nothing.  I added kchamp.xml to the xml cache and it displays.  So somewhere in between there is my problem.

BTW, you should probably support all of controls.dat.  Let the user decide if it is too long.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #27 on: October 29, 2004, 02:38:15 pm »
Glad to be a guinea pig! I'm learning a lot in the process,
I manually set the height of all the labels to the same height in the lof file and the font sizes issues went away.
I will try the splitting of the label on 2 lines, I'd like that better.

FYI, I did some of this trial and error remotely using Remote Desktop to access my development machine, and while MAME seems to work fine (slow) in that environment, it seems that CPMaker will not register the "unpause" key while displaying the image, which surprises me because I would have expected it to use the same input path as MAME. I know that this is a really weird way of doing things, I just wanted to mnetion what I experienced. Over Remote desktop I would have to log off, then log back in (which would minimize MAME) an CTRL-C Mame to terminate it.

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:CPMaker v0.88 - some major changes
« Reply #28 on: October 29, 2004, 03:28:46 pm »
Budda,

I seem to be doing something wrong.  I get the following error while compiling...

Compiling src/cpmaker/coders/yuv.c...
Compiling src/cpmaker/filters/analyze.c...
Compiling src/cpmaker/cpmaker/cpmaker.c...
Compiling src/cpmaker/cpmaker/controls.tab.c...
Compiling src/cpmaker/cpmaker/joystick.tab.c...
Compiling src/cpmaker/cpmaker/johnny.tab.c...
Generating cpviewer.tab.c and cpviewer.tab.h...
process_begin: CreateProcess((null), bison -d -p cpv -osrc/cpmaker/cpmaker/cpvie
wer.tab.c src/cpmaker/cpmaker/cpviewer.y, ...) failed.
make (e=2): The system cannot find the file specified.
make: *** [src/cpmaker/cpmaker/cpviewer.tab.c] Error 2

I checked and ..src/cpmaker/cpmaker/cpviewer.tab.c and ..cpviewer.y both exist.  Any suggestions on what I should try next.  

I attempted twice.  Using Mame source and your patch downloaded today.  Using MinGW installed and used successfully on prior patches.

Thanks for the great work and any adise you can offer,

wj2k3

C:\MAMESO~1>

You don't have bison. You may not have flex either. I will make that optional in the makefile.

In the meantime you can edit src\cpmaker.mak and whereever you see "flex" or "bison" comment out that line by putting a # as the first character of the line.

Then try compiling again.
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:CPMaker v0.88 - some major changes
« Reply #29 on: October 29, 2004, 03:37:07 pm »
Budabing,
First thanks for supporting your patch.  One slight problem.

For testing, I switched 3panels.ini to just use panel1.  Mame's ctrlr is mapped to panel1.  All that is working, but the display is not always labeling.  I had a few problems with no labels, but I was changing things so I'll settle with user error on those until I can diagnose the problem.  Started fresth again, but I am having a problem with kchamp, maybe other 4-way's but can't test those now.  I am using the latest controls.dat which has kchamp(BTW, you may want to write something if the controls are not in controls.dat).  It wouldn't label anything, so I edited panel1.txt to add 4-ways which is how I understood the documentation.  Still nothing.  I added kchamp.xml to the xml cache and it displays.  So somewhere in between there is my problem.

BTW, you should probably support all of controls.dat.  Let the user decide if it is too long.

The version of controls.xml I included in the patch doesn't have kchamp. So I guess my version is old. I will correct that. It does use the whole file.

If a game is not in controls.xml then no labels will be displayed. I suppose I could write a message saying "Not in controls.dat, please contribute!" on the image.

If you are using just one panel you can look at panel7 for an example. If you want to use panel1, comment out the startpanel and endpanel lines.
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:CPMaker v0.88 - some major changes
« Reply #30 on: October 29, 2004, 04:07:47 pm »
Sorry, wasn't clear.  I am using the updated controls.dat.  Kchamp is in the file, made sure.  I have commented out the other panels.  That part is working for the few games that I have tested, except kchamp.

It may be related to being 4-way.  So I updated the panel1.txt for 4ways under joystick controls.  Same thing happens.  All 4-way games that I use will not generate the controls.   If I add the games manually in the xmlcache directory it does generate.  Any other ideas?  Did I edit panel1.txt wrong?

Update: Just ran it with the errorlog.   I think, It's having trouble parsing the newer controls.dat.  Maybe something to do with the encoding UTF-8.


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:CPMaker v0.88 - some major changes
« Reply #31 on: October 29, 2004, 04:36:28 pm »
Sorry, wasn't clear.  I am using the updated controls.dat.  Kchamp is in the file, made sure.  I have commented out the other panels.  That part is working for the few games that I have tested, except kchamp.

It may be related to being 4-way.  So I updated the panel1.txt for 4ways under joystick controls.  Same thing happens.  All 4-way games that I use will not generate the controls.   If I add the games manually in the xmlcache directory it does generate.  Any other ideas?  Did I edit panel1.txt wrong?

Update: Just ran it with the errorlog.   I think, It's having trouble parsing the newer controls.dat.  Maybe something to do with the encoding UTF-8.



I'll fix the XML parser to handle the 'encoding' bit. In the meantime,
delete this text:

encoding="UTF-8"

from the first line of controls.xml, so that it reads:

<?xml version="1.0"?>

like the previous version of controls.xml did.

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:CPMaker v0.88 - some major changes
« Reply #32 on: October 29, 2004, 04:48:54 pm »
That did it!

There may be something else, but I've got some debugging to do.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #33 on: October 29, 2004, 04:53:14 pm »
I built the standalone app too, it's easier to test things with it than going into MAME and pausing (Especially with the Remote Desktop issue I explained earlier).

If I do cpmaker alien3 it shows the buttons but doesn't label my trackball (which replaces the lightgun since I don;t have one  :( ).
I can see in the log that cpmaker tried to find a label for P1_LIGHTGUN_X_EXT which is not in my layout. Thre reason it's not in my layout is because I would have expected MAME to map P1_LIGHTGUN_X_EXT to MOUSECODE_RIGHT since in mame.ini I tell mame to use my mouse for the light gun.

Is this a limitation of cpmaker, of mame, or is this operator error? Do I need to define a set of lightgun entries in the layout file, or do i need to explicitely map the light gun to the mouse somehwere else (ctlrlr file?)

I'm not that interested in alien3 itself, I'm just trying to walk through the process for "fringe cases" like light guns.

I would like tempest to show that I can use the trackball since I don't have a spinner for example.

By the way, my controls.xml (v0.87.1) also had the UTF encofing thing so I removed it.  the www.fe.donkeyfly.com site seems to be down so I couldn't check if mine is the latest or not.
« Last Edit: October 29, 2004, 05:02:40 pm by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #34 on: October 29, 2004, 05:25:16 pm »
I built the standalone app too, it's easier to test things with it than going into MAME and pausing (Especially with the Remote Desktop issue I explained earlier).

If I do cpmaker alien3 it shows the buttons but doesn't label my trackball (which replaces the lightgun since I don;t have one  :( ).
I can see in the log that cpmaker tried to find a label for P1_LIGHTGUN_X_EXT which is not in my layout. Thre reason it's not in my layout is because I would have expected MAME to map P1_LIGHTGUN_X_EXT to MOUSECODE_RIGHT since in mame.ini I tell mame to use my mouse for the light gun.

Is this a limitation of cpmaker, of mame, or is this operator error? Do I need to define a set of lightgun entries in the layout file, or do i need to explicitely map the light gun to the mouse somehwere else (ctlrlr file?)

I'm not that interested in alien3 itself, I'm just trying to walk through the process for "fringe cases" like light guns.

I would like tempest to show that I can use the trackball since I don't have a spinner for example.

By the way, my controls.xml (v0.87.1) also had the UTF encofing thing so I removed it.  the www.fe.donkeyfly.com site seems to be down so I couldn't check if mine is the latest or not.

Labelling (and dimming when appropriate) of spinners, trackballs, and flight sticks currently doesn't work. I don't have any support for light guns, either. The problem stems from the mapping of key codes to control codes. It's on "the list".
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!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #35 on: October 29, 2004, 05:42:28 pm »
OK, cool, I'll wait. What you've done so far is a great start!

deadmoney5

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 428
  • Last login:February 03, 2020, 11:02:02 pm
  • I don't feel tardy
Re:CPMaker v0.88 - some major changes
« Reply #36 on: October 29, 2004, 10:21:26 pm »
Hey guys..

great work on the viewer!!

Here's my dilemma..Reading all your posts, my problem should be a piece of cake..

How can I change the font size and the color of the labels?  I change the color within CPviewer.exe, but it didn't work..

ALso ...can I have the buttons that aren't being used dimmed in CPviewer?

thanks!!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #37 on: October 29, 2004, 10:33:42 pm »
Dimming of the buttons is only supported by CPMaker: johnny 5 and CPViewer put text on top of a static background picture which shows the buttons.
CPMaker combines a blank picture of your CP with pictures of the individual buttons and other controls, then adds the text labels.

The panel.ini file in the cpmaker\panels directory has a list of the dim/not dim pictures for every control on the panel. unfortunatel there is no editor to do this so it's a pain to do, but it was worth it for me because I really like the idea of the dimming.

CPMaker doesn't appear to use the font size and color information specified in the layout file. It scales the font to fill the space available, see the picture I posted above, I made the "down" label a little too large and CPMAker made the text larger, whreas johnny5 didn't care.
I didn't try to use a CPViewer layout with CPMaker but I think that it works the same.

Font handling is a weakness of CPMaker at the moment, I don't know if it's on buddabing's list but I might try and take a look at the code and see if I can help there.

Edit: I guess it's not easy to decide what the best "rules" are to fit the text. I really don't like having multiple size fonts on the panel.
- you could calculate the font size needed to fit the largest of the labels into its bounding box, thereby determining the largest font size, and use that font size for *all* labels. The downside is that you could end up with all labels beign really small.
- you could use the font size specified in the layout file (what kind of unit do the lof use? font size of 0.375?? is that in inches?) and either clip anything that doesn't fit in the bounding box (don't know how easy that is to do with imagemagick), or only scale the font down for those labels that won't fit, but never go to a larger just because you can.
- you could improve the logic that splits the labels into multiple lines

I wonder what the current longest labels are in the controls.dat database?

Edit: tada!a little perl script later and here's what I got out of the control.xml v0.87.1:

Code: [Select]
openice: P1_BUTTON2 = Shoot / Block     (size=13)
bowler: P1_BUTTON1 = Straight/Hook      (size=13)
alien3: P1_BUTTON2 = Secondary Weapon   (size=16)
arcadecl: P1_BUTTON1 = Fire / Left Missile      (size=19)
arcadecl: P1_BUTTON2 = Fire / Center Missile    (size=21)
atarifb: P1_BUTTON1 = Play Select:  Press to Pass / Kick        (size=34)
champbas: P1_BUTTON2 = B: Bat, Extra Bases - Pitch, Throw Ball  (size=39)

or more interesting, the chart below illustrates the current size distribution, which  shows that you cover almost all cases if you allow for 14 characters per label.

The longest "word" (not separated by spaces) is: Piece/Fire/Start  (16 characters long)

and this illustrates the largest number of words in single label:
Code: [Select]
arcadecl: Fire / Right Missile              
atarifb: Play Select:  Press to Pass / Kick
champbas: B: Bat, Extra Bases - Pitch, Throw Ball
« Last Edit: October 30, 2004, 01:25:08 am by papaschtroumpf »

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:CPMaker v0.88 - some major changes
« Reply #38 on: October 30, 2004, 10:13:02 am »
Dimming of the buttons is only supported by CPMaker: johnny 5 and CPViewer put text on top of a static background picture which shows the buttons.
CPMaker combines a blank picture of your CP with pictures of the individual buttons and other controls, then adds the text labels.

The panel.ini file in the cpmaker\panels directory has a list of the dim/not dim pictures for every control on the panel. unfortunatel there is no editor to do this so it's a pain to do, but it was worth it for me because I really like the idea of the dimming.

CPMaker doesn't appear to use the font size and color information specified in the layout file. It scales the font to fill the space available, see the picture I posted above, I made the "down" label a little too large and CPMAker made the text larger, whreas johnny5 didn't care.
I didn't try to use a CPViewer layout with CPMaker but I think that it works the same.

Font handling is a weakness of CPMaker at the moment, I don't know if it's on buddabing's list but I might try and take a look at the code and see if I can help there.

Edit: I guess it's not easy to decide what the best "rules" are to fit the text. I really don't like having multiple size fonts on the panel.
- you could calculate the font size needed to fit the largest of the labels into its bounding box, thereby determining the largest font size, and use that font size for *all* labels. The downside is that you could end up with all labels beign really small.
- you could use the font size specified in the layout file (what kind of unit do the lof use? font size of 0.375?? is that in inches?) and either clip anything that doesn't fit in the bounding box (don't know how easy that is to do with imagemagick), or only scale the font down for those labels that won't fit, but never go to a larger just because you can.
- you could improve the logic that splits the labels into multiple lines

I wonder what the current longest labels are in the controls.dat database?

Edit: tada!a little perl script later and here's what I got out of the control.xml v0.87.1:

Code: [Select]
openice: P1_BUTTON2 = Shoot / Block     (size=13)
bowler: P1_BUTTON1 = Straight/Hook      (size=13)
alien3: P1_BUTTON2 = Secondary Weapon   (size=16)
arcadecl: P1_BUTTON1 = Fire / Left Missile      (size=19)
arcadecl: P1_BUTTON2 = Fire / Center Missile    (size=21)
atarifb: P1_BUTTON1 = Play Select:  Press to Pass / Kick        (size=34)
champbas: P1_BUTTON2 = B: Bat, Extra Bases - Pitch, Throw Ball  (size=39)

or more interesting, the chart below illustrates the current size distribution, which  shows that you cover almost all cases if you allow for 14 characters per label.

The longest "word" (not separated by spaces) is: Piece/Fire/Start  (16 characters long)

and this illustrates the largest number of words in single label:
Code: [Select]
arcadecl: Fire / Right Missile              
atarifb: Play Select:  Press to Pass / Kick
champbas: B: Bat, Extra Bases - Pitch, Throw Ball

Currently CPMaker draws each label as large as it can regardless of what the font size is in the layout, and as small as it has to in order to fit the text into the layout slot.

Johnny uses a relative font size: so a font size of 3.75939E-02 means multiply that by the vertical size of your image. Johnny also specifies one global font size for all labels. CPViewer allows each label to have its own font, style, background color, and font size.

I'm open to suggestions as to what to do regarding font size restrictions:

a) leave it the way it is now
b) find the largest font size all labels will fit, and use that.
c) strictly use the font size given in the layout and truncate any
    labels that spill over the layout slot.
d) strictly use the font size given in the layout and let any labels
    spill over the layout slot.
e) use the font size given in the layout for all slots except shrink
    any labels that spill over so that they fit
f) instead of only splitting two-word labels, try to pick a word
   boundary in a multi-word label that is as close as possible to the
   middle of the label text.
g) find the largest font size that all but n labels will fit and use
   that, then shrink the other n labels until they fit.
h) any other suggestions would be considered.

Regarding deadmoney5's question: you need to either point CPViewer at the correct .lay file or point CPMaker to use your CPViewer path for layouts. The CPMaker paths are in cpmaker.ini in your MAME root directory.

I am not planning a panel editor. Yes it is a pain to create panels but it's not worth it IMO. Plus it would be difficult to make one that is machine-independent.
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!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:CPMaker v0.88 - some major changes
« Reply #39 on: October 30, 2004, 11:23:07 am »
I'll play with it and let you know what I think (although others may have their own opinion).
I like e) as a starting point, it's at most a few lines of change  in the code and gives the user a little bit of controls.
I also like the idea of specifying a minimum font size to ensure that labels are still readable, so the text would be allowed to spill if it can't fit at that size.
splitting a 2 word label was a great idea, so extending it to split "in the middle" of the screen sound good too.

I might try and hack your code to do that and see how I like it and will let you know.