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_CTRL_HOME

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



Joined: 10 May 2006
Posts: 376

PostPosted: Sun Jan 20, 2008 9:09 am    Post subject: PSP_CTRL_HOME Reply with quote

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



Joined: 03 Jun 2007
Posts: 328

PostPosted: Sun Jan 20, 2008 9:14 am    Post subject: Reply with quote

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



Joined: 20 Jan 2008
Posts: 1

PostPosted: Sun Jan 20, 2008 5:21 pm    Post subject: Reply with quote

This change seems logical to me.
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sun Jan 20, 2008 6:26 pm    Post subject: Reply with quote

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



Joined: 26 Oct 2005
Posts: 567

PostPosted: Sun Jan 20, 2008 6:31 pm    Post subject: Reply with quote

In which mode are you trying? User mode can't normally check for home button.
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Sun Jan 20, 2008 6:55 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Mon Jan 21, 2008 12:18 am    Post subject: Reply with quote

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



Joined: 09 Nov 2005
Posts: 647

PostPosted: Mon Jan 21, 2008 12:44 am    Post subject: Reply with quote

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



Joined: 10 May 2006
Posts: 376

PostPosted: Mon Jan 21, 2008 12:45 am    Post subject: Reply with quote

But I'm talking about usermode, as stated in my first post.
Back to top
View user's profile Send private message
adrahil



Joined: 16 Mar 2006
Posts: 277

PostPosted: Mon Jan 21, 2008 12:46 am    Post subject: Reply with quote

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



Joined: 20 Feb 2004
Posts: 310

PostPosted: Mon Jan 21, 2008 1:13 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Mon Jan 21, 2008 1:20 am    Post subject: Reply with quote

Agreed with adrahil and weltall.

I'll just add a note to the header file about usage in the different modes.
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