I have 2 controllers that are 16 buttons each + the dpad which accounts for another 4. That's about 40 buttons or so. For some reason when I configure my controllers under ZSNES, some identifiers are being used more then once which causes many problems with playing anything co-op. Say for example: I press right on 1P controller to move and then player 2's character would jump, because they are both set to the same one.
While playing an alternating 2P game this problem is not there because the 2nd player would obviously not respond while player 1 is playing.
I've tested this on CVS, 1.42 and 1.36
At first I assumed it was maybe the way it was configured with udev or whatever, so I tested it in jscalibrator and none of the buttons seem to be controlling anything it shouldn't be so I'm pretty sure this is a problem with ZSNES. I'm running the SDL linux version, btw.
Max supported amount of buttons?
Moderator: ZSNES Mods
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
This probably isn't related to his problem, but there does seem to be a bug in sdllink.c that would cause two joysticks to overlap if the first has any trackballs; the number of balls should be multiplied by 4 in these lines:
This patch fixes that as well as cleans up the code a bit.
Code: Select all
AxisOffset[i] = BallOffset[i - 1] +
SDL_JoystickNumBalls(JoystickInput[i - 1]);
Code: Select all
--- sdllink.c.orig 2006-09-21 09:59:49.000000000 -0400
+++ sdllink.c 2006-09-26 23:11:52.000000000 -0400
@@ -761,7 +761,7 @@
{
int i, max_num_joysticks;
int num_axes, num_buttons, num_hats, num_balls;
- int js_fail = 0;
+ int next_offset = 256;
for (i = 0; i < 5; i++)
JoystickInput[i] = NULL;
@@ -792,35 +792,19 @@
printf(" %i axis, %i buttons, %i hats, %i balls\n",
num_axes, num_buttons, num_hats, num_balls);
- if (js_fail)
+ if (next_offset >= 448)
{
printf("Warning: Joystick won't work.\n");
continue;
}
- if (i == 0)
- {
- AxisOffset[0] = 256; // After key data
- ButtonOffset[0] = AxisOffset[0] + num_axes * 2;
-// printf("ButtonOffset %d\n", ButtonOffset[0]);
- HatOffset[0] = ButtonOffset[0] + num_buttons;
-// printf("HatOffset %d\n", HatOffset[0]);
- BallOffset[0] = HatOffset[0] + num_hats * 4;
-// printf("BallOffset %d\n", BallOffset[0]);
- if ((BallOffset[0] + num_balls * 4) >= (256 + 128 + 64))
- js_fail = 1;
- }
- else
- {
- AxisOffset[i] = BallOffset[i - 1] +
- SDL_JoystickNumBalls(JoystickInput[i - 1]);
- ButtonOffset[i] = AxisOffset[i] + num_axes * 2;
- HatOffset[i] = ButtonOffset[i] + num_buttons;
- BallOffset[i] = HatOffset[i] + num_hats * 4;
- if ((BallOffset[i] + num_balls * 4) >= (256 + 128 + 64))
- js_fail = 1;
- }
- if (js_fail)
+ AxisOffset[i] = next_offset;
+ ButtonOffset[i] = AxisOffset[i] + num_axes * 2;
+ HatOffset[i] = ButtonOffset[i] + num_buttons;
+ BallOffset[i] = HatOffset[i] + num_hats * 4;
+ next_offset = BallOffset[i] + num_balls * 4;
+
+ if (next_offset > (256 + 128 + 64))
{
printf("Warning: Too many buttons, axes, hats and/or Balls!\n");
printf("Warning: Joystick won't work fully.\n");
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
Does anything similar occur in winlink.cpp? IIRC, there was a similar post that happened to a guy in the Windows port...spoon0042 wrote:This probably isn't related to his problem, but there does seem to be a bug in sdllink.c that would cause two joysticks to overlap if the first has any trackballs; the number of balls should be multiplied by 4 in these lines:
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am