forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PSP controller library

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
skippy911



Joined: 06 May 2005
Posts: 46

PostPosted: Thu May 12, 2005 2:47 am    Post subject: PSP controller library Reply with quote

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
View user's profile Send private message
MrSiir[S]



Joined: 14 Sep 2004
Posts: 32

PostPosted: Thu May 12, 2005 3:09 am    Post subject: Yeah! Reply with quote

Good work!

P.D.: Duck firmware 1.5!!!
Back to top
View user's profile Send private message Send e-mail
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Thu May 12, 2005 3:22 am    Post subject: Reply with quote

duck firmware 1.5 ? edit your post or i will delete it.
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
annerajb



Joined: 31 Mar 2005
Posts: 40

PostPosted: Thu May 12, 2005 4:24 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu May 12, 2005 4:56 am    Post subject: Reply with quote

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
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Thu May 12, 2005 6:44 am    Post subject: Reply with quote

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
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu May 12, 2005 6:52 am    Post subject: Reply with quote

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
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu May 12, 2005 7:15 am    Post subject: Reply with quote

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
View user's profile Send private message
skippy911



Joined: 06 May 2005
Posts: 46

PostPosted: Thu May 12, 2005 7:33 am    Post subject: Reply with quote

Ok it is fixed enjoy!

http://rapidshare.de/files/1706310/controller_working.zip.html
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group