| View previous topic :: View next topic |
| Author |
Message |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Tue Feb 22, 2005 6:40 pm Post subject: Ps2SDK mouse driver issue ? |
|
|
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: | | if(PS2MouseInit() < 0) {... |
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 |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Fri Feb 25, 2005 6:16 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
moofasa
Joined: 18 Feb 2005 Posts: 7 Location: S.Korea
|
Posted: Sun May 15, 2005 3:22 pm Post subject: PS2MouseEnum() returns 0. |
|
|
Hello.
I've tried mouse to be working.
but the PS2MouseEnum() returns always 0.
simplified code is like below:
| Code: | //Load 2 Modules
SifLoadModule( "host:USBD.IRX", 0, NULL );
SifLoadModule("host:PS2MOUSE", 0, NULL );
//Init PS2Mouse
PS2MouseInit();
PS2MouseEnum(); |
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.~ |
|
| Back to top |
|
 |
rinco
Joined: 21 Jan 2005 Posts: 255 Location: Canberra, Australia
|
Posted: Sun May 15, 2005 3:47 pm Post subject: |
|
|
do you have PS2MOUSE?
most people have PS2MOUSE.IRX. |
|
| Back to top |
|
 |
moofasa
Joined: 18 Feb 2005 Posts: 7 Location: S.Korea
|
Posted: Sun May 15, 2005 4:50 pm Post subject: |
|
|
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.~ |
|
| Back to top |
|
 |
rinco
Joined: 21 Jan 2005 Posts: 255 Location: Canberra, Australia
|
Posted: Sun May 15, 2005 5:26 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
moofasa
Joined: 18 Feb 2005 Posts: 7 Location: S.Korea
|
Posted: Sun May 15, 2005 6:02 pm Post subject: |
|
|
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.~ |
|
| Back to top |
|
 |
rinco
Joined: 21 Jan 2005 Posts: 255 Location: Canberra, Australia
|
Posted: Sun May 15, 2005 7:53 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
moofasa
Joined: 18 Feb 2005 Posts: 7 Location: S.Korea
|
Posted: Mon May 16, 2005 10:30 am Post subject: |
|
|
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.~ |
|
| Back to top |
|
 |
|