| Main > Software Forum |
| johnny 5 (or CPViewer) for non-mame |
| << < (5/8) > >> |
| Tiger-Heli:
--- Quote from: papaschtroumpf on October 05, 2005, 01:25:39 pm ---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 --- Okay, so I can have a P1_BUTTON14 and Johnny is happy with it even though MAME doesn't define this? Okay, I re-read your example and that seems to be what you are saying. . . |
| papaschtroumpf:
yes it is. As far as MAME is concerned, the 1 key is mapped to the START1 "event", it will ignore the fact that 1 is also mapped to "P1_BUTTON10" As far as johnny5 is concerned it will see that P1_BUTTON10 is mapped to the 1 key and that it has a label for KEYCODE_1 so it will display the P1_BUTTON10 entry in the KEYCODE_1 label. |
| papaschtroumpf:
The same basic idea works with CPViewer: either add entries at the end of controls.ini or create a new directory with a PCgames specific controls.ini and fill in game entries as with johnny. Note however that the P1NumButtons is not really used in CPViewer [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 Things are handled differently in CPViewer/cpvw: the program doesn't try to be so intelligent of mapping entries in your CTRLR file to your layout file the way johnny5 does. Instead it directly matches entry names in controls.ini to a label name in your layout. Basically if you have a label for "P1_BUTTON1", it looks for a corresponding "P1_BUTTON1" label in controls.ini By default, it will also attach the same value to the "P2_BUTTON1" in your layout if you have added that label. The "trick" to use here is that you can override P2_BUTTON? entries so that they don't match the corresponding P1_ entries. For example, if you mapped additional PC game controls to your P2 entries (I'm assuming the PC game is single player in this example), then you can just add them in by specifying their P2_BUTTON? equivalent: P2_BUTTON1=Cockpit Cam P2_BUTTON2=Tail Cam P2_BUTTON3=Wing Cam P2_BUTTON4=Wide view P2_BUTTON5=Zoom in P2_BUTTON6=Zoom out Now you may have mapped some controls to "admin" buttons on your control panel. For example, let's say that in addition to your 2 buttons per players, you also have a player 1 start (mapped to "1"), player 2 start (mapped to "2"), pause (mapped to "P"), mame menu (mapped to TAB). Your PC game may have somehing mapped to the 1, 2, and TAB key, so you want to label them in CPViewer. if you have set up your CP for MAME, then you have told CPViewer to create labels for P1_BUTTON1..P1_BUTTON6 and P2_BUTTON1..P2_BUTTON6. Since CPViewer lets you define up to 8 buttons per player, you have 4 spares (2 on player 1 and 2 on player 2) Since CPViewer doesn't really care what your buttons are, you can put a P1_BUTTON7 label under your player start1, a P1_BUTTON8 under your player 2 start, P2_BUTTON7 under the amme menu/tab button, etc... Assuming that key "1" and "2" in your PC game are mapped to "easy" and "difficult" and TAB is used for "quicksave", you can add the following to the game's entry in controls.ini: P1_BUTTON7=Easy P1_BUTTON8=Difficult P2_BUTTON7=QuickSave Your final controls.ini then looks like this: [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=3 P1Controls=8-way Joystick+joy8way P1_BUTTON1=Fire P1_BUTTON2=Bomb P1_BUTTON3=Evade P1_BUTTON4=Flare P1_BUTTON5=Countermeasures P1_BUTTON6=Afterburner P2_BUTTON1=Cockpit Cam P2_BUTTON2=Tail Cam P2_BUTTON3=Wing Cam P2_BUTTON4=Wide view P2_BUTTON5=Zoom in P2_BUTTON6=Zoom out P1_BUTTON7=Easy P1_BUTTON8=Difficult P2_BUTTON7=QuickSave Your are limited to a total of 16 mappable buttons however, which may or may not be a limiting factor depending on how complex your CP is. In my case, I have a single player cabinet with P1_ buttons, so I have 10 spares that I can use. The other thing to be aware of, is that if you use that same layout for MAME, you may have buttons mislabelled, for example the P1_BUTTON7 text would show under your player 1 start with the example above, even though pressing that button would not act as the player's 7th button. This can be solved by using a different layout for MAME and PC Games. Maybe future versions of CPViewer coud add "custom" buttons to the list in addition to the 1..8 P1 and P2 buttons. |
| jcrouse:
--- Quote from: papaschtroumpf on October 05, 2005, 03:05:23 pm ---This can be solved by using a different layout for MAME and PC Games. Maybe future versions of CPViewer coud add "custom" buttons to the list in addition to the 1..8 P1 and P2 buttons. --- End quote --- I have made contact with the CPVW author and we are planning on some changes. For starters adding P3 and P4 buttons. We will also probably make about 12 labels per user AND a generic set of labels, probably eight or ten, you can use as you want. I will make a special layout designer specificall for the application to rid out the massive overhead of CPViewer. The designer will still require the .Net framework. However, you could create the layout by hand. I did that over the weekend. Also, for some reason CPVW, as it is now, needs the alternating field and it must be set to either one or two. I'm not sure why but that seems to be the way it is. I'll post more news as it materializes. John |
| Howard_Casto:
I just wanted to clarify some things. I made j5 as generic as possible because I had always planned on expanding it for other uses. J5 is a data translator, with a very few exceptions, there are no constants in j5 that prevent you from "making" other physical inputs. The list of possible inputs are stored and read from a simple text file and it looks for those inputs in the ini cfg/ect files. It doesn't look to see if they are valid, nor does it care. A search string is a search string. I did this because mame also supports "non mame" inputs. Mame outputs these extra controls on a joystick/keyboard as whatever the windows driver labels them. Since I have no way of knowing every possible input every odd-ball joystick puts out, this had to be done. To officially add these labels to the layout viewer simply open up the "keycode constants.txt" in the data files folder and add them at the bottom. (I would suggest adding a nice header like "PC Inputs Only: ") This is also how you add static labels btw, just remember to put a "*" first in the case fo static labels. |
| Navigation |
| Message Index |
| Next page |
| Previous page |