The NEW Build Your Own Arcade Controls
Main => Software Forum => Topic started by: Buddabing on October 28, 2004, 11:11:08 am
-
Hello everyone.
I have made CPMaker version v0.88 available. Download it from here. (http://home.houston.rr.com/buddabing/PATCH088.ZIP) 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.
-
From readme.txt
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
-
From readme.txt
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
-
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.
-
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
-
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.
-
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 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.
-
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.
-
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:
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
-
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:
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
-
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
-
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.
-
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 (http://home.houston.rr.com/buddabing/PATCH088.ZIP)
-
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:
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: $(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!
-
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:
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: $(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)
-
Okay,missing libpng.h is fixed, and the patch is updated.
-
Cool! builds fine now. Thanks!
Now off to making a layout and trying this puppy out...
-
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
-
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.
-
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):
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:
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,
-
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):
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:
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
-
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.
-
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.
-
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. :)
-
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>
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
That did it!
There may be something else, but I've got some debugging to do.
-
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.
-
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".
-
OK, cool, I'll wait. What you've done so far is a great start!
-
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!!
-
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:
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:
arcadecl: Fire / Right Missile
atarifb: Play Select: Press to Pass / Kick
champbas: B: Bat, Extra Bases - Pitch, Throw Ball
-
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:
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:
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'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.
-
I may have found another feature: if I run a game with -noart the control panel isn't shown
Maybe that's how it's supposed to work but I'm not sure why.
Took me 3 hours to figure out why the panel stopped showing up, because I was testing with 1941 and I have an ini file that sets it to noart. :o
-
I may have found another feature: if I run a game with -noart the control panel isn't shown
Maybe that's how it's supposed to work but I'm not sure why.
Took me 3 hours to figure out why the panel stopped showing up, because I was testing with 1941 and I have an ini file that sets it to noart. :o
Here are the various artwork-related options. You can get a complete list by running mame -showusage.
-artwork_directory <string> directory for Artwork (Overlays etc.)
-[no]artwork / -[no]art use additional game artwork (sets default for
-[no]use_backdrops / use backdrop artwork
-[no]use_overlays / use overlay artwork
-[no]use_bezels / -[no]bezel use bezel artwork
-[no]artwork_crop / crop artwork to game screen only
-[no]artcrop
-artwork_resolution / -artres artwork resolution (0 for auto)
-[no]intmakectrl / Use internal controls artwork generator
-[no]extmakectrl / Use external controls artwork generator
-[no]noshowctrl / Do not show controls artwork
-
I'm still not sure how it related to CPMaker and doesn't answer my question:
if I run mame 1941 -nobezel, then I don't see the control panel when I pause the game, why does removing the bezel impact CPMaker?
-
I'm still not sure how it related to CPMaker and doesn't answer my question:
if I run mame 1941 -nobezel, then I don't see the control panel when I pause the game, why does removing the bezel impact CPMaker?
The control panel image is artwork, and, more specifically, bezel artwork. So if you disable artwork or bezels you will disable the CP image display. It was done that way in order to interface smoothly into the MAME code.
-
I didn't realize that, although by now I had come to suspect it.
Is it possible to bypass the -nobezel flag? is it even advisable?
My cab is on the small side and only has a 17" monitor, so games like 1941 look tiny in the middle of a sea of black (since I don't have a 1941 bezel artwork) so I like playing it better with -nobezel.
Oh well, it's not like I need a cheat sheet for the controls on that one so I can always specify -nobezel in a dedicated ini file for this game and a few others like it.
Works great otherwise, we jsut need to fill in the controls.dat database.
-
Buddabing,
I think I found a bug. Not really a big deal, but should work.
If you run mame with the -ftr command, i.e. mame pacman -ftr 100
you get the following error after mame runs:
libpng error: Call to NULL write function
-
Buddabing,
I think I found a bug. Not really a big deal, but should work.
If you run mame with the -ftr command, i.e. mame pacman -ftr 100
you get the following error after mame runs:
libpng error: Call to NULL write function
The bug is in the screen shot generator. -ftr makes a screen shot at the end of its run.
I'll fix it asap.
-
Not sure if this is a bug or a new feature.
In the old patch, if you had a controls.png file in /artwork/romname/ the controls would display. In the latest patch, this doesn't work. If I recall, the controls.png in /artwork/romname/ took priority over the local controls.png
Did you take this feature out?
-
Not sure if this is a bug or a new feature.
In the old patch, if you had a controls.png file in /artwork/romname/ the controls would display. In the latest patch, this doesn't work. If I recall, the controls.png in /artwork/romname/ took priority over the local controls.png
Did you take this feature out?
No, it should still search the artwork directory. However, if you want it to do that you must have -nointmakectrl and -noextmakectrl set.
-
Ahhh, works just like you said. Thanks.
-
Buddabing, been doing some thinking and poking and wanted your opinion since you've dug your hands in deeper than mine.
Using an art layer like the bezel is a performance hit. Possibly a pretty substantial one. Looking at the code I think it's possible and wouldn't be an impact on performance if the image is displayed like the UI menu or warnings are displayed. I don't mean menu text based, but the way in which the UI layer in the artwork is displayed as compared to the way the bezel layer is displayed.
Any thoughts or am I a bit off track?
-
Buddabing, been doing some thinking and poking and wanted your opinion since you've dug your hands in deeper than mine.
Using an art layer like the bezel is a performance hit. Possibly a pretty substantial one. Looking at the code I think it's possible and wouldn't be an impact on performance if the image is displayed like the UI menu or warnings are displayed. I don't mean menu text based, but the way in which the UI layer in the artwork is displayed as compared to the way the bezel layer is displayed.
Any thoughts or am I a bit off track?
I suppose it's possible to display the image like the UI menu. But why bother? Since the game is paused, I don't think the user will care if it takes 0.05 seconds to display the artwork (20 fps) or else 0.01 seconds (100 fps), or even 0.25 seconds (4 fps).
And I don't see a performance hit when the controls artwork is not being displayed.
The only reason I can see for the UI menu-like display would be to display for-sure accurate aspect ratios with the controls artwork. So I'll look at it and experiment a bit to see if it can be done.
-
Sorry let me clarify a bit. Bear with me a little and correct me where I am wrong.
A. I'm not talking about how long it takes to display. This doesn't bother me either.
B. I'm not talking about using the menuing system.
When you use the artwork "system" there is a performance hit. The way I understand the artwork system is when a layer is implemented mame draws the screen and then has to layer and blend the artwork in. Depending on your pc, You don't notice it because most of the games mame can easily run and you run at the games fps easily. Other PC's may be barely running some games. Adding the artwork layer makes a significant hit and since the viewer uses the bezel layer the performance hit is during the whole game not just during pause.
Try running with -nothrottle -noafs and let the game run for 10-20 seconds then esc. You'll see the fps. Now try it with -nothrottle -noafs -noart. The fps is going to be double or more. Now, I don't care that I can get 400 fps in Pacman, but the some people who are running a game like mk aren't going to be able to just by using the viewer. This is because the viewer always has the bezel layer on.
Now the reason I brought up the UI and maybe that was the wrong comparison is because that isn't a performance hit. I believe that all those messages are converted to a bmp and it just displays them when it needs to, i.e the gameinfo screen. If not, it looks like their are calls that just display a bmp to the screen and that's what I was saying.
As a side benefit, it may be easier for you to write to the whole screen instead of be bound to the box the games is, i.e. pacman. Which btw I have a pseudo patch for instead of my other hack so that the controls can be displayed on the whole screen for vertical games.
Does that make more sense or am I still off on my descriptions and thoughts?
-
Sorry let me clarify a bit. Bear with me a little and correct me where I am wrong.
A. I'm not talking about how long it takes to display. This doesn't bother me either.
B. I'm not talking about using the menuing system.
When you use the artwork "system" there is a performance hit. The way I understand the artwork system is when a layer is implemented mame draws the screen and then has to layer and blend the artwork in. Depending on your pc, You don't notice it because most of the games mame can easily run and you run at the games fps easily. Other PC's may be barely running some games. Adding the artwork layer makes a significant hit and since the viewer uses the bezel layer the performance hit is during the whole game not just during pause.
Try running with -nothrottle -noafs and let the game run for 10-20 seconds then esc. You'll see the fps. Now try it with -nothrottle -noafs -noart. The fps is going to be double or more. Now, I don't care that I can get 400 fps in Pacman, but the some people who are running a game like mk aren't going to be able to just by using the viewer. This is because the viewer always has the bezel layer on.
Now the reason I brought up the UI and maybe that was the wrong comparison is because that isn't a performance hit. I believe that all those messages are converted to a bmp and it just displays them when it needs to, i.e the gameinfo screen. If not, it looks like their are calls that just display a bmp to the screen and that's what I was saying.
As a side benefit, it may be easier for you to write to the whole screen instead of be bound to the box the games is, i.e. pacman. Which btw I have a pseudo patch for instead of my other hack so that the controls can be displayed on the whole screen for vertical games.
Does that make more sense or am I still off on my descriptions and thoughts?
I see what you're saying now. I have been investigating writing directly to the screen with DirectDraw instead of going through the artwork system. However, this is not machine portable, which makes it not a preferred solution. I'll investigate the UI-hack method when I have some time.
-
Hello,
I have uploaded a new patch. Download it from here. (http://home.houston.rr.com/buddabing/PATCH088.ZIP)
Here's what's new:
- Bugfix: screen shot crashed mame
- added textconstraint field to the .ini file
usage: textconstraint,value,
value=0: text is drawn as large as possible to fit the slot alloted, and as small necessary to fit. (default)
value=1: text is drawn at the specified font size or smaller to fit the slot alloted.
value=2: text is drawn at the specified font size no matter what
value=3: text is drawn at the one largest font size so that all text fits the slots allotted.
- fixed text alignment issues.
- unused controls are dimmed now, not just unused buttons.
- added xmlcache file for tron, the controls.xml uses a joy8way which makes CPMaker draw the incorrect control, I changed it to be an analog stick.
-
You do good work!
Thanks for the update.
Edit: di you fix the TfontSize thing in parsing johnny5 files?
-
Sorry let me clarify a bit. Bear with me a little and correct me where I am wrong.
A. I'm not talking about how long it takes to display. This doesn't bother me either.
B. I'm not talking about using the menuing system.
When you use the artwork "system" there is a performance hit. The way I understand the artwork system is when a layer is implemented mame draws the screen and then has to layer and blend the artwork in. Depending on your pc, You don't notice it because most of the games mame can easily run and you run at the games fps easily. Other PC's may be barely running some games. Adding the artwork layer makes a significant hit and since the viewer uses the bezel layer the performance hit is during the whole game not just during pause.
Try running with -nothrottle -noafs and let the game run for 10-20 seconds then esc. You'll see the fps. Now try it with -nothrottle -noafs -noart. The fps is going to be double or more. Now, I don't care that I can get 400 fps in Pacman, but the some people who are running a game like mk aren't going to be able to just by using the viewer. This is because the viewer always has the bezel layer on.
Now the reason I brought up the UI and maybe that was the wrong comparison is because that isn't a performance hit. I believe that all those messages are converted to a bmp and it just displays them when it needs to, i.e the gameinfo screen. If not, it looks like their are calls that just display a bmp to the screen and that's what I was saying.
As a side benefit, it may be easier for you to write to the whole screen instead of be bound to the box the games is, i.e. pacman. Which btw I have a pseudo patch for instead of my other hack so that the controls can be displayed on the whole screen for vertical games.
Does that make more sense or am I still off on my descriptions and thoughts?
The UI text is displayed using the same code as the game sprites. In theory it should be possible to read in the controls.png file as one big sprite. This might be advantageous, after all we never see the game options and the other UI text stretched in one direction or the other. Memory used would be roughly the same as storing the controls.png as artwork.
The downside is that I'm unfamiliar with the sprite architecture. The sprites are pretty complicated, the code has to handle many different sizes and depths of sprites. I'm not saying it can't be done, it'll just require quite a bit of study. Unless, of course, you can figure it out. :)
You mentioned you had some kind of code to display the artwork on the whole screen. I would like to see it.
-
You do good work!
Thanks for the update.
Edit: di you fix the TfontSize thing in parsing johnny5 files?
Whoops, forgot that one. :'(
I fixed it for the next update.
-
The UI text is displayed using the same code as the game sprites. In theory it should be possible to read in the controls.png file as one big sprite. This might be advantageous, after all we never see the game options and the other UI text stretched in one direction or the other. Memory used would be roughly the same as storing the controls.png as artwork.
The downside is that I'm unfamiliar with the sprite architecture. The sprites are pretty complicated, the code has to handle many different sizes and depths of sprites. I'm not saying it can't be done, it'll just require quite a bit of study. Unless, of course, you can figure it out. :)
You mentioned you had some kind of code to display the artwork on the whole screen. I would like to see it.
I'll look into the sprite thing, but it'll probably take some time as I just haven't used C in a long time. Don't wait up for me if you get the time, and I'll let you know how it goes.
Displaying the artwork on the whole screen isn't hard and hopefully isn't too ugly. Did you read or ever try the bezel hack I did:
http://www.arcadecontrols.org/yabbse/index.php?board=3;action=display;threadid=26727
Basically, it just doing that in the code. In artwork.c you pretend to parse a controls.art. So for vertical games you put the value's for left,top,right,bottom in there. Then for vertical games I immediately returned from "adjust_controls_aspect_ratio". I'd send you a patch, but was just doing testing and didn't put in the check for horizontal or vertical, just ran vertical games to prove the theory. For horizontal games, you should do what you are currently doing.
I'll send you a patch if you want, though.
Edit: In English this is how I understand it. You've defined the bezel layer as big as the game screen and as I mentioned before the bezel artwork layer is then enabed and always on. If you read the top of artwork.c, they tell you how to enlarge that for bezels. So adding this code or using the universal vertical bezel is enlarging that bezel area past the screen size.
-
I just tried the updated patch on a clean source and got the following error. Hopefully, it's not me being dumb.
Compiling src/cpmaker/magick/display.c...
Compiling src/cpmaker/magick/montage.c...
src/cpmaker/magick/montage.c:2442: redefinition of `CloneMontageInfo'
src/cpmaker/magick/montage.c:101: `CloneMontageInfo' previously defined here
src/cpmaker/magick/montage.c:2504: redefinition of `DestroyMontageInfo'
src/cpmaker/magick/montage.c:163: `DestroyMontageInfo' previously defined here
src/cpmaker/magick/montage.c:2555: redefinition of `GetMontageInfo'
src/cpmaker/magick/montage.c:214: `GetMontageInfo' previously defined here
src/cpmaker/magick/montage.c:2614: redefinition of `MontageUsage'
src/cpmaker/magick/montage.c:273: `MontageUsage' previously defined here
src/cpmaker/magick/montage.c:2723: redefinition of `MontageImageCommand'
src/cpmaker/magick/montage.c:382: `MontageImageCommand' previously defined here
src/cpmaker/magick/montage.c:4089: redefinition of `GetMontageGeometry'
src/cpmaker/magick/montage.c:1748: `GetMontageGeometry' previously defined here
src/cpmaker/magick/montage.c:4106: redefinition of `SceneCompare'
src/cpmaker/magick/montage.c:1765: `SceneCompare' previously defined here
src/cpmaker/magick/montage.c:4122: redefinition of `MontageImages'
src/cpmaker/magick/montage.c:1781: `MontageImages' previously defined here
MAKE: *** [obj/mamepp/cpmaker/magick/montage.o] Error 1
-
It built cleanly for me, so unless the patch the post above links to has changed since it was posted, it must be operator error.
-
I just tried the updated patch on a clean source and got the following error. Hopefully, it's not me being dumb.
Compiling src/cpmaker/magick/display.c...
Compiling src/cpmaker/magick/montage.c...
src/cpmaker/magick/montage.c:2442: redefinition of `CloneMontageInfo'
src/cpmaker/magick/montage.c:101: `CloneMontageInfo' previously defined here
src/cpmaker/magick/montage.c:2504: redefinition of `DestroyMontageInfo'
src/cpmaker/magick/montage.c:163: `DestroyMontageInfo' previously defined here
src/cpmaker/magick/montage.c:2555: redefinition of `GetMontageInfo'
src/cpmaker/magick/montage.c:214: `GetMontageInfo' previously defined here
src/cpmaker/magick/montage.c:2614: redefinition of `MontageUsage'
src/cpmaker/magick/montage.c:273: `MontageUsage' previously defined here
src/cpmaker/magick/montage.c:2723: redefinition of `MontageImageCommand'
src/cpmaker/magick/montage.c:382: `MontageImageCommand' previously defined here
src/cpmaker/magick/montage.c:4089: redefinition of `GetMontageGeometry'
src/cpmaker/magick/montage.c:1748: `GetMontageGeometry' previously defined here
src/cpmaker/magick/montage.c:4106: redefinition of `SceneCompare'
src/cpmaker/magick/montage.c:1765: `SceneCompare' previously defined here
src/cpmaker/magick/montage.c:4122: redefinition of `MontageImages'
src/cpmaker/magick/montage.c:1781: `MontageImages' previously defined here
MAKE: *** [obj/mamepp/cpmaker/magick/montage.o] Error 1
I think your patch went bad. Montage.c is only 2341 lines long. My guess is that your montage.c got doubled. See if the code repeats after line 2340 or so.
Do any other files spit out errors?