PSP controller library

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
skippy911
Posts: 46
Joined: Fri May 06, 2005 10:20 am

PSP controller library

Post by skippy911 »

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
MrSiir[S]
Posts: 32
Joined: Tue Sep 14, 2004 11:08 am

Yeah!

Post by MrSiir[S] »

Good work!

P.D.: Duck firmware 1.5!!!
blackdroid
Posts: 564
Joined: Sat Jan 17, 2004 10:22 am
Location: Sweden
Contact:

Post by blackdroid »

duck firmware 1.5 ? edit your post or i will delete it.
Kung VU
annerajb
Posts: 40
Joined: Thu Mar 31, 2005 6:16 am

Post by annerajb »

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
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

maybe try taking out the init function & set analog stick for the time being. I don't think thoes are correct functions.
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. :(
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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: Select all

	

	CtrlInit(0);
	CtrlSetAnalogMode(1);

	for(;;)
	{
		CtrlRead(&pad_data, 1);
		if(pad_data.buttons & CTRL_TRIANGLE)
		{
			_puts("Hello!");
			update_screen();
		}
   }
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

Code: Select all

	

	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.
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

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.
skippy911
Posts: 46
Joined: Fri May 06, 2005 10:20 am

Post by skippy911 »

Post Reply