当前位置: 首页>>代码示例>>C++>>正文


C++ sceKernelSleepThreadCB函数代码示例

本文整理汇总了C++中sceKernelSleepThreadCB函数的典型用法代码示例。如果您正苦于以下问题:C++ sceKernelSleepThreadCB函数的具体用法?C++ sceKernelSleepThreadCB怎么用?C++ sceKernelSleepThreadCB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sceKernelSleepThreadCB函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: and_thread

int and_thread(SceSize args, void *argp)
{
    int result;
    u32 outBits;
    SceKernelThreadInfo info;
    info.size = sizeof(SceKernelThreadInfo);

    sceKernelReferThreadStatus (0, &info);
    printf("thread '%-12s' sp %p pattern %08x START\n", info.name, info.stack, AND_PATTERN);

    while(!done)
    {
        // 0x00FF00FF initPattern
        // 0x000000FF should work - ok
        // 0x00000FF0 should fail - ok
        // 0x0000FF00 should fail - ok

        outBits = 0xbaadc0de;
        result = sceKernelWaitEventFlag(evid, AND_PATTERN, PSP_EVENT_WAITAND, &outBits, 0);
        //result = sceKernelPollEventFlag(evid, AND_PATTERN, PSP_EVENT_WAITAND, &outBits);
        printf("thread '%-12s' result %08x outBits %08x\n", info.name, result, (int)outBits);

        sceKernelSleepThreadCB();
    }

    return 0;
}
开发者ID:hebeDEUS,项目名称:NOVOS-LIBS-03-08-2015,代码行数:27,代码来源:main.c

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例11: 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

示例12: 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

示例13: ExitCallbackThread

static int ExitCallbackThread(SceSize args, void *argp)
{
	sceKernelRegisterExitCallback(sceKernelCreateCallback("HOME button Callback", exit_callback, NULL));
	sceKernelSleepThreadCB();
	return 0;
}
开发者ID:mafu9,项目名称:dxlibp-kai,代码行数:6,代码来源:dxlib_init.c

示例14: main

int main(int argc, char *argv[])
{
    SceCtrlData pad;
    int result;
    int oldButtons = 0;

    pspDebugScreenInit();
    if (argc > 0) {
        printf("Bootpath: %s\n", argv[0]);
    }

    printf("Triangle - Exit\n");
    printf("Square - Set lower 16-bits\n");
    printf("Circle - Clear lower 16-bits\n");
    printf("Cross - Delay + refer status\n");
    printf("R-Trigger - Cancel event flag\n\n");
    printf("L-Trigger - Delete event flag\n\n");

    SetupCallbacks();

    sceCtrlSetSamplingCycle(0);
    sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);

    evid = sceKernelCreateEventFlag("test_ef", PSP_EVENT_WAITMULTIPLE, INITIAL_PATTERN, 0);
    //evid = sceKernelCreateEventFlag("test_ef", 0, INITIAL_PATTERN, 0);
    printf("EVID: %08x pattern %08x\n", evid, INITIAL_PATTERN);
    if (evid >= 0)
    {
        createStartThread("and", and_thread);
        createStartThread("or", or_thread);
        createStartThread("clear", clear_thread);

#if 0
        // testing context switch timing
        sceKernelSetEventFlag(evid, 0x0000FFFF);
        //int buf[64]; for(;;) sceCtrlReadLatch(buf); // sceCtrlReadLatch does not context switch
        for(;;) sceKernelDelayThread(0); // does not wait forever
#else
        while(!done)
        {
            sceCtrlReadBufferPositive(&pad, 1); // context switch in here
            int buttonDown = (oldButtons ^ pad.Buttons) & pad.Buttons;

            if (buttonDown & PSP_CTRL_SQUARE)
            {
                result = sceKernelSetEventFlag(evid, 0x0000FFFF);
                printf("\nsceKernelSetEventFlag result %08x\n", result);
                printSceKernelEventFlagInfo(evid);
            }

            if (buttonDown & PSP_CTRL_CIRCLE)
            {
                //result = sceKernelClearEventFlag(evid, 0x0000FFFF); // bits to clear - bad
                result = sceKernelClearEventFlag(evid, 0xFFFF0000); // bits to keep - ok
                printf("\nsceKernelClearEventFlag result %08x\n", result);
                printSceKernelEventFlagInfo(evid);
            }

            if (buttonDown & PSP_CTRL_CROSS)
            {
                printf("\nsceKernelDelayThreadCB ...\n");
                sceKernelDelayThreadCB(1000);
                printSceKernelEventFlagInfo(evid);
            }

            if (buttonDown & PSP_CTRL_RTRIGGER)
            {
                //result = sceKernelCancelEventFlag(evid, newPattern, addr);
                result = sceKernelCancelEventFlag(evid, INITIAL_PATTERN, 0);
                printf("sceKernelCancelEventFlag result %08x\n", result);
                printSceKernelEventFlagInfo(evid);
            }

            if (buttonDown & PSP_CTRL_LTRIGGER)
            {
                //result = sceKernelCancelEventFlag(evid, newPattern, addr);
                result = sceKernelDeleteEventFlag(evid);
                printf("sceKernelDeleteEventFlag result %08x\n", result);
                evid = 0;
            }

            if (buttonDown & PSP_CTRL_TRIANGLE)
                done = 1;

            oldButtons = pad.Buttons;
            //sceKernelDelayThread(0); // ok, not infinite :)
        }
#endif
    }
    else
    {
        printf("sceKernelCreateEventFlag failed %08x\n", evid);
        sceKernelSleepThreadCB();
    }

    sceKernelExitGame();
    return 0;
}
开发者ID:hebeDEUS,项目名称:NOVOS-LIBS-03-08-2015,代码行数:98,代码来源:main.c


注:本文中的sceKernelSleepThreadCB函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。