PSP Control + / -

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

Moderators: cheriff, TyRaNiD

Post Reply
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

PSP Control + / -

Post by LuMo »

there is a list of accessable buttons in the sdk
  • PSP_CTRL_SELECT Select button.
    PSP_CTRL_START Start button.
    PSP_CTRL_UP Up D-Pad button.
    PSP_CTRL_RIGHT Right D-Pad button.
    PSP_CTRL_DOWN Down D-Pad button.
    PSP_CTRL_LEFT Left D-Pad button.
    PSP_CTRL_LTRIGGER Left trigger.
    PSP_CTRL_RTRIGGER Right trigger.
    PSP_CTRL_TRIANGLE Triangle button.
    PSP_CTRL_CIRCLE Circle button.
    PSP_CTRL_CROSS Cross button.
    PSP_CTRL_SQUARE Square button.
    PSP_CTRL_HOME Home button.
    PSP_CTRL_HOLD Hold button.
    PSP_CTRL_NOTE Music Note button.
what i miss is the little + and - button near the hold button.
are they not accessable?
(would like to map zoom on it as the signs on psp would perfectly fit ;) )

greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
sg57
Posts: 144
Joined: Fri Oct 14, 2005 2:26 pm

Post by sg57 »

I too want to know all of the Control types. Especially the dimmer buttonb(backlight). Ask the creator of PSPShot i think it was, he had the +/- sign save smaller or larger images
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

well the list above are all the defined buttons from the sdk.

[src » ctrl » pspctrl.h]
so its trying which is which...
i added some lines of code for testing, but had not time to test it now...

Code: Select all

PSP_CTRL_SELECT     = 0x000001; //     = 0000 0000 0000 0000 0000 0001
PSP_CTRL_START     = 0x000008; //     = 0000 0000 0000 0000 0000 1000
PSP_CTRL_UP       = 0x000010; //     = 0000 0000 0000 0000 0001 0000
PSP_CTRL_RIGHT      = 0x000020; //     = 0000 0000 0000 0000 0010 0000
PSP_CTRL_DOWN     = 0x000040; //     = 0000 0000 0000 0000 0100 0000
PSP_CTRL_LEFT     = 0x000080; //     = 0000 0000 0000 0000 1000 0000
PSP_CTRL_LTRIGGER   = 0x000100; //     = 0000 0000 0000 0001 0000 0000
PSP_CTRL_RTRIGGER   = 0x000200; //     = 0000 0000 0000 0010 0000 0000
PSP_CTRL_TRIANGLE   = 0x001000; //     = 0000 0000 0001 0000 0000 0000
PSP_CTRL_CIRCLE     = 0x002000; //     = 0000 0000 0010 0000 0000 0000
PSP_CTRL_CROSS      = 0x004000; //     = 0000 0000 0100 0000 0000 0000
PSP_CTRL_SQUARE     = 0x008000; //     = 0000 0000 1000 0000 0000 0000
PSP_CTRL_HOME     = 0x010000; //     = 0000 0001 0000 0000 0000 0000
PSP_CTRL_HOLD     = 0x020000; //     = 0000 0010 0000 0000 0000 0000
PSP_CTRL_NOTE     = 0x800000; //     = 1000 0000 0000 0000 0000 0000

//UNASSIGNED VALUES:									 
PSP_CTRL_UNASSIGNED1     = 0x400000; //     = 0100 0000 0000 0000 0000 0000
PSP_CTRL_UNASSIGNED2     = 0x200000; //     = 0010 0000 0000 0000 0000 0000
PSP_CTRL_UNASSIGNED3     = 0x100000; //     = 0001 0000 0000 0000 0000 0000
PSP_CTRL_UNASSIGNED4     = 0x080000; //     = 0000 1000 0000 0000 0000 0000
PSP_CTRL_UNASSIGNED5     = 0x040000; //     = 0000 0100 0000 0000 0000 0000
PSP_CTRL_UNASSIGNED6     = 0x000800; //     = 0000 0000 0000 1000 0000 0000
PSP_CTRL_UNASSIGNED7     = 0x000400; //     = 0000 0000 0000 0100 0000 0000
PSP_CTRL_UNASSIGNED8     = 0x000004; //     = 0000 0000 0000 0000 0000 0100
PSP_CTRL_UNASSIGNED9     = 0x000002; //     = 0000 0000 0000 0000 0000 0010
now add to controls:

Code: Select all

SceCtrlData pad;
if( pad.Buttons & PSP_CTRL_UNASSIGNED1 )
...
if you got time please test it. (you have to mod the .h file or define the values for PSP_CTRL_UNASSIGNEDX in your src.)
let me know if you find something out about the missing buttons ;)

greets
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
sg57
Posts: 144
Joined: Fri Oct 14, 2005 2:26 pm

Post by sg57 »

SO your saying that there are unassigned values in the .c of pspctrl? I will be sure to try them as I really want to find them all out......

Tell me if you find anything?
AnonymousTipster
Posts: 197
Joined: Fri Jul 01, 2005 2:50 am

Post by AnonymousTipster »

Those unassigned values do not seem to do anything for me, however I am running in user-mode, and some buttons (e.g Note) can only be accessed from within kernel mode. Some of those unassigned values might be for the PSP Remote if it's attatched.

Just guessing, but those unassigned buttons might be
Remote: Next, Previous, play, vol up, vol down, hold
Console: +,-,hold
Which totals 9 buttons.
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

Code: Select all

#define		PSP_CTRL_WLAN_UP	0x00040000	/* active on HOLD */
#define		PSP_CTRL_REMOTE		0x00080000	/* active on HOLD */

#define		PSP_CTRL_VOLUP		0x00100000	
#define		PSP_CTRL_VOLDOWN	0x00200000	
#define		PSP_CTRL_SCREEN		0x00400000	
#define		PSP_CTRL_DISC		0x01000000	
... and you need to be in kernel mode to use those, there is no way to handle them in usermode. the buttons on the remote itself are handled differently and dont appear in the buttons bitfield at all.
sg57
Posts: 144
Joined: Fri Oct 14, 2005 2:26 pm

Post by sg57 »

Uh huh, whats the active on HOLD junk? Does that mean if the power switch is held down to hold, itll be active? And for if the WLAN is down, then itd 'not' be the one speciied, or is when active, then itll work?
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

uhm good question....i forgot :=D shouldnt be hard to figure out though :=P
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

thanks for your replies

lumo
PS: so my guessing was good :D
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

thanx ;)
10011011 00101010 11010111 10001001 10111010
Zettablade
Posts: 71
Joined: Fri May 05, 2006 5:59 pm

Turning off the screen

Post by Zettablade »

What's the code snippet for turning off the screen?
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

i guess you mean the screen button...
as mentioned above...

Code: Select all

#define      PSP_CTRL_SCREEN      0x00400000  
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
sg57
Posts: 144
Joined: Fri Oct 14, 2005 2:26 pm

Post by sg57 »

I think he means how could you have a button press the screen on/off button...

To do your 'hold' thing, do

Code: Select all

SceCtrlData test;
if ( test.Buttons & PSP_CTRL_HOLD ) {
         test.Buttons & PSP_CTRL_SCREEN;
}
Think that could work? Have 1 button be using another? Then if its in Hold, after like 2 seconds, itll go all black
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

sg57 wrote:I think he means how could you have a button press the screen on/off button...

To do your 'hold' thing, do

Code: Select all

SceCtrlData test;
if ( test.Buttons & PSP_CTRL_HOLD ) {
         test.Buttons & PSP_CTRL_SCREEN;
}
Think that could work? Have 1 button be using another? Then if its in Hold, after like 2 seconds, itll go all black
Despite your code won't even compile, even if it would, it would do nothing. And even if you corrected it to actually set the Bitmask for the screen button as you wanted to do, then it wouldn't make the PSP think this button is pressed, because the bitmask is just a return value. You could even set it to 2^32-1 and it wouldn't even make the PSP moan.
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

you can make the psp moan? demo please! :)
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

I have nasty gaming fingers ;)
soopergooman
Posts: 3
Joined: Sat Jul 02, 2005 4:13 am
Location: St. John's, Newfoundland, Canada. All tha way east BABY!!!

Post by soopergooman »

even though i dont code, i think you should try to get ahold of Andy Fung, wasn't he the first person to utilize the remote dongle functions in a psp app? I think he was. Anyways just trying to help.
worrying is like a rocking chair; it gives you something to do but gets you nowhere!~Me
User avatar
daurnimator
Posts: 38
Joined: Sun Dec 11, 2005 8:36 pm
Location: melbourne, australia

Post by daurnimator »

McZonk used them in Quake2.
He is often on freenode, go ask him...
egorive
Posts: 24
Joined: Thu Jun 22, 2006 11:50 pm

Post by egorive »

And what about the headphones remote control buttons how do they works?. I've try something by including psphprm.h and trying to use some functions like sceHprmIsHeadphoneExist() but nothing. Is there someone who knows a source code that explains how to use them?. Thanks.
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

Easy, use SDL and the remote control buttons show up as keyboard input (see SDL/README.PSP). Or just use sceHprmPeekCurrentKey.
Post Reply