Reprint Annotated Source: http://blog.csdn.net/yf210yf/article/details/38083413
1. Create HELLOWORLD.C
#include <pspkernel.h>
#include <pspdebug.h>
psp_module_info ("Hello World", 0, 1, 1);
#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 ("Update_thread", Callbackthread, 0x11, 0xfa0, 0, 0);
if (thid >= 0)
{
scekernelstartthread (thid, 0, 0);
}
return thid;
}
int main ()
{
pspdebugscreeninit ();
Setupcallbacks ();
printf ("Hello world! Snail ");
Scekernelsleepthread ();
return 0;
}
2. Write makefile
OBJS = helloworld.o
CFLAGS =-o2-g0-wall
cxxflags = $ (CFLAGS)-fno-exceptions-fno-rtti
asflags = $ (CFLAGS) C3/>extra_targets = Eboot. PBP
psp_eboot_title = Hello World
pspsdk=$ (Shell psp-config--pspsdk-path)
include $ (PSPSDK)/lib/ Build.mak
3.make
4. Generated Eboot test
(1) Simulator test
(2) psp3000 test