Two Joypads disturbing each other
Moderator: ZSNES Mods
Two Joypads disturbing each other
Hallo,
i recently bought 2 Logitech Precisiion Pads for playing Street Fighter.
There was no problem to configure them but in the game we had to notice, that some Keys are
double-binded... So for example if i walk, my opponent kicks.
This is a little bit disturbing.
Is there any trick to force zsnes using 2 different devices seprately?
Im using zsnes under Gentoo.
I tried:
zsnes -1 5 -2 5
but it doesn't change anything.
Any ideas?
My Street Fighter TNC Module is broken and you can't get it anywhere outthere so
it would be nice if we can play it with ZSNES.
Greetings Don Martio
i recently bought 2 Logitech Precisiion Pads for playing Street Fighter.
There was no problem to configure them but in the game we had to notice, that some Keys are
double-binded... So for example if i walk, my opponent kicks.
This is a little bit disturbing.
Is there any trick to force zsnes using 2 different devices seprately?
Im using zsnes under Gentoo.
I tried:
zsnes -1 5 -2 5
but it doesn't change anything.
Any ideas?
My Street Fighter TNC Module is broken and you can't get it anywhere outthere so
it would be nice if we can play it with ZSNES.
Greetings Don Martio
And now i tested it with two different Joypads but the result is somewhat differnt and at last the same.
When i start zsnes from console i get the feedback
Device 0 /dev/input/js0
2 axis, 2 buttons, 0 hats, 0 balls
Device 1 /dev/input/js1
2 axis, 2 buttons, 0 hats, 0 balls
Does that mean, that there is some error in the device configuration of zsnes?
If i use the devices with cat there is no disturbing each other.
Any help is appriciated.
Greetings
DonMartio
When i start zsnes from console i get the feedback
Device 0 /dev/input/js0
2 axis, 2 buttons, 0 hats, 0 balls
Device 1 /dev/input/js1
2 axis, 2 buttons, 0 hats, 0 balls
Does that mean, that there is some error in the device configuration of zsnes?
If i use the devices with cat there is no disturbing each other.
Any help is appriciated.
Greetings
DonMartio
Well, make sure that the settings don't conflict in Zsnes.
Try completely redoing the controller config in both p1 and p2, and make sure that there's no setting in P3 or p4.
How are these connected to your computer?
Try completely redoing the controller config in both p1 and p2, and make sure that there's no setting in P3 or p4.
How are these connected to your computer?
SHREIK!!!!!!! DDdddnnnnnnaaaa! GESTAHLLLLLLLLLL!!!!!!!!
Steelers now officially own your ass.
Steelers now officially own your ass.
Thanks for the reply.
I've done the Controller Setup a thousend times. What i can say is, that the Button-Codes
that where entered in the fields are partially the same for the to Input-configs.
For exmple J07 is the X-Button on Input 1 and Right on Input 2.
The Controllers are connected via USB and i tested them with cat and with kcontrol. On the system they don't mix up with each other.
I took a look (
) in the sources and i wonder if this isn't a zsnes but a SDL Problem.
I can't imagine how the two controllers are mixed up because they are two different devices.
Im not firm with Input-Programming but in my understanding it's more difficult to mix them up than to keep them seperated.
Well is there anybody who encountered the same Problem?
Greetings
DonMartio
I've done the Controller Setup a thousend times. What i can say is, that the Button-Codes
that where entered in the fields are partially the same for the to Input-configs.
For exmple J07 is the X-Button on Input 1 and Right on Input 2.
The Controllers are connected via USB and i tested them with cat and with kcontrol. On the system they don't mix up with each other.
I took a look (

I can't imagine how the two controllers are mixed up because they are two different devices.
Im not firm with Input-Programming but in my understanding it's more difficult to mix them up than to keep them seperated.
Well is there anybody who encountered the same Problem?
Greetings
DonMartio
So finally i did it (with some dirty hack).
I did some investigation in the sourcecode:
First tried a change of the file sdlintrf.asm:
before:
after:
But that doesn't do the job so i found finally the file sdllink.c:
In this file is a function called InitJoystickInput
In there the offsets for the Axis, Buttons, etc. are calculated from the infos given by
SDL. And now comes the dirty stuff.
I changed the line:
num_buttons = SDL_JoystickNumButtons(JoystickInput) ;
to:
num_buttons = SDL_JoystickNumButtons(JoystickInput) + 6;
Because i have more buttons than the 2 found by SDL.
Now there was only two Buttons double-binded. So
i added:
I simply added 16 to AxisOffset for every Joypad after the first and now everything works fine!.
Ok it's not nice, but it do the job.
I think the main problem is with SDL and the wrong Button Information.
I don't know a clean solution this time but i think of it.
So long
DonMartio
I did some investigation in the sourcecode:
First tried a change of the file sdlintrf.asm:
before:
Code: Select all
; Total Number of Input Devices
NEWSYM NumInputDevices, dd 2
; Input Device Names
NEWSYM GUIInputNames
db 'NONE ',0
db 'KEYB/JOYSTICK ',0
db ' ',0
db ' ',0
db ' ',0
db ' ',0
db 'SIDEWINDERPAD1 ',0
Code: Select all
; Total Number of Input Devices
NEWSYM NumInputDevices, dd 3
; Input Device Names
NEWSYM GUIInputNames
db 'NONE ',0
db 'KEYB/JOYSTICK1 ',0
db 'KEYB/JOYSTICK2 ',1
db ' ',0
db ' ',0
db ' ',0
db 'SIDEWINDERPAD1 ',0
In this file is a function called InitJoystickInput
In there the offsets for the Axis, Buttons, etc. are calculated from the infos given by
SDL. And now comes the dirty stuff.
I changed the line:
num_buttons = SDL_JoystickNumButtons(JoystickInput) ;
to:
num_buttons = SDL_JoystickNumButtons(JoystickInput) + 6;
Because i have more buttons than the 2 found by SDL.
Now there was only two Buttons double-binded. So
i added:
Code: Select all
} else if (num_hats == 0 && num_balls == 0) {
AxisOffset[i] = ButtonOffset[i - 1] + SDL_JoystickNumButtons(JoystickInput[i - 1]) + 16;
ButtonOffset[i] = AxisOffset[i] + num_axes * 2;
} else {...
Ok it's not nice, but it do the job.
I think the main problem is with SDL and the wrong Button Information.
I don't know a clean solution this time but i think of it.
So long
DonMartio
Ok... stupid me... forget the stuff above.
The only thing, that is important, is thad sdl gives the wrong info about my pads.
My Pads have 10 Buttons and SDL says they have two... no calcualte.
I added 8 in the sources and i'm thinking of an option which let you manually set the Buttoncount for your pads.
So don't even read the above sollution.
Greetings
DonMartio
The only thing, that is important, is thad sdl gives the wrong info about my pads.
My Pads have 10 Buttons and SDL says they have two... no calcualte.
I added 8 in the sources and i'm thinking of an option which let you manually set the Buttoncount for your pads.
So don't even read the above sollution.
Greetings
DonMartio
-
- Dark Wind
- Posts: 1271
- Joined: Thu Jul 29, 2004 8:58 pm
- Location: Texas
- Contact:
I made this current joystick code
Glad you found an SDL problem; every error i hear of are SDL bugs, btw.
I think it is strange that SDL does handle the high(er) buttons/axis, but doesn't report them. Do you have the latest SDL? (maybe even from CVS?). Otherwise, this must be a small SDL bug, so try to fix that. You can also simply post your problem on this mailing list and hope somebody else fixes it.

I think it is strange that SDL does handle the high(er) buttons/axis, but doesn't report them. Do you have the latest SDL? (maybe even from CVS?). Otherwise, this must be a small SDL bug, so try to fix that. You can also simply post your problem on this mailing list and hope somebody else fixes it.