Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: DaemonCollector on September 27, 2004, 07:25:33 pm
-
How can you implement the ctrl file hacks for #buttons etc in the new XML mame? The functions listed on your site no longer exist in input.c
-
It's on my todo list, I'd be glad if someone beats me to it though.
-
I'll go keep diggin through the code, was just seein if someone else knew yet. Have you picked apart the new cntrl file system at all?
-
I really haven't had a chance yet, school and such has been keeping me pretty busy.
-
How can you implement the ctrl file hacks for #buttons etc in the new XML mame? The functions listed on your site no longer exist in input.c
What are those, and what do they accomplish? I might be able to help you out.
Regards,
Buddabing
-
http://freewebhosting.hostdepartment.com/S/SirPoonga/hacks.html#2
there on there. Let me know if ya can help :)
-
Yeah, I bet alot of my hacks are broke now since many of them dealt with the ctrlr files.
Budda, I made two ctrlr hacks.
One you could define a button#.ini , replace # with a number. button6.ini would activate on a 6 button game.
I also wrote vertical.ini and horizont.ini so you could define controls based on orientation. This is helpful to cocktail cab owners that have controls on more than just two sides.
-
Yeah, I bet alot of my hacks are broke now since many of them dealt with the ctrlr files.
Budda, I made two ctrlr hacks.
One you could define a button#.ini , replace # with a number. button6.ini would activate on a 6 button game.
I also wrote vertical.ini and horizont.ini so you could define controls based on orientation. This is helpful to cocktail cab owners that have controls on more than just two sides.
This hack can be done in the new controller system. What the user will have to do is convert all his or her .ini files over to XML using Howard's converter program. Then make sure the system entries are in the order you want, for example, game specific system entries need to be after the playerx, buttonx, vertical, and horizontal entries. On the source code end, the XML reading code needs to know when to use the new system types. That shouldn't be difficult.
-
Okay, here's the code to the new controller hack. I used "horizontal" instead of "horizont" but that can be easily changed.
The code in the attachment should be added to config.c.
Before the beginning of the new code, the code reads:
case FILE_TYPE_CONTROLLER:
{
const char *srcfile = strrchr(Machine->gamedrv->source_file, '/');
if (!srcfile) srcfile = strrchr(Machine->gamedrv->source_file, '\\');
if (!srcfile) srcfile = strrchr(Machine->gamedrv->source_file, ':');
if (!srcfile) srcfile = Machine->gamedrv->source_file;
else srcfile++;
curfile.data.ignore_game =
(strcmp(attributes[attr + 1], "default") != 0 &&
strcmp(attributes[attr + 1], Machine->gamedrv->name) != 0 &&
strcmp(attributes[attr + 1], srcfile) != 0 &&
(Machine->gamedrv->clone_of == NULL || strcmp(attributes[attr + 1], Machine->gamedrv->clone_of->name) != 0) &&
(Machine->gamedrv->clone_of == NULL || Machine->gamedrv->clone_of->clone_of == NULL || strcmp(attributes[attr + 1], Machine->gamedrv->clone_of->clone_of->name) != 0));
After the end of the new code, the code should read:
if (DEBUG_CONFIG && !curfile.data.ignore_game)
printf("Entry: %s -- processing\n", attributes[attr + 1]);
break;
}
The code in this attachment includes both these edge pieces, so some cut and paste is necessary.
I'm sure it will not be difficult to construct a patch.
Regards,
Buddabing
-
Code is enough for me to work with. I'll add this in now. (Currently has No Name MAME 0.87.00 on his hard disk :P ).
-
when I get a chance I will update my website.
-
Was there ever any progress made with adapting the buttonX.ini hack to the latest version of Mame?
I have a 7-button layout and therefore have to remap the buttons for any 5+ button games. (Ex: SF series). Having the buttonX.ini option would make things so much easier!
-
This thread is pretty old. I suggest posting a request in the PowerMAME section with a link to this thread.