I'm currently trying to get my DualShock 3 controller (connected via USB) working with the default controller plugin. Before my last system upgrade, I had it working under ePSXe, but that project seems to be dead, and doesn't work in a 64-bit environment.
I haven't been able to find any other input plugins that work in a 64-bit environment, either (they're all outdated, Windows-only, or closed-source with no 64-bit build).
The problem is that when I try to set a value for the analog sticks, I "almost" can't get it to input anything other than "Joystick: Axis 12-". Like I said above, I can't find any other plugins that I can try.
Note I said "almost." If I open jstest on the controller, all the analog buttons (axes 4-27) sit at -32767, but 0-3 (the one's I need) are at 0. Pressing L2 (axis #12) far enough for jstest to show 0 (half-way down) and clicking "Change"
makes it move to the next non-zero axis (pressing R2 as well gets #14, but that's the best I can do with one hand). I figured that since the configurator just seems confused, perhaps I could hack the right values into ~/.pcsx/plugins/dfinput.cfg, but couldn't
find any info on what the numbers meant (and I could barely grok the source - not that good with C), and no sensible numbers seem to work. Not sure why it thinks it needs to start at #12 in the first place, though,
I've searched Google high and low, as well as every search box I could find here, but to no avail. They all pointed to Windows installs, 32-bit installs, or no resolution.
I'm mostly using version 1.9.92 built from source, but this problem also exists in the latest SVN. My system is Fedora 14 64-bit. Any help is much appreciated, and if you need to know something else, let me know.
Mar 16, 2011 at 8:25 PM
Edited Mar 16, 2011 at 8:28 PM
hmm... This sounds more like an issue with the OS interfacing with your controller than a pcsx-r problem to me. Have you tried using it with other applications(I know
snes9x-gtk has a builtin joystick calibration tool)?
Also, even though I use a DualShock2 via a dual USB converter on Ubuntu 10.04, I think i've managed to(somewhat) decode the
dfinput.cfg(though i can't be sure ofcourse, as i'm not a programmer).
My dfinput.cfg has something like this:
From what i can tell, it means:
KeyboardValue is the decimal number for the keyboard input. ex.
Select defaults to 99, or the 'c' key, while Up gets
65362, or the 'Up' arrow key.
SomeIdentifier is, as far as i can tell, some sort of button type identifier. All my buttons have a value of
3, while the dpad(Hat) gets 2, and the analog sticks/axes' get
1. This might have something to do with the fact that I use the controller in Analog mode(both the controller itself and the emulator), not sure what happens otherwise.
InputValue is the button/axis number. jstest shows these numbers. (Note that my analog stick axes' get shifted from
0,1,2,3 to 1,2,3,4 in the dfinput.cfg file, but show up as
0,1,2,3 in the configuration dialog and jstest)
EDIT: If any of this is incorrect, could someone please point out the flaws? I'm sure there are a few people who may be able to benefit from this information somewhere.
Thanks for the reply. I downloaded snes9x-gtk, and sure enough, it can read the sticks. Getting it to register them is a bit of a pain, and it seems to prefer mapping to a buttons' analog axis rather than its binary button, though both are possible, and
there seems to be plenty of lag in the configuration and the gameplay. In the end though, it does work (and I may have a new SNES emulator, too; ZSNES just freezes when configuring the DS3).
The info on dfinput.cfg is interesting. All of my button mappings (using your names above), have SomeIdentifier = 3, and the InputValue indeed matches the button number given by jstest. Following your input, the first value seems to be the ASCII value for
the key, though I'm not sure how or if that relates to the values > 65,000 (negative values, perhaps?). Does this mean that the plugin works by mapping "button"->"keyboard key"->"emulator function", or does it simply allow for both "button" and "keyboard
key" to map to the same "emulator function"? Is the KeyBoardValue required or even relevant with a joystick/controller attached?
The values for the axes are another matter. They all have a "0, 1, X" triplet, where X is my best guess for the InputValue. This makes sense, since no keyboard keys are mapped to them, and Axis=1. If I understand the code correctly, the X value is
axis-number + 1. I'm guessing that the sign is determined by the growth of the axis' value when the stick is pressed in a given direction; for instance, LeftAnalogXM (left stick, X-axis, Minus/left direction) would be -1 (axis 0 + 1, and pushing
the stick left produces negative values). I have no idea if this is actually correct, but since the configurator seems to look at axis #12 by default, and it rests at -32767, resulting in -13, this would make sense.
I'll play with the numbers some more, and see what I can find. When the controller works, it beats the heck out of using the keyboard.