Code: Select all
// Hello World - A simple "Hello World" Application.
#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("Hello World", 0, 1, 1);
// Exit callback
int ExitCallback(int Arg1, int Arg2, void *Common)
{
sceKernelExitGame();
return 0;
}
// Callback thread
int CallbackThread(SceSize Args, void *Argp)
{
int CallbackId;
CallbackId = sceKernelCreateCallback("Exit Callback", ExitCallback, NULL);
sceKernelRegisterExitCallback(CallbackId);
sceKernelSleepThreadCB();
return 0;
}
// Sets up the callback thread and returns its thread id
int SetupCallbacks(void)
{
int ThreadId = 0;
ThreadId = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if (ThreadId >= 0)
{
sceKernelStartThread(ThreadId, 0, 0);
}
return ThreadId;
}
int main(int argc, char ** argv)
{
pspDebugScreenInit();
SetupCallbacks();
while(1)
{
pspDebugScreenPrintf ("Hello World");
sceDisplayWaitVblankStart();
}
sceKernelSleepThread();
return 0;
}
http://www.psp-programming.com/forums/i ... pic=2994.0
I do have -lstdc++ in my libs line for Code::Blocks. I have no clue what else I have to do. Help?
P.S. This is the tutorial I used for setting up devkitPSP with C::B.
http://forums.qj.net/f-psp-development- ... 81882.html