Ps2SDK mouse driver issue ?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
Shazz
Posts: 244
Joined: Tue Aug 31, 2004 11:42 pm
Location: Somewhere over the rainbow
Contact:

Ps2SDK mouse driver issue ?

Post 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 ?
- TiTAN Art Division -
http://www.titandemo.org
User avatar
Shazz
Posts: 244
Joined: Tue Aug 31, 2004 11:42 pm
Location: Somewhere over the rainbow
Contact:

Post 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
- TiTAN Art Division -
http://www.titandemo.org
moofasa
Posts: 7
Joined: Fri Feb 18, 2005 5:26 pm
Location: S.Korea

PS2MouseEnum() returns 0.

Post 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?
Sorry, for my poor English.~
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post by rinco »

do you have PS2MOUSE?

most people have PS2MOUSE.IRX.
moofasa
Posts: 7
Joined: Fri Feb 18, 2005 5:26 pm
Location: S.Korea

Post 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~?
Sorry, for my poor English.~
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post 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?
moofasa
Posts: 7
Joined: Fri Feb 18, 2005 5:26 pm
Location: S.Korea

Post 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?
Sorry, for my poor English.~
rinco
Posts: 255
Joined: Fri Jan 21, 2005 2:12 pm
Location: Canberra, Australia

Post 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.
moofasa
Posts: 7
Joined: Fri Feb 18, 2005 5:26 pm
Location: S.Korea

Post by moofasa »

Thank you very much, rinco.
got an idea from your hint.

(getting a working usbd.irx and bin2s-ing... and so on)
Sorry, for my poor English.~
Post Reply