------------------
Main.c
------------------
/*
*main.c
*This is a simple Hello world from team Odessa by Emu
* October 4, 2010
*/
#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("Hello World", 0, 1, 1);
#define printf pspDebugScreenPrintf // defines pspDebugScreenPrintf as printf
/*
*The info below about callbacks is always need so we can use the home button on our psp
*/
// 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;
}
//Our code's main function
int main(){
pspDebugScreenInit(); //Allows things to be printed to the screen
SetupCallbacks(); //Allows callbacks to be called upon
printf("Hello World");
sceKernelSleepThread(); //freezes the screen so you can see what you inputed
return 0;
}
------------------------
Makefile - Replace the ???? with whatever you want
------------------------
TARGET = ?????
OBJS = main.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = ???????
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak