samples: add missing callbacks.h and Makefile

Fixes issue #2
This commit is contained in:
GeeckoDev 2015-07-13 15:33:52 +02:00
parent 3aaab4c50e
commit c347d4d227
2 changed files with 64 additions and 0 deletions

26
sample/Makefile Normal file
View File

@ -0,0 +1,26 @@
all:
make -C clock
make -C coordinates
make -C deform
make -C depth
make -C objcontrol
make -C screensaver
make -C transform
clean:
make -C clock clean
make -C coordinates clean
make -C deform clean
make -C depth clean
make -C objcontrol clean
make -C screensaver clean
make -C transform clean
install:
make -C clock install
make -C coordinates install
make -C deform install
make -C depth install
make -C objcontrol install
make -C screensaver install
make -C transform install

38
sample/callbacks.h Normal file
View File

@ -0,0 +1,38 @@
#ifndef __CALLBACKS_H__
#define __CALLBACKS_H__
#include <pspkernel.h>
int callbacks_exit()
{
sceKernelExitGame();
return 0;
}
int callbacks_thread()
{
int id;
id = sceKernelCreateCallback("exit_cb", callbacks_exit, NULL);
sceKernelRegisterExitCallback(id);
sceKernelSleepThreadCB();
return 0;
}
int callbacks_setup()
{
int id;
id = sceKernelCreateThread("cb", callbacks_thread, 0x11, 0xFA0, 0, NULL);
if (id >= 0)
{
sceKernelStartThread(id, 0, NULL);
}
return id;
}
#endif // __CALLBACKS_H__