mirror of
https://github.com/pspdev/pspsdk.git
synced 2025-12-25 04:54:59 +00:00
55 lines
990 B
C
55 lines
990 B
C
/*
|
|
* PSP Software Development Kit - https://github.com/pspdev
|
|
* -----------------------------------------------------------------------
|
|
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
|
|
*
|
|
* Copyright (c) 2005 Jesper Svennevid
|
|
*/
|
|
|
|
#include <pspkernel.h>
|
|
#include <pspdisplay.h>
|
|
#include <pspdebug.h>
|
|
#include <stdlib.h>
|
|
#include <stdio.h>
|
|
#include <math.h>
|
|
#include <string.h>
|
|
#include <time.h>
|
|
|
|
static int exitRequest = 0;
|
|
|
|
int running()
|
|
{
|
|
return !exitRequest;
|
|
}
|
|
|
|
int exitCallback(int arg1, int arg2, void *common)
|
|
{
|
|
exitRequest = 1;
|
|
return 0;
|
|
}
|
|
|
|
int callbackThread(SceSize args, void *argp)
|
|
{
|
|
int cbid;
|
|
|
|
cbid = sceKernelCreateCallback("Exit Callback", exitCallback, NULL);
|
|
sceKernelRegisterExitCallback(cbid);
|
|
|
|
sceKernelSleepThreadCB();
|
|
|
|
return 0;
|
|
}
|
|
|
|
int setupCallbacks(void)
|
|
{
|
|
int thid = 0;
|
|
|
|
thid = sceKernelCreateThread("update_thread", callbackThread, 0x11, 0xFA0, 0, 0);
|
|
if(thid >= 0)
|
|
{
|
|
sceKernelStartThread(thid, 0, 0);
|
|
}
|
|
|
|
return thid;
|
|
}
|