| Main > Software Forum |
| johnny 5 (or CPViewer) for non-mame |
| << < (4/8) > >> |
| Tiger-Heli:
Popcorrin's idea works fine. I modified controls.ini (in Johnny5's data files folder) and added the following: [testgame] gamename=This is a test numPlayers=2 alternating=0 mirrored=1 tilt=0 cocktail=1 usesService=0 miscDetails=This is only a test P1NumButtons=3 P1Controls=8-way Joystick+joy8way P1_BUTTON1=Test 1 P1_BUTTON2=Testing 2 P1_BUTTON3=a Test Then ran "Johnny5 testgame" and it displayed fine. Here is what I added to my draft update to the Johnny5 page: Update - I did a test last night (04Oct05) and added a bogus entry to the controls.ini file for Johnny5, and Johnny5 displayed the game info with no problems. The viewer will assume you are using YOUR default MAME key assignments, but otherwise there are no problems. This means that if we create the proper controls.ini entries, Johnny5 and the AHK Script can be used with most emulators!!! |
| papaschtroumpf:
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=14 P1Controls=8-way Joystick+joy8way P1_BUTTON1=Fire P1_BUTTON2=Bomb P1_BUTTON3=Evade P1_BUTTON4=Flare P1_BUTTON5=Countermeasures P1_BUTTON6=Afterburner P1_BUTTON7=Bail P1_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. |
| Tiger-Heli:
--- Quote from: papaschtroumpf on October 05, 2005, 11:22:05 am ---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. --- End quote --- I still think a better way to do it is to setup a new directory with Johnny5 for PC games and use the custom controls.ini file in this directory. NOTE - In my example, I didn't mess with MAME's controller entries at all, but I doubt I could have had a P1_Button14 either. . . --- Quote ---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. --- End quote --- Not sure how to work around this. EmuLoader has an unsupported custom feature that allows you to assign a romname and gamename at will. Perhaps if you enclose the info in quotes, Johnny5 will take it, but I doubt it. I also thought about putting the link into a batch file tower.bat, tower1.bat, but that won't do what you want either. You could also do: Tower of the ancients.lnk Tower1 of Doom.lnk Tower2 of Power.lnk Tower3 Trouble.lnk but that's not perfect either. . . --- Quote ---EDIT:Tiger-Heli, feel free to copy/edit for your web page, since it's becoming the johnny5 reference page. --- End quote --- Already planned to, I'll credit you of course. It's looking like the page will need an "Advanced Concepts PC Games page, and I don't even have the basic methods posted yet . . . >:( |
| papaschtroumpf:
--- Quote from: Tiger-Heli on October 05, 2005, 12:27:37 pm ---Perhaps if you enclose the info in quotes, Johnny5 will take it, but I doubt it --- Quote --- First thing I tried when I found the problem, didn't work. --- End quote --- --- End quote --- |
| papaschtroumpf:
--- Quote from: Tiger-Heli on October 05, 2005, 12:27:37 pm ---NOTE - In my example, I didn't mess with MAME's controller entries at all, but I doubt I could have had a P1_Button14 either. . . --- Quote --- You don't have to mess with the CTRLR entries as long as you only use mame's P#_BUTTON? in your PC games, unfortunately for all other buttons, it's the only way I could get it to work. --- End quote --- --- End quote --- |
| Navigation |
| Message Index |
| Next page |
| Previous page |