Main > Software Forum

SirPoongas ctrl file hacks in new mame

<< < (2/3) > >>

DaemonCollector:
http://freewebhosting.hostdepartment.com/S/SirPoonga/hacks.html#2


there on there. Let me know if ya can help :)

SirPoonga:
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.

Buddabing:

--- Quote from: 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.

--- End quote ---

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.

Buddabing:
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

TheGatesofBill:
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 ).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version