This weekend I decided to write a homebrew.After reading some articles,I built the PSP Dev Environment ,compiled the HelloWorld sample,copy them to PSP(ms:/PSP/GAME/).But it does not work...
when running this HelloWorld(tow different results with different make options):
if using "make":a error "80020148" occur
elesif using "make kxploit": program stops,and shut down in seconds
My PSP Environment:
FW2.7, HENB AND devhook0.45(it might not related)
My Dev Environment:
Linux,psp sdk built with toolchain.sh,automake 1.9
Code and Make file(it's a sample from Internet):
Code: Select all
/// Hello World - My First App for the PSP
/*
      This program was created by (Your Name Here) on (Date Here)
      It is a simple "Hello World" Application.
*/
#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("HelloW", 0x0000, 1, 4);
#define printf pspDebugScreenPrintf 
/* 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("Callback Thread",CallbackThread,0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0);
      if(thid >= 0) {
            sceKernelStartThread(thid, 0, 0); 
      }   
      return thid;
} 
int main()
{ 
    pspDebugScreenInit();
    SetupCallbacks(); 
    
    printf("Hello World"); 
    
    sceKernelSleepThread(); 
    return 0;  
} 
Code: Select all
TARGET = hello
OBJS = main.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
