本文整理汇总了C++中sceKernelCreateCallback函数的典型用法代码示例。如果您正苦于以下问题:C++ sceKernelCreateCallback函数的具体用法?C++ sceKernelCreateCallback怎么用?C++ sceKernelCreateCallback使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sceKernelCreateCallback函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:DenielX,项目名称:psptools,代码行数:25,代码来源:main.c
示例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;
}
开发者ID:bensaraceno,项目名称:PSP,代码行数:10,代码来源:main.c
示例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 ();
}
开发者ID:joshdekock,项目名称:jim-pspware,代码行数:12,代码来源:psp2.cpp
示例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;
}
开发者ID:joel16,项目名称:Custom-Firmware-Extender,代码行数:14,代码来源:psp_init.c
示例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);
}
开发者ID:joshdekock,项目名称:jim-pspware,代码行数:29,代码来源:psp2.cpp
示例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;
}
开发者ID:DSJim,项目名称:genesis4iphone,代码行数:17,代码来源:psp.c
示例7: xCallbackThread
static int xCallbackThread(SceSize args, void *argp)
{
int cbid = sceKernelCreateCallback("xExitCallback", xExitCallback, 0);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
开发者ID:Falaina,项目名称:cspspemu,代码行数:7,代码来源:xlib.c
示例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;
}
开发者ID:KentuckyCompass,项目名称:pspautotests,代码行数:28,代码来源:refer.cpp
示例9: CallbackThread
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
开发者ID:Guthius,项目名称:gs2emu-googlecode,代码行数:8,代码来源:main.cpp
示例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;
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:8,代码来源:psp-setup.c
示例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;
}
开发者ID:AdamRi,项目名称:scummvm-pink,代码行数:20,代码来源:psp_main.cpp
示例12: callbacks_thread
int callbacks_thread(unsigned int, void*)
{
int id;
id = sceKernelCreateCallback("exit_cb", callbacks_exit, NULL);
sceKernelRegisterExitCallback(id);
sceKernelSleepThreadCB();
return 0;
}
开发者ID:libcg,项目名称:extremetuxracer-psp,代码行数:10,代码来源:main.cpp
示例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;
}
开发者ID:HomerSp,项目名称:pspautotests,代码行数:12,代码来源:mstick.c
示例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
}
开发者ID:danzat,项目名称:scummvm,代码行数:14,代码来源:display_manager.cpp
示例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;
}
开发者ID:joshdekock,项目名称:jim-psp,代码行数:14,代码来源:main.c
示例16: CallbackThread
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
//SceKernelThreadInfo info;
//info.size = sizeof(SceKernelThreadInfo);
//sceKernelReferThreadStatus (0, &info);
//printf("thread '%-12s' sp %p w %08x START\n", info.name, info.stack, info.waitId);
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
开发者ID:hebeDEUS,项目名称:NOVOS-LIBS-03-08-2015,代码行数:16,代码来源:main.c
示例17: main
int main(int argc, char **argv) {
int umdCbCallbackId;
int result;
umdCbCallbackId = sceKernelCreateCallback("umdHandler", umdHandler, (void *)0x1234);
result = sceUmdRegisterUMDCallBack(umdCbCallbackId);
printf("%08X\n", result);
printf("%d\n", sceKernelCheckCallback());
result = sceUmdUnRegisterUMDCallBack(umdCbCallbackId);
printf("%08X\n", result);
result = sceUmdUnRegisterUMDCallBack(umdCbCallbackId);
printf("%08X\n", result);
return 0;
}
开发者ID:HomerSp,项目名称:pspautotests,代码行数:19,代码来源:umd.c
示例18: power_callback
// Power callback
int power_callback(int unknown, int pwrflags) {
int cbid;
if (pwrflags & POWER_CB_POWER || pwrflags & POWER_CB_SUSPEND || pwrflags & POWER_CB_EXT) {
// Put game in paused state if game is running
if (_gameState == GAME_RUNNING) {
HandlePauseGame();
} else if (_gameState == GAME_CONTINUE) {
// If game is in continue state, wait until it enters the running state
// before pausing. Game is only in continue state for about 1 second,
// and it cannot be paused from this sate
while (_gameState == GAME_CONTINUE ) { sceKernelDelayThread(1000); }
HandlePauseGame();
}
}
// Re-register power callback so it executes again the next time a power event occurs.
cbid = sceKernelCreateCallback("Power Callback", (void *) power_callback, NULL);
scePowerRegisterCallback(0, cbid);
return 0;
}
开发者ID:bensaraceno,项目名称:PSP,代码行数:20,代码来源:main.c
示例19: hookEntry
static int hookEntry(SceSize args, void *argp)
{
SceKernelSemaInfo info;
globals_t *globals;
SceUID uid;
int res;
uid = sceKernelGetThreadId();
globals = getGlobals();
sceKernelLockMutexCB(globals->threadmgrMutex, 1, NULL);
info.size = sizeof(info);
res = sceKernelGetSemaInfo(globals->threadmgrSema, &info);
if (res)
goto fail;
while (globals->threadmgrTable[info.currentCount].uid != uid) {
if (info.currentCount >= info.maxCount) {
res = SCE_KERNEL_ERROR_ERROR;
goto fail;
}
info.currentCount++;
}
globals->threadmgrTable[info.currentCount].exitDeleteCb
= sceKernelCreateCallback("vhlUserExitDeleteCb", 0, exitDeleteCb, NULL);
sceKernelUnlockMutex(globals->threadmgrMutex, 1);
return globals->threadmgrTable[info.currentCount].entry(args, argp);
fail:
sceKernelUnlockMutex(globals->threadmgrMutex, 1);
return res;
}
开发者ID:himanshugoel2797,项目名称:VHL,代码行数:37,代码来源:threadmgr.c
示例20: main
int main(int argc, char *argv[])
{
SceCtrlData pad;
int result;
int oldButtons = 0;
int cbid = -1;
int waitStatThid = -1;
pspDebugScreenInit();
if (argc > 0) {
printf("Bootpath: %s\n", argv[0]);
}
printf("Triangle - Exit\n");
printf("Left - sceUmdActivate\n");
printf("Right - sceUmdDeactivate\n");
printf("Cross - Delay CB\n");
printf("Circle - Display umd info\n");
printf("Square - Refer umd callback\n");
printf("L-Trigger - IO test\n");
printf("R-Trigger - Start/Stop wait stat test\n");
SetupCallbacks();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
{
printUmdInfo();
// result:
// callback events are generated if we launch from iso or immediately after psplink has reset
cbid = sceKernelCreateCallback("UMD Callback (not active)", umd_callback, (void*)0x34343434);
result = sceUmdRegisterUMDCallBack(cbid);
printf("sceUmdRegisterUMDCallBack result %08X\n", result);
// Register a second UMD callback: it will overwrite the first one.
cbid = sceKernelCreateCallback("UMD Callback", umd_callback, (void*)0x11111111);
result = sceUmdRegisterUMDCallBack(cbid);
printf("sceUmdRegisterUMDCallBack result %08X\n", result);
}
while (!done)
{
sceCtrlReadBufferPositive(&pad, 1); // context switch in here
//sceCtrlPeekBufferPositive(&pad, 1); // no context switch version
int buttonDown = (oldButtons ^ pad.Buttons) & pad.Buttons;
if (buttonDown & PSP_CTRL_LEFT)
{
result = sceUmdActivate(1, "disc0:");
printf("sceUmdActivate result %08x\n", result);
}
if (buttonDown & PSP_CTRL_RIGHT)
{
result = sceUmdDeactivate(1, "disc0:");
printf("sceUmdDeactivate result %08x\n", result);
}
if (buttonDown & PSP_CTRL_CROSS)
{
printf("sceKernelDelayThreadCB ...\n");
sceKernelDelayThreadCB(10000);
}
if (buttonDown & PSP_CTRL_CIRCLE)
{
printUmdInfo();
}
if (buttonDown & PSP_CTRL_SQUARE)
{
SceKernelCallbackInfo info;
memset(&info, 0xee, sizeof(info));
info.size = sizeof(info);
result = sceKernelReferCallbackStatus(cbid, &info);
printf("sceKernelReferCallbackStatus result %08x\n", result);
printf(" size %d (%d)\n", info.size, sizeof(info));
printf(" name '%s'\n", info.name);
printf(" threadId %08x (%08x)\n", info.threadId, sceKernelGetThreadId());
printf(" callback %p common %p\n", info.callback, info.common);
printf(" notifyCount %08x\n", info.notifyCount);
printf(" notifyArg %08x\n", info.notifyArg);
}
if (buttonDown & PSP_CTRL_LTRIGGER)
{
test_io();
}
if (buttonDown & PSP_CTRL_RTRIGGER)
{
if (waitStatThid >= 0)
{
printf("Cleaning up wait stat test ...\n");
referThread(waitStatThid);
result = sceUmdCancelWaitDriveStat();
//.........这里部分代码省略.........
开发者ID:DeadRoolz,项目名称:jpcsp,代码行数:101,代码来源:main.c
注:本文中的sceKernelCreateCallback函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论