Windows control panel shows 8 buttons, and it works in other
emulators that don’t use SDL. A user reported that older versions of
FCEU (an NES/SNES emulator based on SDL) also didn’t work with this
adaptor, and then suddenly it did after a specific release. I did a
diff on the releases between before and after it started working, and
noticed that the developer basically added platform-specific code to
deal with joysticks. That is, they added an DX5 component for
Windows, joydev code for LInux, etc. It looks like they ripped out
specific parts of SDL code and added it to their project.
I really want to avoid this unless absolutely necessary, since the
whole point of using SDL is to specifically not have to deal with
platform-specific issues.
That’s very interesting. I must have misread you saying that
Windows itself sees only four of the eight buttons. But if it’s only
SDL that’s not seeing it, I’m more curious.
Actually, I may have stumbled across a similar problem:
http://www.3dconnexion.de/forum/viewtopic.php?t=4417
It seems that other controllers have issues using this same API. I
assume that is what SDL is using for your SNES controller, since you
note that it works properly under DirectInput-using software and that
a few projects have rolled their own DInput support.
SDL does have DInput support. If it is not the default, perhaps
someone can better explain why not than I.
SDL can of course be configured via its environment, but that’s
sub-optimal. I can’t say I understand joysticks under Windows enough
for more intelligent thought. As of DirectX 5.0, Microsoft
recommended using DirectInput for joystick support. As of 2005, they
recommend XInput?but XInput is basically an API for the XBox 360
controller or perhaps any other device that can be considered a close
cousin. Without any real analog controls, the SNES controller would
be excluded. My slightly older Logitech Dual Action might not
even qualify since its L2/R2 are digital buttons rather than analog.
I also note that most of the PS3 controllers’ buttons are analog.
Far more than the XBox 360 controller. I suppose I can poke at
this later, though I’m limited to Windows XP at the moment. I’m
supposed to have a Windows 7 around here somewhere, but it hasn’t
happened yet.
No driver, just a standard HID controller, just as it is in OSX and Linux.
That pretty much shreds my notion of a driver initialization issue.
If the buttons I thought might be reported actually are, it would
likely be quite coincidental. Interesting, but coincidental.
Also I wonder if there are any gaps in the Windows layout. Maybe
there’s a gap in how buttons are assigned (e.g. buttons 4 and 5 are
missing or something like that) and that cuts short what SDL detects?
Doubt it though…
That part I will have to check. I will also check with the original
bug reporter, as they seem to have a technical background and know a
little about how this device works.
The first link I pasted above talks about other sticks using the same
driver not reporting things?but specifically with one of the THREE
joystick APIs used under Windows.
As I said, DInput used to be the right way to do it, but as of 2005,
Microsoft wants to push everyone into XInput. That’s very Apple of
them, actually, but it provides a consistent user experience without
much fiddling. That’s a good thing generally. But your SNES
controller isn’t going to automatically map to XInput. There’s stuff
like x360ce out there, but ? yeah.
But SDL has DInput support, and SDL will give you a nice XInput-style
API for any controller you’ve got a mapping for, with anything XInput
being already pre-configured for you.
I don’t do enough gaming anywhere near Windows to know why
DInput/XInput would not be what SDL uses by default on Windows. It
seems the obvious choice to me.
But I still wonder why the reported USB name is different for Windows
compared to OSX/Linux. It almost seems as if SDL in Windows is using
a different joystick API to detect the stick, and is not successfully
doing so.
I’m actually pretty sure that’s exactly what’s happening since things
that use DirectInput seem to work.
JosephOn Wed, Sep 25, 2013 at 05:11:44AM -0230, Stephen Anthony wrote: