| View previous topic :: View next topic |
| Author |
Message |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Tue Aug 21, 2007 1:17 am Post subject: Invoke Exit game screen? |
|
|
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.
| Quote: |
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. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Tue Aug 21, 2007 3:22 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Test30
Joined: 02 Aug 2007 Posts: 7
|
Posted: Tue Aug 21, 2007 3:31 am Post subject: |
|
|
you say exit of a aplicacion without press Home?
if is that you use this code:
| Code: | | sceKernelExitGame(); |
if no is that
sorry is what no understand very good the english :( |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Tue Aug 21, 2007 8:28 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Tue Aug 21, 2007 9:01 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Tue Aug 21, 2007 9:55 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Tue Aug 21, 2007 9:58 am Post subject: |
|
|
Oh, you mean paint over the exit screen?
instead of getting rid of it? |
|
| Back to top |
|
 |
PSPJunkie
Joined: 23 Jan 2007 Posts: 14 Location: Jersey
|
Posted: Tue Aug 21, 2007 5:48 pm Post subject: |
|
|
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: |
/* 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 :/ |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Tue Aug 21, 2007 6:41 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Tinnus
Joined: 29 Jul 2006 Posts: 67
|
Posted: Fri Aug 24, 2007 6:04 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
kururin
Joined: 05 Jul 2006 Posts: 36
|
Posted: Fri Aug 24, 2007 8:44 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Fri Aug 24, 2007 9:59 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Fri Aug 24, 2007 11:20 am Post subject: |
|
|
Ok, thanks, then it's just a matter of pressing it twice and having
the LCD backlight turned off in between :) |
|
| Back to top |
|
 |
SilverSpring
Joined: 27 Feb 2007 Posts: 115
|
Posted: Fri Aug 24, 2007 11:58 pm Post subject: |
|
|
hope this helps a bit:
0x0f341be4 sceImposeGetHomePopup
0x5595a71a sceImposeSetHomePopup
int sceImposeGetHomePopup(void);
int sceImposeSetHomePopup(int mode); // 1-enable, 0-disable _________________ PSP PRX LibDocs |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sat Aug 25, 2007 6:34 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
SilverSpring
Joined: 27 Feb 2007 Posts: 115
|
Posted: Sat Aug 25, 2007 8:41 am Post subject: |
|
|
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). _________________ PSP PRX LibDocs
Last edited by SilverSpring on Sat Aug 25, 2007 3:25 pm; edited 1 time in total |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Sat Aug 25, 2007 9:19 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Sat Aug 25, 2007 11:59 am Post subject: |
|
|
ahh so the unknowns must be for disable enable :) ok cool thanx _________________ 10011011 00101010 11010111 10001001 10111010 |
|
| Back to top |
|
 |
adrahil
Joined: 16 Mar 2006 Posts: 277
|
Posted: Sun Aug 26, 2007 3:14 am Post subject: |
|
|
| WOW, now THAT's a neolithic way of doing things :) There is an easy way, by querying the Impose params... |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Tue Aug 28, 2007 9:08 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Thu Aug 30, 2007 7:10 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
|