Axes unuseable with zsnes in ubuntu
Moderator: ZSNES Mods
Axes unuseable with zsnes in ubuntu
Hi,
I am on ubuntu 6.10. I have a Saitek PLC Cyborg Force Rumble Pad.
zsnes recognizes that I have 6 axis, 12 buttons, 0 hats, 0 balls upon startup. That matches my gamepad (which has 6 axis and 12 buttons) correctly.
Unfortunately, when I move to configure my input device in the menu, zsnes fails to recognize my axes (including D-pad, of course). It recognizes the buttons, however.
I have seen this exact problem in various other places, including a couple of posts in this very forum, but I haven't yet found a solution to the problem based on any similar posts.
The joystick calibrator recognizes all of the axes and buttons on my gamepad. It also works wonderfully with the windows version of zsnes.
I have downloaded the most recent version (1.50) and compiled it, and still I cannot achieve success; has anyone happened to find a way to solve this problem? I read on one forum a way to modify the code in sdllink.c to work around this problem, but their solution applied to zsnes 1.36.
Thanks for your time reading this.
I am on ubuntu 6.10. I have a Saitek PLC Cyborg Force Rumble Pad.
zsnes recognizes that I have 6 axis, 12 buttons, 0 hats, 0 balls upon startup. That matches my gamepad (which has 6 axis and 12 buttons) correctly.
Unfortunately, when I move to configure my input device in the menu, zsnes fails to recognize my axes (including D-pad, of course). It recognizes the buttons, however.
I have seen this exact problem in various other places, including a couple of posts in this very forum, but I haven't yet found a solution to the problem based on any similar posts.
The joystick calibrator recognizes all of the axes and buttons on my gamepad. It also works wonderfully with the windows version of zsnes.
I have downloaded the most recent version (1.50) and compiled it, and still I cannot achieve success; has anyone happened to find a way to solve this problem? I read on one forum a way to modify the code in sdllink.c to work around this problem, but their solution applied to zsnes 1.36.
Thanks for your time reading this.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
Hello
just tested, that doesn't work.
I try to add "joy_sensitivity=16xxx" from my windows config file, doesn't work
try to copy enterely my windows config to the Ubuntu config, doesn't work
then I deleted zsnes and the config files, and I installed the SVN version...
...guess what ??? It still doesn't work !!!
I try to "tweak joystick senstivity", it seems it has change some things (it automaticaly assign a value to UP then block on DOWN), but don't really work.
though, it seems that it don't work on VBA too. What's wrong with ubuntu...?
Here is the ".joystick" file (generated by jscalibrator) :
P.S : Erm, if an admin pass by here, could he change my name from "adam050986" to "adam0509" please ? Thank you...
just tested, that doesn't work.
I try to add "joy_sensitivity=16xxx" from my windows config file, doesn't work
try to copy enterely my windows config to the Ubuntu config, doesn't work
then I deleted zsnes and the config files, and I installed the SVN version...
...guess what ??? It still doesn't work !!!
I try to "tweak joystick senstivity", it seems it has change some things (it automaticaly assign a value to UP then block on DOWN), but don't really work.
though, it seems that it don't work on VBA too. What's wrong with ubuntu...?
Here is the ".joystick" file (generated by jscalibrator) :
Thank you in advance.# Joystick calibration file.
# Generated by Joystick Calibrator version 1.5.5.
#
BeginJoystick = /dev/input/js0
Name = Microsoft SideWinder GamePad
LastCalibrated = 1167001950
BeginAxis = 0
Minimum = 76
Center = 1755
Maximum = 3379
NullZone = 419
Tolorance = 2
CorrectionLevel = 0
DeadZoneMinimum = 1750
DeadZoneMaximum = 1750
CorrectionalCoefficientMinimum1 = 0.000000
CorrectionalCoefficientMaximum1 = 0.000000
CorrectionalCoefficientMinimum2 = 0.000000
CorrectionalCoefficientMaximum2 = 0.000000
EndAxis
BeginAxis = 1
Minimum = 76
Center = 1650
Maximum = 3258
NullZone = 402
Tolorance = 0
Flip
CorrectionLevel = 0
DeadZoneMinimum = 1642
DeadZoneMaximum = 1642
CorrectionalCoefficientMinimum1 = 0.000000
CorrectionalCoefficientMaximum1 = 0.000000
CorrectionalCoefficientMinimum2 = 0.000000
CorrectionalCoefficientMaximum2 = 0.000000
EndAxis
EndJoystick
BeginJoystick = /dev/js0
Name = Microsoft SideWinder GamePad
LastCalibrated = 1167002838
BeginAxis = 0
Minimum = 80
Center = 1773
Maximum = 3421
NullZone = 423
Tolorance = 4
CorrectionLevel = 0
DeadZoneMinimum = 1777
DeadZoneMaximum = 1777
CorrectionalCoefficientMinimum1 = 0.000000
CorrectionalCoefficientMaximum1 = 0.000000
CorrectionalCoefficientMinimum2 = 0.000000
CorrectionalCoefficientMaximum2 = 0.000000
EndAxis
BeginAxis = 1
Minimum = 77
Center = 1670
Maximum = 3301
NullZone = 407
Tolorance = 0
Flip
CorrectionLevel = 0
DeadZoneMinimum = 1674
DeadZoneMaximum = 1674
CorrectionalCoefficientMinimum1 = 0.000000
CorrectionalCoefficientMaximum1 = 0.000000
CorrectionalCoefficientMinimum2 = 0.000000
CorrectionalCoefficientMaximum2 = 0.000000
EndAxis
EndJoystick
P.S : Erm, if an admin pass by here, could he change my name from "adam050986" to "adam0509" please ? Thank you...
-
- Locksmith of Hyrule
- Posts: 3634
- Joined: Sun Aug 08, 2004 7:49 am
- Location: 255.255.255.255
- Contact:
you can change your screen name in your profile...
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
NSRT here.
Ok that's it, find it :
If you got an analog gamepad
if you got an analog gamepad (gamepad that needs "sudo modprobe analog" to work), set the value like this (see ".joystick" file in your /home/user) :
Maximum (3421) - Center (1773) = 1648
set the value to a lower value, 1500 for example
joy_sensitivity=1500
If you got a digital gamepad
If you got a digital gamepad such as "Microsoft Sidewinder", set the value to 0 :
joy_sensitivity=0
Now, if Zsnes team could explain me why in my Windows CFG file the value "16xxx" works without problem, I will be curious to see the answer...
EDIT : thanks "adventure of link"
EDIT 2 : is joy_sensitivity a command that only works on 1.50 ? Seems it don't work on 1.42, or maybe I didn't put it where I have to in the config file...?
If you got an analog gamepad
if you got an analog gamepad (gamepad that needs "sudo modprobe analog" to work), set the value like this (see ".joystick" file in your /home/user) :
Maximum (3421) - Center (1773) = 1648
set the value to a lower value, 1500 for example
joy_sensitivity=1500
If you got a digital gamepad
If you got a digital gamepad such as "Microsoft Sidewinder", set the value to 0 :
joy_sensitivity=0
Now, if Zsnes team could explain me why in my Windows CFG file the value "16xxx" works without problem, I will be curious to see the answer...
EDIT : thanks "adventure of link"
EDIT 2 : is joy_sensitivity a command that only works on 1.50 ? Seems it don't work on 1.42, or maybe I didn't put it where I have to in the config file...?
-
- Locksmith of Hyrule
- Posts: 3634
- Joined: Sun Aug 08, 2004 7:49 am
- Location: 255.255.255.255
- Contact:
no problem buddyadam0509 wrote:EDIT : thanks "adventure of link"
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
NSRT here.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
If it works, why argue? DirectInput in Windows is not the same as the SDL port and the joystick testing utility.adam0509 wrote:Now, if Zsnes team could explain me why in my Windows CFG file the value "16xxx" works without problem, I will be curious to see the answer...
Um... it was implemented months ago. 1.42 was released 2 years ago. Do the math.EDIT 2 : is joy_sensitivity a command that only works on 1.50 ? Seems it don't work on 1.42, or maybe I didn't put it where I have to in the config file...?
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
Same problem
Hello,
I'm fairly new to the Ubuntu distro and linux.
I have been having the same problems with the d-pad, it works well with JScalibrator, but the axes don't work when setting it up in ZSNES, only the buttons (I also have this same exact problem with GFCE an emulator for the NES).
I tried to use the joy_sensitivity solution but I don't where this command is, I mean in which file can I find it. Can someone tell which file has the joy_sensitivty command, so I can try this solution.
Thank you,
JuliusCes
Veni Vidi Vici
I'm fairly new to the Ubuntu distro and linux.
I have been having the same problems with the d-pad, it works well with JScalibrator, but the axes don't work when setting it up in ZSNES, only the buttons (I also have this same exact problem with GFCE an emulator for the NES).
I tried to use the joy_sensitivity solution but I don't where this command is, I mean in which file can I find it. Can someone tell which file has the joy_sensitivty command, so I can try this solution.
Thank you,
JuliusCes
Veni Vidi Vici
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
Re: Same problem
I'm having this problem as well. Using the -js command line switch to raise the sensitivity of the joystick doesn't seem to do anything.JuliusCes wrote: I have been having the same problems with the d-pad, it works well with JScalibrator, but the axes don't work when setting it up in ZSNES, only the buttons (I also have this same exact problem with GFCE an emulator for the NES).
I know this joystick works because it works fine in the Joystick Calibration app and I use it in other SDL apps (DOSBox, some emulators).
I just want to use axis 0 for left-right and axis 1 for up-down. Does anyone know if there are specific character codes, analogous to keyboard scan codes, that I can put into my zinput.cfg to get around this?
Analog controller with axis values from 0 to 255
I'm waking up this old thread because I have a very similiar problem. I have an analog controller which gives values from 0 to 255. Because zsnes configuration only takes one sensitivity argument, I can't get it to work. Here's an illustration:
Normal joystick
(-x)-----(-a)----0----(a)-----(x)
My gamepad
0-----(x/2 - a)----(x/2)----(x/2 + a)-----x
x = maximum value
-x =minimum value
a = sensitivity
As you can see, a normal joystick only needs one value to work as a digital contoller, because it's centered at 0. However, my gamepad needs two (a and x, or x/2 -a and x/2 + a), because it's centered at some other point.
Surely I can make it work in ONE direction/axis by setting a sensitivity value higher than x/2
I'd like help on this subject. I'd like to hear that there's a magical way around this problem, but this probably would require an additional configuration parameter like JOYSTICK_CENTER (defaults at 0) or something.
I use ubuntu linux and zsnes version 1.51 (I know, you haven't compiled it yourself, but this is more like a feature request, which doesn't depend on who compiled it )
Normal joystick
(-x)-----(-a)----0----(a)-----(x)
My gamepad
0-----(x/2 - a)----(x/2)----(x/2 + a)-----x
x = maximum value
-x =minimum value
a = sensitivity
As you can see, a normal joystick only needs one value to work as a digital contoller, because it's centered at 0. However, my gamepad needs two (a and x, or x/2 -a and x/2 + a), because it's centered at some other point.
Surely I can make it work in ONE direction/axis by setting a sensitivity value higher than x/2
I'd like help on this subject. I'd like to hear that there's a magical way around this problem, but this probably would require an additional configuration parameter like JOYSTICK_CENTER (defaults at 0) or something.
I use ubuntu linux and zsnes version 1.51 (I know, you haven't compiled it yourself, but this is more like a feature request, which doesn't depend on who compiled it )
Tried, didn't work for me
Sensitivity value of 0 imho refers to a digital D-pad, where value < 0 --> left, value > 0 --> right, in other words, sensitivity = 0.
Digital D-pad:
(-1)---0---(1)
Here's the thing: I'm trying to get a wiimote+nunchuck combination to work as a zsnes gamepad using wm2js driver. I tried to change the driver to give values from -128 to 127 (it's open source), but it uses unsigned chars to store the axis values. Because the values are interpreted by uinput as unsigned 8-bit integers, I'm quite sure I can't easily change the driver to give out negative values.
Of course I *could* just download the zsnes source code and do the necessary changes myself, but then nobody else could benefit from this. Additionally, since I'm not familiar with zsnes' code, it would take me lots of time to do a bugfree fix.
I'd think that the necessary change would be nothing more than a single integer in the zinput configuration file, which would be subtracted from the read joystick value to compensate for the nonzero axis center.
Sensitivity value of 0 imho refers to a digital D-pad, where value < 0 --> left, value > 0 --> right, in other words, sensitivity = 0.
Digital D-pad:
(-1)---0---(1)
Here's the thing: I'm trying to get a wiimote+nunchuck combination to work as a zsnes gamepad using wm2js driver. I tried to change the driver to give values from -128 to 127 (it's open source), but it uses unsigned chars to store the axis values. Because the values are interpreted by uinput as unsigned 8-bit integers, I'm quite sure I can't easily change the driver to give out negative values.
Of course I *could* just download the zsnes source code and do the necessary changes myself, but then nobody else could benefit from this. Additionally, since I'm not familiar with zsnes' code, it would take me lots of time to do a bugfree fix.
I'd think that the necessary change would be nothing more than a single integer in the zinput configuration file, which would be subtracted from the read joystick value to compensate for the nonzero axis center.
SOLVED
Okay, after a bunch of debug printfs, I found out that SDL seems to scale the nunchucks values from 0..255 to something like -25k..25k. After a bit of tweaking, joy_sensitivity of 15000 seems to work ok.
Still, the diagonals are a bit off. The problem is, that they are further away from the center position than the basic directions.
It would be nice to make this work so, that
but at a quick look I didn't see a way to do this. The reason is obvious: zsnes doesn't actually present a two-axis controller, but various controller events, of which button mappings can be done. Because of this, the two axis values cannot be known at the same time.
However, if someone comes up with an elegant solution, I'd like to hear it. I could even go so far as to actually program it
EDIT: Typos
Still, the diagonals are a bit off. The problem is, that they are further away from the center position than the basic directions.
Code: Select all
+-------+-------+
|UL| U P |UR|
|--+----+----+--|
|L | \ | / |R |
|E | \|/ |I |
+ +----+----+G +
|F | /|\ |H |
|T | / | \ |T |
|--+----+----+--|
|DL| D O W N |DR|
+-------+-------+
Code: Select all
if( x_axis * x_axis + y_axis * y_axis >=
joy_sensitivity * joy_sensitivity )
{
// a direction has exceeded sensitivity
// here, the actual direction can be deduced from
// abs(x_axis / y_axis) and the signs of both axis values
}
However, if someone comes up with an elegant solution, I'd like to hear it. I could even go so far as to actually program it
EDIT: Typos