Hey, Tiger-Heli                                                  
October 13, 2005, 06:52:35 AM
Home Help Search Edit Profile Calendar Logout

BYOAC Forums
Main Forum Software Forums Monitor/Video
Audio/Jukebox/MP3 Project Announcements & HoF Artwork
Consoles Buy/Sell/Trade Arcade Miscellaneous
Everything Else Board Discussion Project Arcade - the book!
  OTHER SITE FORUMS  
Rules| Old Boards | Old Archives | BYOAC People Finder (USA) | Chatroom
+  Build Your Own Arcade Controls Forum
|-+ 
| |-+  Software Forum
| | |-+  johnny 5 (or CPViewer) for non-mame
0 Members and 0 Guests are viewing this topic. « previous next »
Pages: [1] Go Down Reply Notify of replies Send this topic Print
Author Topic: johnny 5 (or CPViewer) for non-mame  (Read 291 times)
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
johnny 5 (or CPViewer) for non-mame
« on: October 03, 2005, 11:02:03 AM »
Reply with quote

I would like to try and use Johnny for non-mame "emulators", specifically my PC Games (I've got about 30 on my cab). I tend to tweak stuff a lot so I have to manually re-generate the static images whenever I change something, and it's a major pain.

I was thinking that I could create a "fake" controls.ini file for my PC games and let Johnny magically place the labels to generate the static images, but Johnny uses mame.

I've seen this thread on the Johnny forum: http://fe.donkeyfly.com/forum/index.php?PHPSESSID=5d56ba0b504a6262aaa408bc16619c17&topic=165.0 but since I'm not sure how the driver info is used by Johnny the answer doesn't make a lot of sense to me.

could we just create a "fake" mame executable (or batch file) that would return fake driver info that would make the process work somehow?
Report to moderator   Logged
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #1 on: October 03, 2005, 11:27:02 AM »
Reply with quote Modify message Remove message

That's basically what I was looking at in the thread you linked to.

What I "think" you could do is edit the mame source to somehow add a PCgame1 clone of PCgame1, uses driver PCgame1, create a key config for PCgame1, and a controls.ini entry for it and Johnny should find it, but I don't know if there's an easier way . . .
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #2 on: October 03, 2005, 11:33:46 AM »
Reply with quote

how does johnny query mame (I'm not really familiar with the FE related options to mame) and how does mame "answer" (to standard out, in a file, ...?).
I might be easier to create a batch file or small program that pretends to be a mame executable but simply answers with what johnny needs, all you'd have to do is point johnny to that fake mame executable when creating the images.
Report to moderator   Logged
Popcorrin
Full Member
***
Offline Offline

Posts: 385



View Profile Email Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #3 on: October 04, 2005, 12:28:58 AM »
Reply with quote

I used to do this with the old version of Johnny5 and it worked fine.  All I had to do was add entries to controls.ini.
Report to moderator   Logged
Minwah
Developers
Full Member
***
Offline Offline

Posts: 5621



View Profile WWW Email Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #4 on: October 04, 2005, 04:52:40 AM »
Reply with quote

I know John (jcrouse) uses CPViewer for various systems...I am not sure how exactly tho.
Report to moderator   Logged
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #5 on: October 04, 2005, 12:02:57 PM »
Reply with quote

I know John (jcrouse) uses CPViewer for various systems...I am not sure how exactly tho.

Can anyone answer that? From the web site I gathered that he used static images for non-mame games but maybe I'm wrong.
Report to moderator   Logged
jcrouse
Full Member
***
Offline Offline

Posts: 558


jcrouse1@hotmail.com
View Profile WWW Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #6 on: October 04, 2005, 01:55:32 PM »
Reply with quote

I use CPVW for about 80 patforms (console and computer). It is very simple. If you read the CPVW docs you'll see you can specify a background image to use. I have created a static BG image for each system with the logo across the top and the button hard-labeled, using Photoshop. The buttons don't really change much for consoles. I'll attach an example.

John


* Atari 2600.jpg (258.72 KB, 640x480 - viewed 123 times.)
Report to moderator   Logged
jcrouse
Full Member
***
Offline Offline

Posts: 558


jcrouse1@hotmail.com
View Profile WWW Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #7 on: October 04, 2005, 02:06:15 PM »
Reply with quote

Oh, it also works great for a MameWAH controls viewer. This way your user only needs to remember one key. If they press it they get the following image and should tem know what all the controls do while in the FE.

John


* mamewah.jpg (231.27 KB, 640x480 - viewed 119 times.)
Report to moderator   Logged
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #8 on: October 04, 2005, 02:24:37 PM »
Reply with quote

Yes, I understand that, that's what I was referring to as "static" images. I currently use cpvw also.

The problem I'm trying to solve is that I have about 30 PC games, each with *very* different mappings, and I'm reluctant to generate 30 static images, because if I change anything on my panel, I'll have to re-generate the images by hand.
Report to moderator   Logged
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #9 on: October 04, 2005, 02:26:38 PM »
Reply with quote Modify message Remove message

Popcorrin said it should work with Johnny5, if you feel adventurous.
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
jcrouse
Full Member
***
Offline Offline

Posts: 558


jcrouse1@hotmail.com
View Profile WWW Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #10 on: October 04, 2005, 02:31:40 PM »
Reply with quote

The problem I'm trying to solve is that I have about 30 PC games, each with *very* different mappings, and I'm reluctant to generate 30 static images, because if I change anything on my panel, I'll have to re-generate the images by hand.

I haven't got to that yet but will probably create my own controls.ini file for PC games when the time comes.

John
Report to moderator   Logged
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #11 on: October 04, 2005, 02:33:45 PM »
Reply with quote

So do you think it would work? (I haven't tried with CPViewer yet).

I couldn't get it working properly with johnny5 because it calls mame to game some info about the rom (could be operator error on my part since popcorrin says he got it to work, but maybe it's something that stopped working with version 2 of johnny5)
Report to moderator   Logged
jcrouse
Full Member
***
Offline Offline

Posts: 558


jcrouse1@hotmail.com
View Profile WWW Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #12 on: October 04, 2005, 02:56:27 PM »
Reply with quote

I'd say yes, if the entries are the same structure/format as the controls.ini file. CPViewer/CPVW is not as complex of a program as Johnny5. It does nothing with your mame ctrlr files or the mame executable. It simply looks up tags in an ini file.

John
Report to moderator   Logged
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #13 on: October 04, 2005, 03:21:12 PM »
Reply with quote

great! I'll give it a try tonight.
Report to moderator   Logged
jcrouse
Full Member
***
Offline Offline

Posts: 558


jcrouse1@hotmail.com
View Profile WWW Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #14 on: October 04, 2005, 04:18:32 PM »
Reply with quote

Papa...email me at the address on my website.

John
Report to moderator   Logged
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #15 on: October 05, 2005, 06:55:41 AM »
Reply with quote Modify message Remove message

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!!!
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #16 on: October 05, 2005, 11:22:05 AM »
Reply with quote

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.
« Last Edit: October 05, 2005, 11:24:54 AM by papaschtroumpf » Report to moderator   Logged
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #17 on: October 05, 2005, 12:27:37 PM »
Reply with quote Modify message Remove message

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.
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.
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.
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 . . .  Angry
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #18 on: October 05, 2005, 01:23:02 PM »
Reply with quote

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.
Report to moderator   Logged
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #19 on: October 05, 2005, 01:25:39 PM »
Reply with quote

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.
Report to moderator   Logged
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #20 on: October 05, 2005, 02:13:14 PM »
Reply with quote Modify message Remove message

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.
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. . .
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #21 on: October 05, 2005, 02:36:06 PM »
Reply with quote

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.
Report to moderator   Logged
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #22 on: October 05, 2005, 03:05:23 PM »
Reply with quote

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.
Report to moderator   Logged
jcrouse
Full Member
***
Offline Offline

Posts: 558


jcrouse1@hotmail.com
View Profile WWW Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #23 on: October 05, 2005, 04:11:15 PM »
Reply with quote

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.

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
Report to moderator   Logged
Howard_Casto
Idiot Police
Developers
Full Member
***
Offline Offline

Posts: 4291


Your post's soul is mine!

casto_howard@hotmail.com thecastoone
View Profile WWW Email Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #24 on: October 05, 2005, 04:56:41 PM »
Reply with quote

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.
Report to moderator   Logged

It waits.....  It shall return...
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #25 on: October 05, 2005, 06:33:34 PM »
Reply with quote

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.


I tried to add "START1=test" in controls.ini since START1 is one of the official MAME controls defined in my CTRLR file for MAME. More exactly it is defined as KEYCODE_1 or KEYCODE_ENTER. I think the default for MAME is just KEYCODE_1 but I have it set up as ENTER in my keyboard encoder, because ENTER is commonly needed in PC Games, especially for menu selections, which makes it fitting to be mapped to START1.

I added a KEYCODE_ENTER label in my layout, expecting it to show up in the generated picture but it didn't work.
I tried to run johnny5 with the -debug option and saw nothing in the debug window that referenced looking for START1.

what am I mising?
« Last Edit: October 05, 2005, 06:35:11 PM by papaschtroumpf » Report to moderator   Logged
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #26 on: October 05, 2005, 06:37:52 PM »
Reply with 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

I'm not at home right now so I can't check, but I don't think I had anything special to do with the "alternating=" line, even thoguh I saw your comment in your email. My cab is an upright, is yours a cocktail? could it be why alternating seems to matter for you but not me? I'm not quite sure what the viewer setup wizard does under the hood, but cabinet style and orientation does seem to matter a lot.

Edit: the additional buttons sound great!
Report to moderator   Logged
Howard_Casto
Idiot Police
Developers
Full Member
***
Offline Offline

Posts: 4291


Your post's soul is mine!

casto_howard@hotmail.com thecastoone
View Profile WWW Email Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #27 on: October 05, 2005, 10:49:49 PM »
Reply with quote

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.


I tried to add "START1=test" in controls.ini since START1 is one of the official MAME controls defined in my CTRLR file for MAME. More exactly it is defined as KEYCODE_1 or KEYCODE_ENTER. I think the default for MAME is just KEYCODE_1 but I have it set up as ENTER in my keyboard encoder, because ENTER is commonly needed in PC Games, especially for menu selections, which makes it fitting to be mapped to START1.

I added a KEYCODE_ENTER label in my layout, expecting it to show up in the generated picture but it didn't work.
I tried to run johnny5 with the -debug option and saw nothing in the debug window that referenced looking for START1.

what am I mising?


It's quite simple really.....  do you have start defined as enter anywhere in mame?  I talked about adding more physical inputs, not virtual ones.  Since none of your mame mappings have Start1 mapped to enter it has no way of knowing that you use start1 as enter.  And of course start1 has to be somewhere in the p1controltype string setup properly in the format.  Viewers know which labels to read from an entry by the controltype entry at the beginning. 
Report to moderator   Logged

It waits.....  It shall return...
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #28 on: October 06, 2005, 07:01:04 PM »
Reply with quote

I tried to add "START1=test" in controls.ini since START1 is one of the official MAME controls defined in my CTRLR file for MAME. More exactly it is defined as KEYCODE_1 or KEYCODE_ENTER. I think the default for MAME is just KEYCODE_1 but I have it set up as ENTER in my keyboard encoder, because ENTER is commonly needed in PC Games, especially for menu selections, which makes it fitting to be mapped to START1.

I added a KEYCODE_ENTER label in my layout, expecting it to show up in the generated picture but it didn't work.
I tried to run johnny5 with the -debug option and saw nothing in the debug window that referenced looking for START1.

what am I mising?


Is this what you mean?


  And of course start1 has to be somewhere in the p1controltype string setup properly in the format.  Viewers know which labels to read from an entry by the controltype entry at the beginning. 

I don't understand what this means, so it maybe it's the problem, but I can't fix it until I know what you mean. where is the "p1controltype" string?
« Last Edit: October 06, 2005, 07:03:54 PM by papaschtroumpf » Report to moderator   Logged
Howard_Casto
Idiot Police
Developers
Full Member
***
Offline Offline

Posts: 4291


Your post's soul is mine!

casto_howard@hotmail.com thecastoone
View Profile WWW Email Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #29 on: October 06, 2005, 11:28:54 PM »
Reply with quote

In the controls.ini of course.....  (P1Controls= )

This entry is always read first and tells the viewer how many and what kinds of virtual inputs this game uses.  If the mame constant of a label description isn't included, it never gets read.

To add a "virtual" control you have to have three things:

A label description in the controls.ini (P1Start=Start)

A Virtual/Physical link tacked onto the control type string (|Player 1 Start+P1Start)

A cfg/ctrlr/Std.ini entry that defines said virtual keys mame constant to a physical keyboard key (P1Start=KEYCODE_ENTER)



Please note that I have no clue if P1Start is a real constant, I'm just using it as an example. 


Also note that it doesn't have to be a real mame constant, it just has to be in the same name in the cfgs  and both places in the controls.ini.  And of course it has to have a real key assigned to it in said mame cfgs.

The easiest way to add "fake" virtual inputs is to define a bunch in your std.ini which may or may not be in your current mame build, but will be read by the viewer if you include one.

Report to moderator   Logged

It waits.....  It shall return...
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #30 on: October 07, 2005, 11:01:02 AM »
Reply with quote

Cool, thanks the the explanation, I may handle it that way since it seems cleaner that my "P1_BUTTON10..." hack.
Report to moderator   Logged
Howard_Casto
Idiot Police
Developers
Full Member
***
Offline Offline

Posts: 4291


Your post's soul is mine!

casto_howard@hotmail.com thecastoone
View Profile WWW Email Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #31 on: October 07, 2005, 05:00:36 PM »
Reply with quote

Heh I think you are confused......

buttons are a special case. 

Since adding 1-button1..ect to the p1controls string would be excessively long, those are assumed.  (Unless the game only uses buttons, but that's another story)

In each entry there is a "NumberofButtons" entry.  The viewer just reads how many buttons are counted and automatically knows the keys to search for (P#Button#=)

Now again, some physical key has to be defined to that virtual key somewhere in your mame cfgs, but you never have to worry about it being added somewhere, just make sure your NumberofButtons Entry matches. 
Report to moderator   Logged

It waits.....  It shall return...
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #32 on: October 07, 2005, 05:08:59 PM »
Reply with quote

yes, I actually figured out how that part worked (thanks to the -debug option), which is why I was able to add extra buttons that are defined in the MAME CTRLR file but not really used for MAME (I don't play any 10 button games.)
Report to moderator   Logged
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #33 on: October 11, 2005, 12:24:41 PM »
Reply with quote Modify message Remove message

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.
Papa - I am getting ready to add this to the Johnny5 page and wanted to clarify something. . . When you say my CTRLR file above, you are referring to the custom controls.ini file, not MAME's ctrlr.cfg file or Johnny's .lof file, correct???
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #34 on: October 11, 2005, 03:15:15 PM »
Reply with quote

actually I am referring to mame's ctrlr file, if I remember right the mame.ini points to it and it's in the mame/ini directory.
I think Johnny might be smart enough to get it from a game specific ini file but I haven't tried it.
Report to moderator   Logged
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #35 on: October 11, 2005, 04:32:42 PM »
Reply with quote Modify message Remove message

Thanks!!!
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
Tiger-Heli
Full Member
***
Online Online

Posts: 4075


Ron Howard? . . . er, I mean . . . Run, Coward!!!


View Profile WWW Personal Message (Online)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #36 on: Yesterday at 11:03:40 AM »
Reply with quote Modify message Remove message

Final Questions for Papa (well maybe) -

I haven't messed with the ctrlr.cfg files yet, but I tried setting some entries in the controls.ini file, and I noticed that Johnny5 ignores a "P2_Button1=Some text" entry.

I suspect that you will need to define P1_Button15-24 to cover the P2 buttons and joystick entries.

Have you run into this?  (or do you have a single-player CP?)

Do you know if there is a limit to how many P1 buttons can be added to the ctrlr file by this method???
Report to moderator    Logged

The hypocrites are slandering the sacred halls of Truth
Ancient nobles showering their bitterness on youth
Can't we find the minds that made us strong? - RUSH, A  Farewell to Kings
papaschtroumpf
Full Member
***
Offline Offline

Posts: 848


Have a Cow!


View Profile Personal Message (Offline)
Re: johnny 5 (or CPViewer) for non-mame
« Reply #37 on: Yesterday at 11:11:49 AM »
Reply with quote

I've got only a single player control panel, so I didn't run into the issue.
I known CPViewer does support P2_ entries, becuase I tried doing the opposite: entering "P2" entries so that I would have more "spare" buttons.
Report to moderator   Logged
Pages: [1] Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Build Your Own Arcade Controls Forum | Powered by SMF 1.0.5.
© 2001-2005, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!
Page created in 0.153 seconds with 18 queries.