Invoke Exit game screen?

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

Moderators: cheriff, TyRaNiD

Post Reply
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Invoke Exit game screen?

Post by Art »

Hi Guys,
I'm hoping it is possible to invoke the exit game screen to appear without
pressing the HOME button, and then also get rid of it at run time without
pressing the HOME button.
Do you want to quit the game?

Yes No

X Enter O Back
Reason?
To then take a snapshot of the horizontal line on that screen that always
shows the current volume level and count the bright pixels to determin the current
volume level which we cannot do yet.
Cheers, Art.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

hahaha ...i must do only but laugh ...so it has
come down to this huh 8) ...well good luck with
that image processing

as for the way to call HOME screen ...simple just
patch callback for the update_thread ...and somewhere
in your menu system or controll input loops add a call to
wake up the callback thread
10011011 00101010 11010111 10001001 10111010
Test30
Posts: 7
Joined: Thu Aug 02, 2007 6:39 am
Contact:

Post by Test30 »

you say exit of a aplicacion without press Home?

if is that you use this code:

Code: Select all

sceKernelExitGame();
if no is that

sorry is what no understand very good the english :(
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

No I already know how to exit an application.

@ dot_blank,
Yes it's come to this unfortunately :D

What about making the screen dissapear though?
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

simple in your thread you just clear the entire screen
with a fill color simply like BLACK but still you have to
patch around the font calls which would still show text

either way ...VERY POINTLESS way to go about this :P
10011011 00101010 11010111 10001001 10111010
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Lol, I know how to clear a screen :D

I mean how to get rid of the exit screen once it is there (without using the HOME button).

It's not pointless.
You only need find out the current volume once (at startup) in an application,
and you can track it from there on by watching button pushes.
There is currently no other way to get current volume unless you force it to
a known value first (annoying the user).

I want to use it so an ALARM is LOUD LIKE THIS!!!!!
and then go back to the user's normal volume which might be very quiet shhhh.

From what I read here there's no other way to do it.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Oh, you mean paint over the exit screen?
instead of getting rid of it?
PSPJunkie
Posts: 14
Joined: Tue Jan 23, 2007 12:55 pm
Location: Jersey
Contact:

Post by PSPJunkie »

Well, when you start the exit callback's thread, assuming the callbacks from the psp-programming tutorials, it just sleeps. Now, when the home button is pressed, the thread by the name of "Exit Callback" is 'woken up', and you see the dialog. So... what you could do is...

Code: Select all

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
          sceKernelExitGame();
          return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
          int cbid;

          cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
          sceKernelRegisterExitCallback(cbid);

          sceKernelSleepThreadCB();

          return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
          int thid = 0;

          thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
          if(thid >= 0) {
                    sceKernelStartThread(thid, 0, 0);
          }

          return thid;
}

...

int callbackThreadId = SetupCallbacks();
...

// Menu pressed exit...
sceKernelWakeupThread(callbackThreadId);
Then if, the user presses the option to exit, the screen pops up. If the user presses 'Yes', exit_callback() is called, and you exit. Otherwise, the user presses 'No' and it should sleep the thread again. :)

Note: This is based off of assumptions, so if it doesn't work, don't blame me. :P

Edit: Fixed something that I wrote down wrong :/
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

I got that part, if that's correct, with experimentation
I should be able to put it to sleep again, and remove the screen at runtime.

It might be an odd way to do it, but I'll bet it can be reliable and invisible.
Even those that have changed the volume bar graphics see the normal
volume bars on that sceen.
Tinnus
Posts: 67
Joined: Sat Jul 29, 2006 1:12 am

Post by Tinnus »

Even then, the center pixels of each bar (or whatever new graphic it is) should still be different from the BG color, unless the user is very very annoying and paints the bars with that very same color :)
Let's see what the PSP reserves... well, I'd say anything is better than Palm OS.
kururin
Posts: 36
Joined: Wed Jul 05, 2006 7:19 am

Post by kururin »

Why don't you try the impose api? All home things is related to that module.
http://silverspring.lan.st/3.50/kd/impose.html

Of course they are all undocumented, but you can try to reverse its use.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

sceImpose for usermode
void sceImposeHomeButton(int unk); // set to 1

sceImpose_driver for kmode
void sceImposeHomeButton(int unk); // set to 1
10011011 00101010 11010111 10001001 10111010
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Ok, thanks, then it's just a matter of pressing it twice and having
the LCD backlight turned off in between :)
SilverSpring
Posts: 110
Joined: Tue Feb 27, 2007 9:43 pm
Contact:

Post by SilverSpring »

hope this helps a bit:

0x0f341be4 sceImposeGetHomePopup
0x5595a71a sceImposeSetHomePopup

int sceImposeGetHomePopup(void);
int sceImposeSetHomePopup(int mode); // 1-enable, 0-disable
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

SilverSpring wrote:hope this helps a bit:

0x0f341be4 sceImposeGetHomePopup
0x5595a71a sceImposeSetHomePopup

int sceImposeGetHomePopup(void);
int sceImposeSetHomePopup(int mode); // 1-enable, 0-disable
i've always wondered, why the params are not included in the libpspdoc project.
SilverSpring
Posts: 110
Joined: Tue Feb 27, 2007 9:43 pm
Contact:

Post by SilverSpring »

Simple reason? They are not known (yet....).

But mainly because the project is to provide the function name, the actual prototype can then be done by whoever wants to use that particular function.

Some of the prototypes are known (the ones that people have bothered to look into and were nice enough to publish). But generally if you want the prototype you will have to look into it yourself (if someone else hasnt already done it that is).
Last edited by SilverSpring on Sat Aug 25, 2007 3:25 pm, edited 1 time in total.
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Thanks for the help Guys.
I didn't think there would be a way as direct as that.
Haven't tried it yet (still plugging away at another project).
Cheers, Art.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

ahh so the unknowns must be for disable enable :) ok cool thanx
10011011 00101010 11010111 10001001 10111010
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

WOW, now THAT's a neolithic way of doing things :) There is an easy way, by querying the Impose params...
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

revisiting this idea today, I realised it's even harder...
The Exit screen only shows a low resolution volume.

Volume can be 0 to 100, but there are only about ten bars.
Still possible, but this is going on the backburner for me until I'm really bored.
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

now do you see the lack of interest in doing this image
processing ? :P

try using this psuedoness for those ten values
int imp_vol = sceImposeGetParam(psp_imp_main_volume);
switch(imp_vol) {
case VOL_MUTE:
case VOL_ONE:
case VOL_TWO:
case VOL_THREE:
case VOL_FOUR:
........ etc ........
case VOL_MAX:
// do your madness
default:
// error
}
10011011 00101010 11010111 10001001 10111010
Post Reply