All pastes #90430 Raw Edit

Anonymous

public text v1 · immutable
#90430 ·published 2006-07-17 17:44 UTC
rendered paste body
#include <stdio.h>
#include <stdlib.h>

#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO("Font", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);

int SetupCallbacks();

extern "C" int sceFontNewLib(void*, void*);

int main(int argc, char **argv) {
	SetupCallbacks();

	sceFontNewLib(0, 0);

	while(1) {
		sceKernelDelayThread(1000);
	}

	return 0;
}

int exit_callback(int arg1, int arg2, void *common) {
	sceKernelExitGame();
	return 0;
}

int CallbackThread(SceSize args, void *argp) {
	int cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
	sceKernelRegisterExitCallback(cbid);
	sceKernelSleepThreadCB();
	return 0;
}

int SetupCallbacks(void) {
	int thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
	if(thid >= 0) {
		sceKernelStartThread(thid, 0, 0);
	}
	return thid;
}