PSP_CTRL_HOME

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

Moderators: cheriff, TyRaNiD

Post Reply
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

PSP_CTRL_HOME

Post by Insert_witty_name »

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

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.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

Nice find.
The Change would be fine for me.
Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming.
Ryalla
Posts: 1
Joined: Sun Jan 20, 2008 5:20 pm

Post by Ryalla »

This change seems logical to me.
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

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
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

In which mode are you trying? User mode can't normally check for home button.
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

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
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

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).
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

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.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

But I'm talking about usermode, as stated in my first post.
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

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 ;)
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

as i said there isn't only user mode so you can't just go and change it like that... imho at least
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Agreed with adrahil and weltall.

I'll just add a note to the header file about usage in the different modes.
Post Reply