sceImposeGetHomePopup?

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

Moderators: cheriff, TyRaNiD

Post Reply
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

sceImposeGetHomePopup?

Post by sakya »

Hi! :)

I have a question. :)
Is there a way to know if the user is in the "Exit screen"?
I tried sceImposeGetHomePopup but it seems to return always 1.

What's the value returned by sceImposeGetHomePopup?

Many thanks.
Ciaooo
Sakya
headness13
Posts: 2
Joined: Sun Oct 21, 2007 6:11 pm

Post by headness13 »

you can try

SceCtrlData pad;
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_HOME) ...

this way you know if the home button was pushed

but where did you find that function ? (sceImposeGetHomePopup) what sdk are you using ?!
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Post by sakya »

Hi! :)

Thanks for your reply.
I'm using the latest sdk, this function is here:
http://svn.ps2dev.org/filedetails.php?r ... rev=0&sc=0
headness13 wrote:you can try

SceCtrlData pad;
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_HOME) ...
In this way I cannot know when the user exits the screen (choosing "No" or pressing circle).
I need to know if the user is viewing the exit screen to avoid reading the buttons in my app.

Ciaooo
Sakya
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

It's probably not documented right. Given the way other Impose functions work, it more likely

Code: Select all

int sceImposeGetHomePopup(int *value);
where the fn return is the status of the call, and value contains the Home Popup status if the fn return didn't indicate an error.
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Hi, not sure what you want to do but you can maybe do something like this :

Code: Select all

if(sceKernelFindModuleByName("sceLoadExec"))
{
        do();
}
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Post by sakya »

Hi! :)

Many thanks for your help.
What I'm trying to do is stop reading button input in my program while the user is in the exit screen.
Cpasjuste wrote:

Code: Select all

if(sceKernelFindModuleByName("sceLoadExec"))
{
        do();
}
I tried, but the sceLoadExec module seems to be always loaded (also when I'm not viewing the exit screen).
What should I check of this module to know if it is "active"?

EDIT:
I found how this functions work, but they don't help me with my "problem".

Code: Select all

imposeSetHomePopup(0);
Disables the exit screen (pressing Home nothing happens)

Code: Select all

imposeSetHomePopup(1);
Enables the exit screen (pressing Home the exit screen is invoked)

Code: Select all

imposeGetHomePopup();
Returns the current value (0 or 1).

Still I don't know how to know if the user is viewing the exit screen. ;)

Ciaooo
Sakya
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

You could try this :

Load psplink, load an homebrew, a game or anything with the exit callback and look in psplink wich module/thread is loaded when you are in the home screen. Then you could easly write a function to see if this module or thread is loaded.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

in your exit_callback code add a variable to hold the home
state and make that variable static to always retrieve its value
when home is called the callback is called and then this variable
is auto-set by you (use var ^1 to make easier) then this will always
give you an answer but YOU must keep track of status ...

but im sure you already can do this
10011011 00101010 11010111 10001001 10111010
sakya
Posts: 190
Joined: Fri Apr 28, 2006 5:48 pm
Contact:

Post by sakya »

Hi! :)

Many thanks for your help. :)
dot_blank wrote:in your exit_callback code add a variable to hold the home state and make that variable static
I have a static var to check the home status (and correctly exits from loops and close the app).
The exit_callback is called when I choose YES on the exit screen, I wanted to know if the user is just viewing the exit screen.

Ciaooo
Sakya
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

ah ok i see ...so then you will have to do a hybrid form
of using above and using the pad.buttons reading of HOME

or just patch sceKernelSleepThreadCB() when you create home thread
which is more work ...the solution to this is to disasm sceImpose..home
calls which would most likely bring you to disasm of interrupts
10011011 00101010 11010111 10001001 10111010
Post Reply