					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));

                                                /* Buddabing's implementation of SirPoonga's ctrlr hack */
                                                if (curfile.data.ignore_game)
						{
							char buffer[128];
                                                        const struct InputPort *input = Machine->input_ports;
							int no_buttons=0;

                                                        while (input->type != IPT_END)
							{
                                                                switch (input->type)
								{
									case IPT_BUTTON1:
										if (no_buttons<1) no_buttons = 1;
									break;
									case IPT_BUTTON2:
										if (no_buttons<2) no_buttons = 2;
									break;
									case IPT_BUTTON3:
										if (no_buttons<3) no_buttons = 3;
									break;
									case IPT_BUTTON4:
										if (no_buttons<4) no_buttons = 4;
									break;
									case IPT_BUTTON5:
										if (no_buttons<5) no_buttons = 5;
									break;
									case IPT_BUTTON6:
										if (no_buttons<6) no_buttons = 6;
									break;
									case IPT_BUTTON7:
										if (no_buttons<7) no_buttons = 7;
									break;
									case IPT_BUTTON8:
										if (no_buttons<8) no_buttons = 8;
									break;
								}
								input++;
							}

							sprintf(buffer, "button%d", no_buttons);
                                                        if (strcmp(attributes[attr + 1], buffer)==0)
                                                           curfile.data.ignore_game=FALSE;
						}
                                                // now match horizontal/vertical
                                                if (curfile.data.ignore_game)
                                                {
                                                   if (Machine->orientation & ORIENTATION_SWAP_XY)
                                                      strcpy(buffer,"vertical");
                                                   else
                                                      strcpy(buffer,"horizontal");
                                                   if (strcmp(attributes[attr+1],buffer)==0)
                                                      curfile.data.ignore_game=FALSE;
                                                }
						if (DEBUG_CONFIG && !curfile.data.ignore_game)
							printf("Entry: %s -- processing\n", attributes[attr + 1]);
						break;
					}

