Page 1 of 1

Ps2SDK mouse driver issue ?

Posted: Tue Feb 22, 2005 6:40 pm
by Shazz
Hello,

I've got a strange behavior using the mouse driver and even looking at the code I don't know really why...

So let me explain...

After you have loaded a decent USBD.IRX and then the PS2MOUSE.IRX drivers, you call :

Code: Select all

if&#40;PS2MouseInit&#40;&#41; < 0&#41; &#123;...
to check is the mouse is well initialized...

My issue is :
- If a mouse is connected, works fine, returns 0
- If NO mouse attached to the ps2... it returns 0 !!!!! (and not -1)

Same behavior with PS2ReadMouse.... (strange isn't it)

Any idea ?

Posted: Fri Feb 25, 2005 6:16 pm
by Shazz
Ok solved by Pixel....

:D

For those you are interested, the init() only check the IOP RPC communication, not the connection of any mouse (as the keyboard driver does), you have to check the number of mouse connected using PS2MouseEnum()

Sinple but when you don't know... :D

PS2MouseEnum() returns 0.

Posted: Sun May 15, 2005 3:22 pm
by moofasa
Hello.

I've tried mouse to be working.
but the PS2MouseEnum() returns always 0.

simplified code is like below:

Code: Select all

//Load 2 Modules
SifLoadModule&#40; "host&#58;USBD.IRX", 0, NULL &#41;;
SifLoadModule&#40;"host&#58;PS2MOUSE", 0, NULL &#41;;

//Init PS2Mouse
PS2MouseInit&#40;&#41;;
PS2MouseEnum&#40;&#41;;
With that code and my usb mouse( Logitech mx510, Dual Optical ),
LoadModule and MouseInit return values bigger than 0.
but, PS2MouseEnum just returns 0.

Am i doing something wrong?

Posted: Sun May 15, 2005 3:47 pm
by rinco
do you have PS2MOUSE?

most people have PS2MOUSE.IRX.

Posted: Sun May 15, 2005 4:50 pm
by moofasa
Oh. I mistyped.

of course I loaded "host:PS2MOUSE.IRX"
and it returns acceptable id, not -203.

hmm.. should I try with another mouse~?

Posted: Sun May 15, 2005 5:26 pm
by rinco
I'm not sure what PS2MouseEnum does.

But according to libmouse.c it returns -1 on failure.

So what is wrong with it returning 0? What are you trying to achieve?

Posted: Sun May 15, 2005 6:02 pm
by moofasa
What I want to get is the current status of mouse( position, buttons, ...)
but PS2ReadMouse fills the structure with 0 value.

so I doubt if the mouse is initialized corretly, and did that kind of check.

ps. as Shazz wrote before, PS2MouseEnum seems to return the number of connected mouse.
If a mouse is connected, then It should normally return 0?

Posted: Sun May 15, 2005 7:53 pm
by rinco
If you are using usbd.irx from ps2sdk, you may see something like this:

Currently WIP. Do not USE!!!!!!!!!!!!!!!!

You may wish to try usbd.irx from a ps2 game.

Posted: Mon May 16, 2005 10:30 am
by moofasa
Thank you very much, rinco.
got an idea from your hint.

(getting a working usbd.irx and bin2s-ing... and so on)