This is the first time that an application not starting.
I've been searching on forums for more than a hour, but i couldn't find a solution.
CFW : 3.71 m33-4 (kernel : 1.5)
My code:
Code: Select all
#include <SDL/SDL.h>
#include <pspkernel.h>
#include <pspctrl.h>
#include <pspdebug.h>
//#include <pspaudio.h>
//#include <pspaudiolib.h>
#include <pspdisplay.h>
#include <psppower.h>
PSP_MODULE_INFO("SDLtest 1", 0x0, 1, 1);
PSP_HEAP_SIZE_MAX();//PSP_HEAP_SIZE_KB(-1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
PSP_MAIN_THREAD_STACK_SIZE_KB(32);
/* 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 = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main()//(int argc, char *argv[])
{
SetupCallbacks();
scePowerSetClockFrequency(333, 333, 166);
pspDebugScreenInit();
pspDebugScreenSetBackColor(0xFFFFFFFF);
pspDebugScreenSetTextColor(0);
pspDebugScreenClear();
pspDebugScreenPrintf("HELLO...\n");
atexit(SDL_Quit);
pspDebugScreenPrintf("INIT :%d\n",SDL_Init(SDL_INIT_VIDEO));
SDL_ShowCursor(0);
SDL_Surface* screen=NULL;
screen=SDL_SetVideoMode( 480, 272, 32, SDL_HWSURFACE|SDL_DOUBLEBUF);
pspDebugScreenPrintf("SCREEN : %d \n",(screen!=NULL));
SDL_Surface* img=loadImage("bg.bmp");
pspDebugScreenPrintf("IMG: %d \n",(img!=NULL));
bool running=true;
SDL_Event se;
while(running)
{
while(SDL_PollEvent(&se))
{
switch(se.type)
{
case SDL_QUIT : {running=false;break;}
}
}
SDL_FillRect(screen,NULL,SDL_MapRGB(screen->format,0,0,0));
if(img)renderSurface(0,0,img,screen);
if(screen)refreshSurface(screen);
}
SDL_FreeSurface(screen);screen=NULL;
SDL_FreeSurface(img);img=NULL;
SDL_Quit();
return 0;
}