X-55 Twist Rudder Axis Doesn't Work
I don't know if this is a system-specific problem or something with DXX-Rebirth.

Does anybody else have an X-55 that could try? I've tried it with the throttle unplugged and it still doesn't work. I've ensured that the default profile is loaded and that the axis isn't locked in H.U.D., and the axis reports properly in the Windows calibration window.

EDIT: Turns out this is a bug in SDL, and I fixed it myself.
Replacement SDL.dll here: http://www.mediafire.com/download/vsl8qh...s2/SDL.dll
Patch here: https://bugzilla-attachments.libsdl.org/...gi?id=1967
Using Windows OS? SDL still uses the early Direct Input structure
JOYINFOEX http://msdn.microsoft.com/en-us/library/...85%29.aspx
I'm not sure if that has anything to do with your controller, but for me throttle maps to dwVpos.

I wish SDL would support the new Direct Input structure (v5.0+)
DIJOYSTATE http://msdn.microsoft.com/en-us/library/...85%29.aspx
which was introduced back in 1997. Forsaken used DIJOYSTATE when it came out in 1998.
Is there any other SDL-based joystick-using programs so that I can test in other software? That would help narrow it down a lot

I noticed in Windows the rudder reports as "Z Rotation"

Perhaps it leaves other axes unused in between X and Y and that one? I don't know if that would affect anything. I think most single joysticks have the throttle axis between X/Y and the rudder. So therefore the joystick defines axes 1, 2, and 4, and leaves 3 unused.

Maybe whatever routine that checks for axes (whether in DXX-Rebirth or SDL) sees the blank third axis and assumes that the joystick has no other axes, instead of checking the rest?

EDIT: I just remembered that DOSBOX also uses SDL and joysticks, so I will test there

EDIT 2: DOSBOX does not recognize the axis either, so it seems this is an SDL issue. I wonder if SDL2 has the same problem or not.

At least I can get around this using joystick remapper, so it's not a huge deal
I noticed that SDL2-2.0.3 added DIJOYSTATE's larger cousin DIJOYSTATE2, but I don't see regular DIJOYSTATE anywhere.


SDL_dxjoystick.c DIJOYSTATE2, Direct Input v5+
SDL_mmjoystick.c JOYINFOEX what was Direct Input before v5, is now called 'multi-media joystick'

file: SDL_mmjoystick.c
function: SDL_SYS_JoystickInit(void)
var: JOYINFOEX joyinfo;

function: SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
var: JOYINFOEX joyinfo;

file: SDL_dxjoystick.c
This file only has the much larger structure DIJOYSTATE2
Which is overkill for most controllers. It's possible joysticks map to the first portion of this larger structure, however.
This file seems to have Xinput mixed in, which is odd, Xinput isn't Direct Input.

function: SDL_SYS_JoystickUpdate_Polled(SDL_Joystick * joystick)

This function points the variable 'state' to the DIJOYSTATE2 structure , then processes only the first portion of the structure (6 axis, 2 sliders, buttons and hat.) It casts longs (4byte signed int) to Sint16 (2byte signed int). Hopefully data isn't mangled in the translation.

Is DXX Rebirth using or going to use the new SDL version? If so, it would be nice if users could choose which input structure to use.

Thanks for pointing out the joystick mapper, that uses autohotkey I assume?
Zico has talked about migrating to SDL2.  As I understand it, SDL1 and SDL2 are not API-compatible, so source changes are required.  I have seen claims that SDL2 on Linux switched to a method of joystick access that requires the user to have permission to access all system input devices, meaning either be root or have root reconfigure the devices for you.  To me, that makes Linux joystick usage on SDL2 impractical, so I have no interest in migrating Rebirth to SDL2 until that is fixed.  As of last check, the SDL2 developers did not consider that change to be a defect, so it is doubtful it will ever be fixed.

Tarvis, does your joystick work correctly with SDL1 on Linux?
Just read this:
"Support for the older joystick API (/dev/input/js*) for Linux has been dropped from SDL2. SDL2 only supports the newer events API (/dev/input/event*) for joysticks. These events are not normally readable for normal user accounts, so even if joysticks are plugged in you will likely have none detected. This is something that end users will have to configure for themselves."

Is this configuration a one time event?

Regarding Windows OS: Just to be clear the issue isn't actually SDL directly. Directly the problem is how some controllers map to the JOYINFOEX structure, and I don't think it's a driver issue either. It just so happens that SDL 1.2 uses JOYINFOEX.  I've checked this with a game that accesses JOYINFOEX directly (not through SDL.) JOYINFOEX has been outdated for 17 years now.
Quote:Tarvis, does your joystick work correctly with SDL1 on Linux?

I haven't tested it on Linux. I'll dust off my old laptop and try it there and see what happens.

Plenty of other games (on Windows) recognize the axis properly, so I do know the joystick itself is not defective. I don't know if they use JOYINFOEX or DIJOYSTATE. It just seems to be SDL's problem in particular.

I guess updating to SDL2 would exchange one joystick problem for another, except it'd be an issue for a whole OS userbase instead of the userbase of just one particular joystick. So I understand not wanting to do so.

EDIT: Interestingly, DXX-Rebirth does recognize that the joystick does have 3 axes (it's reported as such in gamelog.txt) however it does not actually recognize input from it (as the third axis is actually axis 4)
The same behavior occurs in DOSBOX. When using 4axis joystick mode, it automatically maps the third axis, but no input actually affects it.

Quote:Thanks for pointing out the joystick mapper, that uses autohotkey I assume?
There are two different remappers I'm aware of: VJoy+UJE, which is an AutoHotKey script, and PPJoy. However, PPJoy's remapper is restricted to 16 buttons instead of VJoy's 32.

I personally use GlovePIE, but it's a lot more technical than the above two. I don't what the solutions are for Linux systems, but I bet there's at least one out there.
Thanks for the info on the mappers, I might try the autohotkey solution as you can do more than just re-map.

"I don't know if they use JOYINFOEX or DIJOYSTATE. It just seems to be SDL's problem in particular."
I'm pretty sure joystick drivers simply register as a joystick in Windows. Then in turn Windows/Direct Input maps the controller inputs to all structures automatically. Problem is the controller mapping to JOYINFOEX. SDL 1.2 has the problem simply because it uses JOYINFOEX and JOYINFOEX mapping is messed up. JOYINFOEX was the Direct Input v3 structure, now it's called 'multi-media' joystick structure.

Direct Input pre v5
JOYINFO (Joystick Information) http://msdn.microsoft.com/en-us/library/...s.85).aspx
JOYINFOEX (Joystick Infomation Extended) http://msdn.microsoft.com/en-us/library/...85%29.aspx

Direct Input v5+
DIJOYSTATE (Direct Input Joystick State) http://msdn.microsoft.com/en-us/library/...85%29.aspx
DIJOYSTTATE2 (Direct Input Joystick State) (http://msdn.microsoft.com/en-us/library/...85%29.aspx

SDL 1.2 only uses JOYINFOEX.
SDL 2.0 only uses JOYINFOEX and DIJOYSTATE2 (just one or the other, I suppose this is chosen at compile time)

I believe there is a mapping fix at http://msdn.microsoft.com/en-us/library/...85%29.aspx
It involves messing with the registry, so before messing with it back up your registry!
The mapping helps with DXX-Rebirth, but breaks games (like X-Wing Alliance) that expect the rudder to be Axis 5.

The problem is that for whatever reason, if SDL doesn't detect Axis 2 (Throttle/Z axis) then it does not check for input in any later axes, even if they exist. This is in contrast with DirectInput's implementation, which allows Axis 2 to be unmapped and still recognize later axes. (See the mapping fix page at the bottom of the above post)

I don't think it's a mapping problem with DirectInput. My Logitech Wingman Extreme has axes 0, 1, 2, and 5, and it works just fine in DXX-Rebirth. The X-55 Stick only has 0, 1, and 5, however, and SDL gives up after seeing that Axis 2 is not there, even though Axis 5 exists (which is accepted in the DInput specs, as there, Z Axis is allowed to be unmapped. It seems that consideration did not carry on to the SDL implementation.)

I am very sure it's an SDL bug, yet one that has never been found before because the X-55 is the only joystick I can think of that has a rudder axis but no throttle axis.
Well SDL 1.2 does use Direct Input, namely DI v3, now called mulit-media joystick.  It's not a problem with Direct Input as a whole, my controller works just fine with DI v5+ games, such as Forsaken (1998.)

My mappings in Rebirth
'joystick X' as A1
'joystick Y' as A2
'joystick Z' as A3
'joystick Rz' as A4
'joystick Throttle' as A5
'joystick Rx' as A6

Throttle as A5 is no good, but I can't change it. My joystick Ry doesn't even map to JOYINFOEX, unless I figure out the cryptic registry settings alluded to here http://msdn.microsoft.com/en-us/library/...85%29.aspx

Here's a good article that goes over the v3 to v5 mapping

You seem sure it's an SDL bug, but I bet you'll have same problem with a DI v3 game.

Forum Jump:

Users browsing this thread: 1 Guest(s)