PS2 joypads

Hi,

This sounds great!

Thanks, I hope it will be more great when finished :slight_smile:

If you would also be so kind as to send me some
technical details on
the
PS2Linux Joysticks (as much as you have would be
great).

It has 10 buttons, 1 d-pad “hat”, 2 analog sticks,
which are
represented
as x,y as in the linux driver etc.

I do have a question, in struct _SDL_Joystick, an
analog stick is
represented as 2 axis it appears. So if my joystick
has 1 stick
naxes=2, and so I believe 2 analog sticks naxes=4.
Is this correct?
Or
is only one analog stick (with 2 axis) the only
analog function
supported.

Something that would be useful would be a purely
stdio SDLJoytest mode.
So I can code/test/debug quicker (currently I use
modified
testjoystick.c for this).

I’m also thinking about the best way of supporting
the extra pressure
sensitive buttons on the DualShock2 controller.

Cheers

JG

Firstly, there isn’t specifically a PS2Linux joystick,
we’re just talking about a normal PlayStation 2
DualShock controller.

The usual linux joystick driver isn’t able to use the
2nd analog stick, something has gone wrong in the
chain, either the driver isn’t looking for a 2nd
stick, or the PS2 hasn’t told it it’s there, ore
something like that.

I believe joypadlib uses ioctl() commands to get
button pressures, the 2nd analog stick, and the R3 and
L3 buttons, which the standard linux driver does not.
If you’re looking for the best way to make use of such
things, then really look at the joypadlib source, it’s
a good read.

It’s that comprehensive that I wondered if it should
make it into SDL code, but then not many control
devices have a 2nd stick, so it doesn’t sound like
writing for 2 sticks is a portable feature, so isn’t
needed in SDL at the moment.

Unless of course you could have your games detect
whether 2 sticks exist, and if the 2nd one doesn’t,
map the mouse onto a second stick…

The standard linux joystick driver also doesn’t allow
for the actuators (Sony’s way of saying vibrator, and
avoiding the double-entendre) I think ioctl()s come to
the resuce again to allow joypadlib to access them.

To summarise, joypablib != (standard linux joystick
driver), but then (PS2 pad) != typical joystick.__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more

Hi,

Paul Smith wrote:

Hi,

This sounds great!

Thanks, I hope it will be more great when finished :slight_smile:

If you would also be so kind as to send me some
technical details on
the
PS2Linux Joysticks (as much as you have would be
great).

It has 10 buttons, 1 d-pad “hat”, 2 analog sticks,
which are
represented
as x,y as in the linux driver etc.

I do have a question, in struct _SDL_Joystick, an
analog stick is
represented as 2 axis it appears. So if my joystick
has 1 stick
naxes=2, and so I believe 2 analog sticks naxes=4.
Is this correct?
Or
is only one analog stick (with 2 axis) the only
analog function
supported.

Something that would be useful would be a purely
stdio SDLJoytest mode.
So I can code/test/debug quicker (currently I use
modified
testjoystick.c for this).

I’m also thinking about the best way of supporting
the extra pressure
sensitive buttons on the DualShock2 controller.

Cheers

JG

Firstly, there isn’t specifically a PS2Linux joystick,
we’re just talking about a normal PlayStation 2
DualShock controller.

Yes I know, you (if it was you who wrote the email I replied to) called
it PS2Linux joystick. I did’nt want to put a dampener on your efforts
so I went along with what you called it. However, actually DualShock2
anyway, because it has presure sensitive buttons. (Which I will also be
adding functionality for!)

The usual linux joystick driver isn’t able to use the
2nd analog stick, something has gone wrong in the
chain, either the driver isn’t looking for a 2nd
stick, or the PS2 hasn’t told it it’s there, ore
something like that.

I believe joypadlib uses ioctl() commands to get
button pressures, the 2nd analog stick, and the R3 and
L3 buttons, which the standard linux driver does not.
If you’re looking for the best way to make use of such
things, then really look at the joypadlib source, it’s
a good read.

Well I have done a lot of it already. joypadlib just uses the same
ps2pad kernel module as the SDL code I have written. There is not much
point in using middleware to call middleware to call kernel functions.
So I implemented it cleanly from scratch based on the API.

It’s that comprehensive that I wondered if it should
make it into SDL code, but then not many control
devices have a 2nd stick, so it doesn’t sound like
writing for 2 sticks is a portable feature, so isn’t
needed in SDL at the moment.

Unless of course you could have your games detect
whether 2 sticks exist, and if the 2nd one doesn’t,
map the mouse onto a second stick…

The standard linux joystick driver also doesn’t allow
for the actuators (Sony’s way of saying vibrator, and
avoiding the double-entendre) I think ioctl()s come to
the resuce again to allow joypadlib to access them.

To summarise, joypablib != (standard linux joystick
driver), but then (PS2 pad) != typical joystick.

I dont think there is a standard pad now, every manufacturer does it
different, and they always will. SDL has a great abstract design, the
joystick stuff is perfect for supporting extra buttons or other features.

I’ve written most of an extra module now, I will submit a patch when
its done.

the ps2pad api is reasonably well thought out and I have the basics working.

Cheers

JG

To summarise, joypablib != (standard linux joystick
driver), but then (PS2 pad) != typical joystick.

actually the PS2 pad is an excellent PC joystick (when adapted with the
kiki joy to USB)…

there has been some talk that we may even support it in some of our PC
games.

In terms of SDL, the PS2 pad is a nice test case having
many buttons sticks/hat pressure sensitive, rumble, all in one.

The price is a little high, but not bad. $12 for adaptor, $25 for
dualshock2… I’d think people would buy it if the game box suggested it.

Does this adapter works under other OSes than Win32 ?

Best Regards,
^IoDream^

Kevin Meinert wrote:>>> To summarise, joypablib != (standard linux joystick

driver), but then (PS2 pad) != typical joystick.

actually the PS2 pad is an excellent PC joystick (when adapted with
the kiki joy to USB)…

there has been some talk that we may even support it in some of our PC
games.

In terms of SDL, the PS2 pad is a nice test case having
many buttons sticks/hat pressure sensitive, rumble, all in one.

The price is a little high, but not bad. $12 for adaptor, $25 for
dualshock2… I’d think people would buy it if the game box
suggested it.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Envie de discuter en “live” avec vos amis ? T?l?charger MSN Messenger
http://www.ifrance.com/_reloc/m la 1?re messagerie instantan?e de France

Not sure… Anyone know?On Wed, 26 Feb 2003, IoDream wrote:

Does this adapter works under other OSes than Win32 ?

Best Regards,
^IoDream^

Kevin Meinert wrote:

To summarise, joypablib != (standard linux joystick
driver), but then (PS2 pad) != typical joystick.

actually the PS2 pad is an excellent PC joystick (when adapted with
the kiki joy to USB)…

there has been some talk that we may even support it in some of our PC
games.

In terms of SDL, the PS2 pad is a nice test case having
many buttons sticks/hat pressure sensitive, rumble, all in one.

The price is a little high, but not bad. $12 for adaptor, $25 for
dualshock2… I’d think people would buy it if the game box
suggested it.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Envie de discuter en “live” avec vos amis ? T?l?charger MSN Messenger
http://www.ifrance.com/_reloc/m la 1?re messagerie instantan?e de France


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I bought one from RadioShack for $15 that works perfectly on OS-9 and on
my WinXP, even thought it said it only worked with Win32 compatible
platforms. No rumble support though of course. I’m sure most other USB
adaptesr you buy will work just fine on the Mac though.

  • Andrew>Not sure… Anyone know?

On Wed, 26 Feb 2003, IoDream wrote:

Does this adapter works under other OSes than Win32 ?

If the adapter provides standard HID compliant output to USB, then it
works in all platforms that can handle standard USB HID devices.On Thursday 27 February 2003 01:26, Andrew1300 at aol.com wrote:

On Wed, 26 Feb 2003, IoDream wrote:

Does this adapter works under other OSes than Win32 ?

Not sure… Anyone know?

I bought one from RadioShack for $15 that works perfectly on OS-9 and
on my WinXP, even thought it said it only worked with Win32
compatible platforms. No rumble support though of course. I’m sure
most other USB adaptesr you buy will work just fine on the Mac
though.

I did notice that it was recognized as a standard joystick without any
driver under XP. So that’s promising. Would probably work under linux
then…

I don’t think I got rumble either… And I haven’t seen presure
sensitivity on the buttons either.

Still a great joypad IMHO.On Wed, 26 Feb 2003 Andrew1300 at aol.com wrote:

I bought one from RadioShack for $15 that works perfectly on OS-9 and on
my WinXP, even thought it said it only worked with Win32 compatible
platforms. No rumble support though of course. I’m sure most other USB
adaptesr you buy will work just fine on the Mac though.

  • Andrew

Not sure… Anyone know?

On Wed, 26 Feb 2003, IoDream wrote:

Does this adapter works under other OSes than Win32 ?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

All of the PS/USB adapters I’ve used have been standard HID joysticks.

I don’t know what the goal of this project is. Handling existing PSX/USB
adapters doesn’t need its own project; they’re standard joysticks, and
will Just Work, as 16-button, 4-axis gamepads. The only special feature
of PS2 pads are the analog buttons, but I don’t think any adapters translate
that at all anyway. (And that’s such a special-purpose feature that I
doubt it’d make its way into SDL proper; I don’t know of any other
gamepads with that feature, and it would never, in practice, be used.)On Wed, Feb 26, 2003 at 06:26:20PM -0500, Andrew1300 at aol.com wrote:

I bought one from RadioShack for $15 that works perfectly on OS-9 and on
my WinXP, even thought it said it only worked with Win32 compatible
platforms. No rumble support though of course. I’m sure most other USB
adaptesr you buy will work just fine on the Mac though.

–
Glenn Maynard