Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: shiloh on December 28, 2008, 12:52:57 pm
-
Hi all,
My panel has two U360 for player 1 and 2. I cant get CPWizard to show up anything for the joysticks labels.
In my layout I have used the joyticks codes for the joystick direction labels ("JOYCODE_1_UP" etc...).
My mame version is .128. I dont use a ctrlr file. This is a portion of my player 1 mapping in my "default.cfg" in the mame "cfg" folder:
<port type="P1_JOYSTICK_UP">
<newseq type="standard">
JOYCODE_1_YAXIS_UP_SWITCH
</newseq>
</port>
<port type="P1_JOYSTICK_DOWN">
<newseq type="standard">
JOYCODE_1_YAXIS_DOWN_SWITCH
</newseq>
</port>
<port type="P1_JOYSTICK_LEFT">
<newseq type="standard">
JOYCODE_1_XAXIS_LEFT_SWITCH
</newseq>
</port>
<port type="P1_JOYSTICK_RIGHT">
<newseq type="standard">
JOYCODE_1_XAXIS_RIGHT_SWITCH
</newseq>
</port>
I read in another post here that these input codes must be mapped in the CPWizard "std.ini" file if they dont already match. They werent matching so I went ahead and changed the mapping in the "data\std.ini" files as follow (added a third joycode at the end of the two already present):
P1_JOYSTICK_UP "KEYCODE_UP|JOYCODE_1_Y_UP_SWITCH|JOYCODE_1_YAXIS_UP_SWITCH"
P1_JOYSTICK_DOWN "KEYCODE_DOWN|JOYCODE_1_Y_DOWN_SWITCH|JOYCODE_1_YAXIS_DOWN_SWITCH"
P1_JOYSTICK_LEFT "KEYCODE_LEFT|JOYCODE_1_X_LEFT_SWITCH|JOYCODE_1_XAXIS_LEFT_SWITCH"
P1_JOYSTICK_RIGHT "KEYCODE_RIGHT|JOYCODE_1_X_RIGHT_SWITCH|JOYCODE_1_XAXIS_RIGHT_SWITCH"
I still cannot get the joysticks label to show anything and I am out of idea of things to check for. I couldnt find other post on this other than the one I mentionned which said to verify the code mapping in the std.ini.
what else I need to verify/check?
thanks all
-
Can you post your layout xml file and your default.cfg? I'll see if I can figure out whats going wrong.
-
I had similar problems (using U360s also). It, along with loss of focus issues, caused me to stop using CPwizard.
-
Can you post your layout xml file and your default.cfg? I'll see if I can figure out whats going wrong.
Files are attached.
Thanks very much for looking into this headkaze!
-
Ginsu Victim: I'm pretty sure the focus issue with CPWizard has been fixed. I noticed this problem with U360's and it has something to do with DirectInput. Please give it another try and let me know if your still having problems. I've spent a tonne of time making sure CPW will gain focus properly from Mame.
shiloh: I'll get back to you as soon as I can :)
-
Ginsu, you could also try using the bezel approach. There are pros and cons to both approaches, but overall I like the bezels more. But I might even try using both, where CPW would activate on a key other than pause to allow me to view the CPW menu.
-
Maybe I'll give it another shot. I'm about to put a newer PC in my cab, so I'll be tinkering anyway. Might be a good time to try again. (Using Mamewah as the frontend, btw.)
-
Files are attached.
Thanks very much for looking into this headkaze!
Looks like another bungle on my behalf. I don't use joysticks or mice on my cab so I need people to report issues like this so I can fix them. I also get very confused by the Mame devs who keep changing the input codes which is why I placed them into text files in Data\InputCodes.
You were close you just needed to edit JoyCodes.txt and add in those codes as well and then change your layout to match the same codes. I've uploaded a new version of CPWizard which I've updated std.ini and JoyCodes.txt as well as MouseCodes.txt. That should fix your problem AFAIK. I can't really believe noone reported this one earlier or maybe they did and I was too stupid to realise it.
If anyone else has any more problems with codes or thinks I have something wrong in the InputCodes folder please let me know so I can do an update.
-
Files are attached.
Thanks very much for looking into this headkaze!
Looks like another bungle on my behalf. I don't use joysticks or mice on my cab so I need people to report issues like this so I can fix them. I also get very confused by the Mame devs who keep changing the input codes which is why I placed them into text files in Data\InputCodes.
You were close you just needed to edit JoyCodes.txt and add in those codes as well and then change your layout to match the same codes. I've uploaded a new version of CPWizard which I've updated std.ini and JoyCodes.txt as well as MouseCodes.txt. That should fix your problem AFAIK. I can't really believe noone reported this one earlier or maybe they did and I was too stupid to realise it.
If anyone else has any more problems with codes or thinks I have something wrong in the InputCodes folder please let me know so I can do an update.
Thanks Headkaze!
I noticed that the trackball and spinner codes werent showing anything too, but I was trying to fix the joysticks first.
I'll download the latest and test everything. I'll report back if there is still codes issues
thanks again
-
Hello headkaze
I tried the latest version (2.04) this morning. It fixes the joystick issues I had! Nice!
However, I think there is some more changes needed for the mouse codes to work fine. I cant get the labels to work for my trackball or spinner.
On my cabinet the trackball is mouse #4 and the spinner is mouse #5 so their inputs are configured as follow in mame "default.cfg":
<port type="P1_TRACKBALL_X">
<newseq type="standard">
MOUSECODE_4_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P1_TRACKBALL_Y">
<newseq type="standard">
MOUSECODE_4_YAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
<port type="P1_DIAL">
<newseq type="standard">
MOUSECODE_5_XAXIS
</newseq>
<newseq type="decrement">
NONE
</newseq>
<newseq type="increment">
NONE
</newseq>
</port>
In your Mousecodes.txt, there is no codes for the analog mouse axis (ie. MOUSECODE_4_XAXIS), only the codes for digital emulation of analog devices are there (MOUSECODE_4_XAXIS_NEG_SWITCH & MOUSECODE_4_XAXIS_POS_SWITCH).
I tried to add the analog input into the mousecodes (MOUSECODE_4_YAXIS & MOUSECODE_4_XAXIS) files and map it to the player #1 trackball as follow in the std.ini :
P1_TRACKBALL_X "MOUSECODE_1_LEFT|JOYCODE_1_LEFT|KEYCODE_LEFT|JOYCODE_1_LEFT_LEFT_SWITCH|MOUSECODE_4_XAXIS"
but it didnt work.
Something I am wondering for analog mouse (trackball and spinner) is how we will be able to define label for "up", "down", "left", etc... because mame has just an analog input code per axis? If you understand what I mean.
There is no issue when emulating an analog trackball with a digital device beause for this mame has two input codes, one to increase the axis value and one to decrease the axis values (ie, right and left on an X axis).
-
shiloh: I think it will be a bit tricky to get analog codes working as you noticed they only have one code per axis. I did have a play last night and got the trackball labels showing but I had trouble with the spinner then I realised there was another issue I had to deal with when it comes to mouse codes. If you don't use MOUSE_1 for player 1 and MOUSE_2 for player 2 which are the defaults then it will not map things correctly.
To be honest with you I think I need to re-write large parts of the mapping code to accomodate some of this. Bare with me and I'll have a look when I get some spare time soon.
-
No worries Headkaze, I'll use a specific layout for trackball ans spinner games (a duplicate of my main layout) with some static labels. It should be fine like that.
-
Looks like another bungle on my behalf. I don't use joysticks or mice on my cab so I need people to report issues like this so I can fix them. I also get very confused by the Mame devs who keep changing the input codes which is why I placed them into text files in Data\InputCodes.
Hey headkaze - I ran into pretty much the same problem with LEDBlinky (missing mame default input codes for analog sticks). Back with older versions of mame, I could use the inptport.c file from the mame source to identify all the default input codes, but now it's all parameterized. Do you have any idea how to identify the default input codes or generate the std.ini file (is that even a mame file or something J5 created)?
Thanks,
arzoo
-
Hey headkaze - I ran into pretty much the same problem with LEDBlinky (missing mame default input codes for analog sticks). Back with older versions of mame, I could use the inptport.c file from the mame source to identify all the default input codes, but now it's all parameterized. Do you have any idea how to identify the default input codes or generate the std.ini file (is that even a mame file or something J5 created)?
I implemented Analog input support to CPW and PlugInLCD today. I'll give you a quick rundown on what I did. I wrote a little app called inp2std.exe that will convert inpttype.h to a file similar to J5's old std.ini. I have changed the name to MameDefault.txt.
To interpret analog controls I simply split them into two digital inputs. I have a file called AnalogToDigital.txt that contains the info on how to split the analog input codes.
JOYCODE_{0}_XAXIS JOYCODE_{0}_XAXIS_LEFT_SWITCH|JOYCODE_{0}_XAXIS_RIGHT_SWITCH
JOYCODE_{0}_YAXIS JOYCODE_{0}_YAXIS_UP_SWITCH|JOYCODE_{0}_YAXIS_DOWN_SWITCH
MOUSECODE_{0}_XAXIS MOUSECODE_{0}_XAXIS_NEG_SWITCH|MOUSECODE_{0}_XAXIS_POS_SWITCH
MOUSECODE_{0}_YAXIS MOUSECODE_{0}_YAXIS_NEG_SWITCH|MOUSECODE_{0}_YAXIS_POS_SWITCH
For example lets take a look at one of shiloh's mappings in his default.cfg
<port type="P1_TRACKBALL_X">
<newseq type="standard">
MOUSECODE_4_XAXIS
</newseq>
</port>
When you read in MOUSECODE_4_XAXIS you split it into two digital input codes. To do that you need to remap two inputs.
P1_TRACKBALL_X = MOUSECODE_4_XAXIS_NEG_SWITCH
P1_TRACKBALL_X_EXT = MOUSECODE_4_XAXIS_POS_SWITCH
Simple as that and your existing code should be able to remap those as if it they were two digital input codes so it shouldn't be too much work to add support for them. I'll attach my util and InputCode text files for you to have a look.
shiloh: I used your default.cfg and marcade.xml layout to test this. You will have to change the input codes to be analog in your layout but both the dialer and trackball analog inputs were mapped correctly in my tests. Let me know how you go.
-
Headkaze - As always, you have the answer and an app or dll to go with it! For LEDBlinky, the whole analog control thing is really overkill - very few users have joysticks (analog or other) that light up. And beyond that, it's still a single control (one LED), so there's really no reason for me to distinguish up/down/left/right. But it is possible that someone could add LEDs around the base of a programmable stick and want them to light up correctly (I considered this for my cp). Or someone could have labels with LEDs (2way, 4way, 8way, etc.). So I'm trying to keep LEDBlinky as flexible as possible - what a pain! Anyway, thanks again.