I did more testing yesterday and it did work for me too, it must have been operator error, or it was the problem listed in
this thread since I discovered it around the same time.
I do have additional information, and I think I'm 95% of the way where I want to be:
It seems the easiest way to do this is to add your PC games at the end of the real controls.ini. I think I'll keep a PCcontrols.ini file that I can append at the end of the official controls.ini whenever I download a new version. Just like you did, I kept all the fields that appear in a regular mame entry, maybe it's not necessary but it won't hurt. You can even set the alternating and numplayers fields to describe the game if you want to.
You then just set P1NumButtons and enter the proper P1_BUTTON? labels, just like in your example. Make sure that P1NumButtons is set to the right value, or johnny5 will ignore "extra" button labels.
I had another problem to solve: in my PC games, I use additional buttons that are either not used in MAME or are considered "admin" buttons by johnny5 and therefore ignored by its parsing.
For example I may have mapped a PC game control to the "1" key, which is the player 1 start key for mame, labelled "START1" in the CTRLR files. I tried adding "START1=test" to the entry in controls.ini, but johnny5 ignores it, even if I create a label for "KEYCODE_1" in the layout designer. johnny5 seems to only match KEYCODE_? labels in the layout file to P1_BUTTON? entries in the control.ini.
I managed to solve the problem with the following "hack":
I defined my additional buttons as P1_BUTTON10 through P1_BUTTON14 in my CTRLR file. I don't have Internet access at home right now (typing this from work) so I can't cut and paste what it looks like, but just look at the definition of "P1_BUTTON1" and cut and paste it and modify the button name to P1_BUTTON10 and change the keycode to the right value.
Note that's it's OK to have multiple definitions for a single keystroke. For example mame's START1 is mapped to the "1" key, but you can also map "P1_BUTTON10" to the same "1" key.
I then added the corresponding keycode labels in my layout file, for example I added a label for KEYCODE_1 under the picture of the player 1 start button (which is now also defined as player 1 button 10).
An entry for a game would then look something like:
[testgame]
gamename=This is a test
numPlayers=1
alternating=0
mirrored=0
tilt=0
cocktail=0
usesService=0
miscDetails=This is only a test
P1NumButtons=
14P1Controls=8-way Joystick+joy8way
P1_BUTTON1=Fire
P1_BUTTON2=Bomb
P1_BUTTON3=Evade
P1_BUTTON4=Flare
P1_BUTTON5=Countermeasures
P1_BUTTON6=Afterburner
P1_BUTTON7=BailP1_BUTTON10=Map
P1_BUTTON11=Switch View
P1_BUTTON14=Menu
The entries in blue show the "regular" mame buttons and the entries in red show the "additional" buttons that are either unused or admin buttons in mame. For example P1_BUTTON10 is tied to key "1" as explained above and P1_BUTTON14 is tied to "P" on my cab.
There is one issue that I haven't solved yet, and that's why I don't consider this a full solution yet: the game "rom" name should not contain any spaces:
I use mamewah and have it setup to show the link name in the rom list, so I have a game called "Tower of the Ancients.lnk" so mamewah passes "Tower of the Ancients" to johnny5 as the ROM name, but then johnny5 only looks for a ROM named "tower".
One way to deal with it is to makes an entry in the controls.ini with a rom name of [tower] and a game name of "Tower of the Ancients". This will work as long as you don't have another game that also starts with the name tower. If you have both "Tower of the Ancients" and "Tower of Doom" then this trick won't work.
Another way to deal with it would be to replace the spaces in the name with underlines. This would however cause mamewah to show the game in the game list as "Tower_of_the_Ancients" which is not too bad but not really what we want.
I know mamewah has a {8.3} tag for the command line, but I haven't explored what it does. If it takes a full name and turns it into a unique 8.3 name, we might be able to use that.
EDIT:Tiger-Heli, feel free to copy/edit for your web page, since it's becoming the johnny5 reference page.
EDIT again: I'm working on something similar with CPViewer. It works a little differently so I'll poost something when I'm have something worked out.