Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: DaemonCollector on September 27, 2004, 07:25:33 pm

Title: SirPoongas ctrl file hacks in new mame
Post 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
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: TheGatesofBill on September 27, 2004, 08:58:52 pm
It's on my todo list, I'd be glad if someone beats me to it though.
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: DaemonCollector on September 27, 2004, 09:10:54 pm
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?
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: TheGatesofBill on September 27, 2004, 09:53:50 pm
I really haven't had a chance yet, school and such has been keeping me pretty busy.
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: Buddabing on September 27, 2004, 11:20:16 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

What are those, and what do they accomplish? I might be able to help you out.

Regards,
Buddabing
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: DaemonCollector on September 27, 2004, 11:23:38 pm
http://freewebhosting.hostdepartment.com/S/SirPoonga/hacks.html#2


there on there. Let me know if ya can help :)
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: SirPoonga on September 28, 2004, 01:00:44 am
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.
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: Buddabing on September 28, 2004, 09:19:11 am
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.
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: Buddabing on September 28, 2004, 12:55:54 pm
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
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: TheGatesofBill on September 28, 2004, 04:06:02 pm
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 ).
Title: Re:SirPoongas ctrl file hacks in new mame
Post by: SirPoonga on September 28, 2004, 05:16:17 pm
when I get a chance I will update my website.
Title: Re: SirPoongas ctrl file hacks in new mame
Post by: IncrdblHulk7 on June 12, 2006, 05:54:05 pm
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!

Title: Re: SirPoongas ctrl file hacks in new mame
Post by: Buddabing on June 12, 2006, 07:36:42 pm
This thread is pretty old. I suggest posting a request in the PowerMAME section with a link to this thread.