Can't use HOME button to quit when using sceDisplayDisable
Can't use HOME button to quit when using sceDisplayDisable
hi,all
I have a strange question,
if I want call sceDisplay**able function, i must set my app run on kernel mode , 0x1000, PSP_MAIN_THREAD_ATTR(0), these are must, if I don't do these, then app will crush when it begin to run. (I don't know why, I copy from Mr.sakya's sample code)
but if I did this,when I push HOME key, and then push X key, psp didn't not response me, but if I push O key, it can response me and resume the excution of current apps. why?
I have a strange question,
if I want call sceDisplay**able function, i must set my app run on kernel mode , 0x1000, PSP_MAIN_THREAD_ATTR(0), these are must, if I don't do these, then app will crush when it begin to run. (I don't know why, I copy from Mr.sakya's sample code)
but if I did this,when I push HOME key, and then push X key, psp didn't not response me, but if I push O key, it can response me and resume the excution of current apps. why?
Last edited by picobsd on Thu Jul 26, 2007 1:53 pm, edited 1 time in total.
by the way, my firmware version is 3.03oeb
and I have noticed that Mr. sakya 's sample code ("sceDisplaySetBrightness and sceDisplayDisable sample") also have this problem, in his sample, he use Triangle button to quit.
and I have noticed that Mr. sakya 's sample code ("sceDisplaySetBrightness and sceDisplayDisable sample") also have this problem, in his sample, he use Triangle button to quit.
Last edited by picobsd on Thu Jul 26, 2007 1:06 pm, edited 1 time in total.
I think I have encountered this also, but didn't really know the cause,
you might have narrowed it down because I also use those functions.
Have you tried taking control of the HOME button and exiting the app
in the program if the HOME button is pressed?
Exit callback isn't the only way to quit a program.
You might want to try crashing the PSP unit by causing an exception, or two.
The only problem is these will cause the PSP to standby rather than quit to XMB.
you might have narrowed it down because I also use those functions.
Have you tried taking control of the HOME button and exiting the app
in the program if the HOME button is pressed?
Exit callback isn't the only way to quit a program.
You might want to try crashing the PSP unit by causing an exception, or two.
Code: Select all
_sw(0, 0); // cause exception to crash PSP unit (1)
asm("break\n"); // cause exception to crash PSP unit (2)
// by moonlight
Art wrote:I think I have encountered this also, but didn't really know the cause,
you might have narrowed it down because I also use those functions.
Have you tried taking control of the HOME button and exiting the app
in the program if the HOME button is pressed?
Exit callback isn't the only way to quit a program.
You might want to try crashing the PSP unit by causing an exception, or two.The only problem is these will cause the PSP to standby rather than quit to XMB.Code: Select all
_sw(0, 0); // cause exception to crash PSP unit (1) asm("break\n"); // cause exception to crash PSP unit (2) // by moonlight
oh, thank you for your time and consideration. I think I can hanle HOME key myself in program, but I am very curious with this problem, Why X button doesn't work in that circumstance. I wondered.
Well I can't be specific sorry, but you're no the only one.
MapThis! GPS application has the same issue, not sure if for the same reason,
one of my own released programs Time Baby.
I don't think it's to do with the X button being ignored, but more that the exit callback doesn't work, or scekernalexitgame doesn't work.
MapThis! GPS application has the same issue, not sure if for the same reason,
one of my own released programs Time Baby.
I don't think it's to do with the X button being ignored, but more that the exit callback doesn't work, or scekernalexitgame doesn't work.
do you mean that sceKernealExitGame doesn't work in Callback routine when mode is 0x1000, may be you are right, that is not key processing's problem.Art wrote:Well I can't be specific sorry, but you're no the only one.
MapThis! GPS application has the same issue, not sure if for the same reason,
one of my own released programs Time Baby.
I don't think it's to do with the X button being ignored, but more that the exit callback doesn't work, or scekernalexitgame doesn't work.
Re: Can't use HOME button to quit when using sceDisplayDisab
Hi! :)
To solve your problem declare a static variable
Then change the exit_callback and SetupCallbacks like this:
Change the while(1) loops to:
P.S: I also updated the post with the sample code. ;)
Ciaooo
Sakya
To solve your problem declare a static variable
Code: Select all
static int runningFlag = 1;
Code: Select all
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
runningFlag = 0;
sceKernelExitGame();
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, PSP_THREAD_ATTR_USER, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
Code: Select all
while(runningFlag)
Ciaooo
Sakya
Re: Can't use HOME button to quit when using sceDisplayDisab
hi, long time no see, thank you for your code, I'll try it tonignt, hope it works, I merely gave up on this, thank you.sakya wrote:Hi! :)
To solve your problem declare a static variableThen change the exit_callback and SetupCallbacks like this:Code: Select all
static int runningFlag = 1;
Change the while(1) loops to:Code: Select all
/* Exit callback */ int exit_callback(int arg1, int arg2, void *common) { runningFlag = 0; sceKernelExitGame(); 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, PSP_THREAD_ATTR_USER, 0); if(thid >= 0) { sceKernelStartThread(thid, 0, 0); } return thid; }
P.S: I also updated the post with the sample code. ;)Code: Select all
while(runningFlag)
Ciaooo
Sakya