本文整理汇总了C++中sceKernelCreateCallback函数的典型用法代码示例。如果您正苦于以下问题:C++ sceKernelCreateCallback函数的具体用法?C++ sceKernelCreateCallback怎么用?C++ sceKernelCreateCallback使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sceKernelCreateCallback函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[]) {
SceUID mod;
char s[255];
int r;
int SDCB1, SDCB2;
sceKernelDelayThread(7000000);
mod = pspSdkLoadStartModule("ms0:/seplugins/deemerd.prx", PSP_MEMORY_PARTITION_KERNEL);
if (mod < 0) {
sprintf(s, "Error 0x%08X loading/starting deemerd.prx.\n", mod);
debugIssueError(s);
}
SDCB1 = sceKernelCreateCallback("SaveDataStartCallback", hcDeemerCapturedSDParamsCallback, NULL );
SDCB2 = sceKernelCreateCallback("SaveDataGetStatusCallback", hcDeemerSavedataGetStatusCallback, NULL );
hcDeemerDriverSetupCallbackCapturedSDParams(SDCB1, SDCB2);
r = hcDeemerDriverPatchSavedataInitStart();
sceKernelSleepThreadCB();
return 0;
}
示例2: CallbackThread
// Callback thread
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", (void *) exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
cbid = sceKernelCreateCallback("Power Callback", (void *) power_callback, NULL);
scePowerRegisterCallback(0, cbid);
sceKernelSleepThreadCB();
return 0;
}
示例3: CallbackThread
// Thread to create the callbacks and then begin polling
int CallbackThread (int args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback ("Exit Callback", (SceKernelCallbackFunction)ExitCallback, NULL);
sceKernelRegisterExitCallback (cbid);
cbid = sceKernelCreateCallback ("Power Callback", (SceKernelCallbackFunction)PowerCallback, NULL);
scePowerRegisterCallback (0, cbid);
sceKernelSleepThreadCB ();
}
示例4: psp_callback_thread
int
psp_callback_thread(SceSize args, void *argp)
{
int cid;
cid = sceKernelCreateCallback("Exit Call Back", psp_exit_callback, NULL);
sceKernelRegisterExitCallback(cid);
cid = sceKernelCreateCallback("Power Call Back", psp_power_callback, NULL);
//scePowerRegisterCallback(0,cid);
sceKernelSleepThreadCB();
return 0;
}
示例5: PowerCallback
void PowerCallback (int unknown, int pwrflags)
{
if (pwrflags & PSP_POWER_CB_HOLD_SWITCH)
{
extern bool8 g_bShowProfilerIno;
g_bShowProfilerInfo = (! g_bShowProfilerInfo);
}
if (pwrflags & PSP_POWER_CB_POWER_SWITCH){
if (g_bROMLoaded) {
scePowerSetClockFrequency (222, 222, 111);
S9xSetSoundMute (TRUE);
g_bSleep = true;
save_config ();
Memory.SaveSRAM (S9xGetFilename ("srm"));
}
} else if (pwrflags & PSP_POWER_CB_RESUME_COMPLETE) {
g_bSleep = false;
}
if (pwrflags & PSP_POWER_CB_BATTERY_LOW){
scePowerSetClockFrequency (222,222,111);
S9xSetInfoString ("WARNING: PSP Battery is Low! (Automatically Throttling CPU)");
}
int cbid;
cbid = sceKernelCreateCallback ("Power Callback", (SceKernelCallbackFunction)PowerCallback, NULL);
scePowerRegisterCallback (0, cbid);
}
示例6: callback_thread
/* Callback thread */
static int callback_thread(SceSize args, void *argp)
{
int cbid;
lprintf("callback_thread started with id %08x, priority %i\n",
sceKernelGetThreadId(), sceKernelGetThreadCurrentPriority());
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
cbid = sceKernelCreateCallback("Power Callback", power_callback, NULL);
scePowerRegisterCallback(0, cbid);
sceKernelSleepThreadCB();
return 0;
}
示例7: xCallbackThread
static int xCallbackThread(SceSize args, void *argp)
{
int cbid = sceKernelCreateCallback("xExitCallback", xExitCallback, 0);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
示例8: main
extern "C" int main(int argc, char *argv[]) {
SceUID cb = sceKernelCreateCallback("refer", &cbFunc, (void *)0xDEADBEEF);
SceKernelCallbackInfo info;
info.size = sizeof(info);
// Crashes.
//testRefer("NULL info", cb, NULL);
testRefer("Normal", cb, &info);
checkpointNext("Sizes:");
int sizes[] = {0, 1, 2, 4, 8, 44, 48, 52, 56, 60, 64, 68, 72, 128, 256, 1024, 0xFF00, 0xFF0000, 0x80000001, 0xCCCCCCCC, 0xFFFFFFFF};
int i, result;
for (i = 0; i < sizeof(sizes) / sizeof(sizes[0]); ++i) {
info.size = sizes[i];
result = sceKernelReferCallbackStatus(cb, &info);
checkpoint(" %08x => %08x (result=%08x)", sizes[i], info.size, result);
}
sceKernelDeleteCallback(cb);
info.size = sizeof(info);
checkpointNext("Objects:");
testRefer("NULL", 0, &info);
testRefer("Invalid", 0xDEADBEEF, &info);
testRefer("Deleted", cb, &info);
return 0;
}
示例9: CallbackThread
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
示例10: update_thread
static
int update_thread (SceSize args, void *argp)
{
int cbid = sceKernelCreateCallback("Exit Callback", exit_callback, (void *) 0);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
示例11: CallbackThread
/* Callback thread */
int CallbackThread(SceSize /*size*/, void *arg) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", (SceKernelCallbackFunction)exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
/* Set up callbacks for PSPIoStream */
cbid = sceKernelCreateCallback("Power Callback", (SceKernelCallbackFunction)power_callback, 0);
if (cbid >= 0) {
if (scePowerRegisterCallback(-1, cbid) < 0) {
PSP_ERROR("Couldn't register callback for power_callback\n");
}
} else {
PSP_ERROR("Couldn't create a callback for power_callback\n");
}
sceKernelSleepThreadCB();
return 0;
}
示例12: callbacks_thread
int callbacks_thread(unsigned int, void*)
{
int id;
id = sceKernelCreateCallback("exit_cb", callbacks_exit, NULL);
sceKernelRegisterExitCallback(id);
sceKernelSleepThreadCB();
return 0;
}
示例13: main
int main(int argc, char **argv) {
SceUID cb_id;
cb_id = sceKernelCreateCallback("MSCB", ms_callback, (void *)0x777);
printf("cb_id: %08X\n", (cb_id > 0) ? 1 : 0);
printf("MScmRegisterMSInsertEjectCallback: %08X\n", MScmRegisterMSInsertEjectCallback(cb_id));
printf("sceKernelCheckCallback: %08X\n", sceKernelCheckCallback());
printf("MScmUnregisterMSInsertEjectCallback: %08X\n", MScmUnregisterMSInsertEjectCallback(cb_id));
printf("sceKernelDeleteCallback: %08X\n", sceKernelDeleteCallback(cb_id));
return 0;
}
示例14: DEBUG_ENTER_FUNC
// this function gets called by PspThread when starting the new thread
void MasterGuRenderer::threadFunction() {
DEBUG_ENTER_FUNC();
// Create the callback. It should always get the pointer to MasterGuRenderer
_callbackId = sceKernelCreateCallback("Display Callback", guCallback, this);
if (_callbackId < 0) {
PSP_ERROR("failed to create display callback\n");
}
PSP_DEBUG_PRINT("created callback. Going to sleep\n");
sceKernelSleepThreadCB(); // sleep until we get a callback
}
示例15: CallbackThread
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
printf("\nCallback Thread Status:\n");
dump_threadstatus();
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}