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
PSP controller library
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact:
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)
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: Select all
CtrlInit(0);
CtrlSetAnalogMode(1);
for(;;)
{
CtrlRead(&pad_data, 1);
if(pad_data.buttons & CTRL_TRIANGLE)
{
_puts("Hello!");
update_screen();
}
}
Code: Select all
for(;;)
{
CtrlRead(&pad_data, 1);
if(pad_data.buttons & CTRL_TRIANGLE)
{
_puts("Hello!");
update_screen();
}
}
Kept testing but going to retry for analog.