forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Screen not resetting after HOME key exit

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
ggmoney



Joined: 05 Oct 2005
Posts: 4

PostPosted: Wed Oct 05, 2005 4:14 am    Post subject: Screen not resetting after HOME key exit Reply with quote

i have this in as my main func and it works and i have the starned call backs that come with all the samples

and after i exit with the home key it does the "please wait" and then shows the black screen with "Simple test" flickering....

any one know whats up


Code:
#include <pspkernel.h>
#include <pspdebug.h>
#include <stdlib.h>
#include <string.h>

#include "pg.h"
#include "bitmap.c"


PSP_MODULE_INFO("AA", 0x1000, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(0);

/* Define printf, just to make typing easier */
#define printf   pspDebugScreenPrintf

void delay_loop(int num) {
   if (num <= 0) return;
   for (; num > 0; num--)
      sceDisplayWaitVblankStart();
}
/* 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, THREAD_ATTR_USER, 0);
   if(thid >= 0)
   {
      sceKernelStartThread(thid, 0, 0);
   }

   return thid;
}


int main(void)
{
   SetupCallbacks();
   pgInit();
   pgScreenFrame(2,0);

   while(1){
      pgFillvram(0);
      pgPrint(0,1,0xffff,"Simple test");
      pgScreenFlipV();
      pgWaitVn(160);
   }
   
   return 0;
}
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Wed Oct 05, 2005 5:49 am    Post subject: Reply with quote

it is because you are running a kernel mode thread. As you seem not to be using kernel mode at all anyway change PSP_MODULE_INFO's 2nd parameter to 0 and it should work.
Back to top
View user's profile Send private message
ggmoney



Joined: 05 Oct 2005
Posts: 4

PostPosted: Wed Oct 05, 2005 8:15 am    Post subject: Reply with quote

yea thats what it was thansk.
Back to top
View user's profile Send private message
Shazz



Joined: 31 Aug 2004
Posts: 244
Location: Somewhere over the rainbow

PostPosted: Wed Oct 05, 2005 5:51 pm    Post subject: Reply with quote

Tyranid,

Do you have any idea why when your main prog is running in kernel mode AND the CallbackThread too (needed if you want it to kill some kernel functions in the main) that the exit callback is really sent but the thread who registered it never receives it ?

Not a big deal, write your own exit manager but...just to understand where the callback dies....
_________________
- TiTAN Art Division -
http://www.titandemo.org
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group