SDL digest, Vol 1 #689 - 42 msgs

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

Please accept my apologies, I think somewhere along
the line I read ‘standard p2spad API’ as ‘standard
joystick driver’ and hadn’t realised you’d done so
much work. It’s hard work reading all of this list!

If you’re running SDL on the PS2, can you tell me if
you have problems with video when running straight
from the command line? IF I try
PAL nointerlace 32bpp 640 240
the screen comes out wrongly, but
PAL nointerlace 32bpp 640 256
seems to come out fine for some reason. I’ve given up
trying to get round it, and am forcing my PS2 to
640x256 before I load my SDL game. Would be nice to
fix though :slight_smile:

Certainly being able to incorporate the 2nd stick and
extra buttons using the SDL API I’m now getting used
to would be really good, I hope your code makes it
into SDL in some way, shape or form.

Paul__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more

Hi Paul,

Please accept my apologies, I think somewhere along
the line I read ‘standard p2spad API’ as ‘standard
joystick driver’ and hadn’t realised you’d done so
much work. It’s hard work reading all of this list!

ok.

If you’re running SDL on the PS2, can you tell me if
you have problems with video when running straight
from the command line? IF I try
PAL nointerlace 32bpp 640 240
the screen comes out wrongly, but
PAL nointerlace 32bpp 640 256
seems to come out fine for some reason. I’ve given up
trying to get round it, and am forcing my PS2 to
640x256 before I load my SDL game. Would be nice to
fix though :slight_smile:

My previous email to you on the list answers this.> ----- Original Message -----

Subject: Re: [SDL] PS2Linux framebuffer console dslpay.
Date: Tue, 11 Feb 2003 15:54:19 +0000
From: @J_Grant1 (J. Grant)
Reply-To: sdl at libsdl.org
To: sdl at libsdl.org
References: <20030211142636.671.qmail at web10901.mail.yahoo.com>

Hi Paul

I also saw these issues while porting Spheres of Chaos
(http://www.chaotica.u-net.com/page/dnld_ps2.htm)

becomes

±----+±----+

  • ++   TI+
    

+TLE ++ +

  • ++     +
    
  • ++     +
    

±----+±----+

So, to try to fix this, I adjusted the screen
resolution height to 640x250, or 640x256. I can’t
remember the figures off hand, but some heights caused
bizzare patterns of display, whilst some came out with
pictures contiguously correct, but not centered.

I think this is because NTSC and VESA modes are 4\3 pixel ratio, PAL is
5\4 sizewise (in implementation 4\3 though still I think… but not
square pixels I believe…)

On consoles we use 320x256 and 640x512 for PAL resolutions, respectivly
equal to 320z240 and 640x480 (NTSC) to make use of the extra vertical
resolution available in PAL.

Any ideas where SDL is going wrong, and how it can be
fixed? I’m happy for now forcing my display to
640x256 non-interlaced, but obviously this would not
be a good display mode for an x86 box, and I would
like to keep some cross-platformness in my game!

On PS2Linux the setcrtmode command can change the TV/VESA format output:

vesa0[,{60|75}] same as 'VESA 640x480 [60Hz|75Hz]'
vesa1[,{60|75}] 'VESA 800x600 [60Hz|75Hz]'
vesa2[,{60|75}] 'VESA 1024x768 [60Hz|75Hz]'
vesa3[,{60|75}] ‘VESA 1280x1024 [60Hz|75Hz]’

ntsc0 'NTSC nointerlace’
ntsc1 'NTSC interlace’
pal0 'PAL nointerlace’
pal1 'PAL interlace

Of these I saw the same effect as you only with pal0, This is I
suspect because 640x480 fits into a pal1 640x512 resolution display fine.

PS According to another user on the PS2Linux site,
this also happens in NTSC mode. I don’t yet know
about VESA mode (Yes, you can plug the PS2 into some
monitors :slight_smile:

In my case ntsc0 and ntsc1 output worked fine, chaos was compiled to use
640x480, perhaps SDL changed the resolution of the TV from ntsc0 to ntsc1?

After buying a PS2 VESA adapter that outputs to standard non-SoG RGB I
have it working with a monitor as well now. (hk-success.com)

Cheers

JG

Certainly being able to incorporate the 2nd stick and
extra buttons using the SDL API I’m now getting used
to would be really good, I hope your code makes it
into SDL in some way, shape or form.

I do too.

Cheers

JG