| View previous topic :: View next topic |
| Author |
Message |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sun Jan 20, 2008 9:09 am Post subject: PSP_CTRL_HOME |
|
|
After a bit of experimentation I think the name of PSP_CTRL_HOME is innacurate.
It seems that it doesn't actually read the HOME button being pressed, but instead is a flag for when the HOME exit screen popup is being shown.
To prove this I created a test program with no exit callback setup. No home button presses were detected.
I then did exactly the same but with an exit callback, the flag for PSP_CTRL_HOME was set on every read of the pad data when the popup was active, not just on the initial press.
It seems that when the HOME exit callback is active, the PSP_CTRL_HOME bitmask is set on every peek/read.
I believe Sony did this so you could effectively disable reading buttons while the popup is active, using this style of polling:
| Code: | sceCtrlPeekBufferPositive(&pad, 1);
if((pad.Buttons & PSP_CTRL_HOME) == 0)
{
// Popup not active
if(pad.Buttons & PSP_CTRL_CROSS)
{
// Handle true button presses etc.
}
} |
I suggest that the define be renamed to something more suitable, such as PSP_CTRL_HOME_POPUP, but wanted to get community input first.
All of this relates to usermode.
Last edited by Insert_witty_name on Sun Jan 20, 2008 9:20 am; edited 1 time in total |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sun Jan 20, 2008 9:14 am Post subject: |
|
|
Nice find.
The Change would be fine for me. _________________ Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming. |
|
| Back to top |
|
 |
Ryalla
Joined: 20 Jan 2008 Posts: 1
|
Posted: Sun Jan 20, 2008 5:21 pm Post subject: |
|
|
| This change seems logical to me. |
|
| Back to top |
|
 |
TyRaNiD
Joined: 18 Jan 2004 Posts: 918
|
Posted: Sun Jan 20, 2008 6:26 pm Post subject: |
|
|
| Well it will actually reflect the value of the home button in certain operating modes and certain situations, I think it is only user mode where it is set. Of course in user mode when the home screen appears it disables all the other buttons anyway :P |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sun Jan 20, 2008 6:31 pm Post subject: |
|
|
| In which mode are you trying? User mode can't normally check for home button. |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Sun Jan 20, 2008 6:55 pm Post subject: |
|
|
yeah i disagree home button even on 3.80m33 is reported correctly even when no home screen is shown in kernel mode. so it shouldn't be changed.
if that behaviour happens only in user mode the maximum would be adding a define just for it so it doesn't mess with kernel applications using it |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Mon Jan 21, 2008 12:18 am Post subject: |
|
|
| TyRaNiD wrote: | | Well it will actually reflect the value of the home button in certain operating modes and certain situations, I think it is only user mode where it is set. Of course in user mode when the home screen appears it disables all the other buttons anyway :P |
Yes the first part is true. It doesn't always disable the button presses being read by the underlying program however.
| moonlight wrote: | | In which mode are you trying? User mode can't normally check for home button. |
This is in user mode. The point being that the bitmask for PSP_CTRL_HOME isn't to check for the home button being pressed, but instead is a flag that the exit popup is visible (the bitmask is set whenever the exit popup is visible, not just on the initial press of the home button). |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Mon Jan 21, 2008 12:44 am Post subject: |
|
|
In kernel mode you can remove the exit callback and use the HOME button
like any other button, and the popup never appears. _________________ If not actually, then potentially. |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Mon Jan 21, 2008 12:45 am Post subject: |
|
|
| But I'm talking about usermode, as stated in my first post. |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Mon Jan 21, 2008 12:46 am Post subject: |
|
|
| Yeah, I think we should just add to the documentation that in usermode it returns the state of the Home Popup instead... In kernel mode it really shows the home button presses anyway ;) |
|
| Back to top |
|
 |
weltall
Joined: 20 Feb 2004 Posts: 310
|
Posted: Mon Jan 21, 2008 1:13 am Post subject: |
|
|
| as i said there isn't only user mode so you can't just go and change it like that... imho at least |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Mon Jan 21, 2008 1:20 am Post subject: |
|
|
Agreed with adrahil and weltall.
I'll just add a note to the header file about usage in the different modes. |
|
| Back to top |
|
 |
|