From: slack Date: Tue, 30 Sep 2008 01:17:14 +0000 (+0200) Subject: Initial commit. Some hello-worldish stuff ;) X-Git-Url: http://slack.codemaniacs.com/git/?a=commitdiff_plain;h=8159c8aa4b9967a1ae4fe56d721a20fa1752a551;p=laz0r.git Initial commit. Some hello-worldish stuff ;) --- 8159c8aa4b9967a1ae4fe56d721a20fa1752a551 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c2b34f7 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +TARGET = laz0r +OBJS = main.o game.o + +PSP_FW_VERSION=401 +BUILD_PRX=1 + +INCDIR = +CFLAGS = -O2 -G0 -Wall +CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti +ASFLAGS = $(CFLAGS) + +LIBDIR = +LDFLAGS = + +PSPSDK=$(shell psp-config --pspsdk-path) +include $(PSPSDK)/lib/build.mak diff --git a/game.cc b/game.cc new file mode 100644 index 0000000..d726e6b --- /dev/null +++ b/game.cc @@ -0,0 +1,9 @@ +#include "game.h" + +int game_main(int argc, char **argv) +{ + while(1) + { + } +} + diff --git a/game.h b/game.h new file mode 100644 index 0000000..1090770 --- /dev/null +++ b/game.h @@ -0,0 +1,7 @@ +#if !defined(GAME_H) +#define GAME_H + +int game_main(int argc, char *argv[]); + +#endif + diff --git a/main.cc b/main.cc new file mode 100644 index 0000000..c53ca4b --- /dev/null +++ b/main.cc @@ -0,0 +1,49 @@ +#include +#include +#include +#include +#include +#include + +/* Define the module info section */ +PSP_MODULE_INFO("template", 0, 1, 1); + +/* Define the main thread's attribute value (optional) */ +PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); + +// Exit callback +int exit_callback(int arg1, int arg2, void *common) { + sceKernelExitGame(); + return 0; +} + +// Callback thread +int callback_thread(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 setup_callbacks(void) { + int thid = 0; + + thid = sceKernelCreateThread("update_thread", callback_thread, 0x11, 0xFA0, 0, 0); + if(thid >= 0) { + sceKernelStartThread(thid, 0, 0); + } + + return thid; +} + + +int main(int argc, char *argv[]) +{ + setup_callbacks(); + return game_main(argc, argv); +}