| View previous topic :: View next topic |
| Author |
Message |
skippy911
Joined: 06 May 2005 Posts: 46
|
Posted: Thu May 12, 2005 2:47 am Post subject: PSP controller library |
|
|
I have seen programs which use the controller on the psp but none of them were in an easy to use library so I made my own. Just need to include controller.h in your project and you should be good to go. An example program is included but alas it hangs on my psp :( I know I am missing something simple but I cant find it right now. When I do ill put up a new test program. The library should work fine though. Enjoy:
http://rapidshare.de/files/1701049/controller.zip.html
skippy911 |
|
| Back to top |
|
 |
MrSiir[S]
Joined: 14 Sep 2004 Posts: 32
|
Posted: Thu May 12, 2005 3:09 am Post subject: Yeah! |
|
|
Good work!
P.D.: Duck firmware 1.5!!! |
|
| Back to top |
|
 |
blackdroid
Joined: 17 Jan 2004 Posts: 564 Location: Sweden
|
Posted: Thu May 12, 2005 3:22 am Post subject: |
|
|
duck firmware 1.5 ? edit your post or i will delete it. _________________ Kung VU |
|
| Back to top |
|
 |
annerajb
Joined: 31 Mar 2005 Posts: 40
|
Posted: Thu May 12, 2005 4:24 am Post subject: |
|
|
does the program runs or it hangs when you click one key in specific
or a combination or a guantity of keys. plz take notes of this thing and you may be able to fix it. oh btw what hangs the library or the program that you made with it |
|
| Back to top |
|
 |
subbie
Joined: 05 May 2005 Posts: 122
|
Posted: Thu May 12, 2005 4:56 am Post subject: |
|
|
maybe try taking out the init function & set analog stick for the time being. I don't think thoes are correct functions.
| Quote: | sceCtrlInit(0);
sceCtrlSetAnalogMode(0); |
I have been able to do input with only calling to retrieve the current status.
"sceCtrlRead"
Still can't seem to get analog to work. :( |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Thu May 12, 2005 6:44 am Post subject: |
|
|
Yah well I know CtrlInit is the wrong name for it :P It is something like sceSetSamplingCycle. Everything which I have seen just calls it with 0.
To get analogue to work you _must_ call CtrlSetAnalogMode with 1 as the parameter, then the stick should work, trust me :)
And this code works fine for me (with analog mode)
| Code: |
CtrlInit(0);
CtrlSetAnalogMode(1);
for(;;)
{
CtrlRead(&pad_data, 1);
if(pad_data.buttons & CTRL_TRIANGLE)
{
_puts("Hello!");
update_screen();
}
}
|
|
|
| Back to top |
|
 |
subbie
Joined: 05 May 2005 Posts: 122
|
Posted: Thu May 12, 2005 6:52 am Post subject: |
|
|
| Code: |
for(;;)
{
CtrlRead(&pad_data, 1);
if(pad_data.buttons & CTRL_TRIANGLE)
{
_puts("Hello!");
update_screen();
}
}
|
Just that works for me. :)
Kept testing but going to retry for analog. |
|
| Back to top |
|
 |
subbie
Joined: 05 May 2005 Posts: 122
|
Posted: Thu May 12, 2005 7:15 am Post subject: |
|
|
CtrlSetAnalogMode(1);
give me no help. I have an image that is displayed x,y of the value given by the analog. I still get nothing (i think it's sitting at the max (255,255).
I think something is missing still. Going to research tonight. |
|
| Back to top |
|
 |
skippy911
Joined: 06 May 2005 Posts: 46
|
|
| Back to top |
|
 |
|