• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ sceKernelStartThread函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: bgm_volume

Psp2Audio::Psp2Audio() :
	bgm_volume(0)
{

	// Creating mutexs
	BGM_Mutex = sceKernelCreateSema("BGM Mutex", 0, 1, 1, NULL);
	SFX_Mutex = sceKernelCreateSema("SFX Mutex", 0, 0, 1, NULL);
	SFX_Mutex_ID = sceKernelCreateSema("SFX Mutex for ID read", 0, 1, 1, NULL);

	// Starting audio thread for BGM
	BGM_Thread = sceKernelCreateThread("BGM Thread", &streamThread, 0x10000100, 0x10000, 0, 0, NULL);
	int res = sceKernelStartThread(BGM_Thread, sizeof(BGM_Thread), &BGM_Thread);
	if (res != 0){
		Output::Error("Failed to init audio thread (0x%x)", res);
		return;
	}

	// Starting audio threads for SFX
	for (int i=0;i < AUDIO_CHANNELS; i++){
		sfx_threads[i] = sceKernelCreateThread("SFX Thread", &sfxThread, 0x10000100, 0x10000, 0, 0, NULL);
		int res = sceKernelStartThread(sfx_threads[i], sizeof(sfx_threads[i]), &sfx_threads[i]);
		if (res != 0){
			Output::Error("Failed to init audio thread (0x%x)", res);
			return;
		}
	}

}
开发者ID:ChristianBreitwieser,项目名称:easyrpg-libretro,代码行数:28,代码来源:audio_psp2.cpp


示例2: testThreadsEnded

void testThreadsEnded() {
	int thread1, thread2, thread3, thread4;
	
	// Thread1 will stop returning the function and sceKernelWaitThreadEnd will be executed after the thread have ended.
	thread1 = sceKernelCreateThread("threadEndedFunction1", (void *)&threadEndedFunction1, 0x12, 0x10000, 0, NULL);

	// Thread1 will stop with sceKernelExitThread and sceKernelWaitThreadEnd will be executed after the thread have ended.
	thread2 = sceKernelCreateThread("threadEndedFunction2", (void *)&threadEndedFunction2, 0x12, 0x10000, 0, NULL);

	// Thread3 will stop after a while so it will allow to execute sceKernelWaitThreadEnd before it ends.
	thread3 = sceKernelCreateThread("threadEndedFunction3", (void *)&threadEndedFunction3, 0x12, 0x10000, 0, NULL);
	
	// Thread4 won't start never, so sceKernelWaitThreadEnd can be executed before thread is started.
	thread4 = sceKernelCreateThread("threadEndedFunction4", NULL, 0x12, 0x10000, 0, NULL);

	sceKernelStartThread(thread1, 0, NULL);
	sceKernelStartThread(thread2, 0, NULL);
	sceKernelStartThread(thread3, 0, NULL);
	
	// This waits 5ms and supposes both threads (1 and 2) have ended. Thread 3 should have not ended. Thread 4 is not going to be started.
	sceKernelDelayThread(2 * 1000);

	printf("Threads.EndedExpected\n");
	
	sceKernelWaitThreadEnd(thread1, NULL);
	printf("Thread1.Ended\n");
	sceKernelWaitThreadEnd(thread2, NULL);
	printf("Thread2.Ended\n");
	sceKernelWaitThreadEnd(thread3, NULL);
	printf("Thread3.Ended\n");
	sceKernelWaitThreadEnd(thread4, NULL);
	printf("Thread4.NotStartedSoEnded\n");
}
开发者ID:mrcmunir,项目名称:cspspemu,代码行数:33,代码来源:threads.c


示例3: main

int main(int argc, char **argv) {
	int result;
	int check_not_update_value = 7;
	SceKernelSemaInfo info;
	
	sema = sceKernelCreateSema("sema1", 0, 0, 2, NULL);
	
	sceKernelReferSemaStatus(sema, &info);
	PRINT_SEMAPHORE(sema, info);
	
	threads[0] = sceKernelCreateThread("Thread-0", (void *)&threadFunction, 0x12, 0x10000, 0, NULL);
	threads[1] = sceKernelCreateThread("Thread-1", (void *)&threadFunction, 0x12, 0x10000, 0, NULL);
	threads[2] = sceKernelCreateThread("Thread-2", (void *)&threadFunction, 0x12, 0x10000, 0, NULL);
	threads[3] = sceKernelCreateThread("Thread-3", (void *)&threadFunction, 0x12, 0x10000, 0, NULL);
	threads[4] = sceKernelCreateThread("Thread-4", (void *)&threadFunction2, 0x12, 0x10000, 0, NULL);
	
	schedf("VALUE-INVARIANT:%d\n", check_not_update_value);
	
	sceKernelStartThread(threads[0], 1, (void*)&test[1]);
	sceKernelStartThread(threads[1], 2, NULL);
	sceKernelStartThread(threads[2], 0, (void*)&test[0]);
	sceKernelStartThread(threads[3], sizeof(int), (void*)&test[4]);
	sceKernelStartThread(threads[4], sizeof(int), &check_not_update_value);

	sceKernelDelayThread(10 * 1000);
	
	schedf("---\n");
	sceKernelReferSemaStatus(sema, &info);
	PRINT_SEMAPHORE(sema, info);
	schedf("---\n");
	sceKernelSignalSema(sema, 1);
	
	sceKernelDelayThread(10 * 1000);

	schedf("---\n");
	sceKernelReferSemaStatus(sema, &info);
	PRINT_SEMAPHORE(sema, info);
	schedf("---\n");

	sceKernelSignalSema(sema, 1);
	
	sceKernelDelayThread(10 * 1000);

	schedf("---\n");
	sceKernelReferSemaStatus(sema, &info);
	PRINT_SEMAPHORE(sema, info);
	schedf("---\n");
	
	result = sceKernelDeleteSema(sema);
	schedf("%08X\n", result);
	result = sceKernelDeleteSema(sema);
	schedf("%08X\n", result);
	
	schedf("VALUE-INVARIANT:%d\n", check_not_update_value);
	flushschedf();
	
	return 0;
}
开发者ID:HomerSp,项目名称:pspautotests,代码行数:58,代码来源:semaphores.c


示例4: psp_audio_init

void
psp_audio_init()
{
  psp_audio_chid = sceAudioChReserve(-1, 1024, 0);
  psp_audio_thid = sceKernelCreateThread( "audio_thread",(void*)&psp_audio_thread,0x12,0x10000,0,NULL);
	sceKernelStartThread( psp_audio_thid, 0, 0);

  MP3_Init();

  psp_cdaudio_chid = sceAudioChReserve(-1, 1024, 0);
  psp_cdaudio_thid = sceKernelCreateThread( "cdaudio_thread",(void*)&psp_cdaudio_thread,0x12,0x10000,0,NULL);
	sceKernelStartThread( psp_cdaudio_thid, 0, 0);
}
开发者ID:kerheol,项目名称:dingux-hugo,代码行数:13,代码来源:psp_audio.c


示例5: xSetupCallbacks

extern int xSetupCallbacks()
{
    int thid = sceKernelCreateThread("xCallbackThread", xCallbackThread, 0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0);
    if(thid >= 0) sceKernelStartThread(thid, 0, 0);
    x_running = 1;
    return thid;
}
开发者ID:Falaina,项目名称:cspspemu,代码行数:7,代码来源:xlib.c


示例6: kernel_loadExec

int kernel_loadExec(const char *file, int argc, char** argv)
{
	u32 k1;
	k1 = pspSdkSetK1(0);
	
	// Store file name
	strcpy(exefile, file);
	
	// Concat argument strings
	paramlength = 0;
	
	// argv[0]
	strcpy(parameters, file);
	paramlength = strlen(file) + 1;
	
	// Rest of the arguments
	int i;
	for (i = 0; i < argc; i++)
	{
	  strcpy(&parameters[paramlength], argv[i]);
	  paramlength += (strlen(argv[i]) + 1);
	}
	
    SceUID thid = sceKernelCreateThread("launcher_thread", launcher_thread, 0x20, 0xFA0, 0, 0);
    if (thid > -1)
      thid = sceKernelStartThread(thid, 0, 0);
	
	pspSdkSetK1(k1);
	return 0;
}
开发者ID:AlanDrake,项目名称:ags,代码行数:30,代码来源:main.c


示例7: testCheckStackLayout

void testCheckStackLayout(const char *title, int argSize, u32 attr) {
	char argLengthTemp[0x1000];
	memset(argLengthTemp, 0xAB, sizeof(argLengthTemp));

	// First create the thread to wipe the stack area, that way we can see what it'd look like clean.
	SceUID stackCheckThread = sceKernelCreateThread("stackCheck", &stackCheckFunc, 0x10, 0x1000, attr, NULL);
	stackCheckInfo.size = sizeof(stackCheckInfo);
	sceKernelReferThreadStatus(stackCheckThread, &stackCheckInfo);
	sceKernelTerminateDeleteThread(stackCheckThread);
	memset(stackCheckInfo.stack, 0xCC, stackCheckInfo.stackSize);

	stackCheckName = title;
	stackCheckThread = sceKernelCreateThread("stackCheck", &stackCheckFunc, 0x10, 0x1000, attr, NULL);
	sceKernelStartThread(stackCheckThread, argSize, argLengthTemp);
	sceKernelWaitThreadEnd(stackCheckThread, NULL);

	u32 *stack = (u32 *) stackCheckInfo.stack;
	stack[1] = 0xFF1337FF;

	sceKernelTerminateDeleteThread(stackCheckThread);

	if (stack[1] != 0xFF1337FF) {
		schedf("    %s: WARNING: stack cleared to something after delete: %08x.\n", stackCheckName, stack[1]);
	}

	checkpoint("%s", title);
}
开发者ID:Raimoo,项目名称:pspautotests,代码行数:27,代码来源:start.c


示例8: initDisp

void initDisp()
{
  // Load images
  img.back = loadImage("graphics/back.png",G2D_SWIZZLE);
  img.tileset = loadImage("graphics/tileset.png",G2D_SWIZZLE);
  img.gsquare = loadImage("./graphics/gsquare.png",G2D_SWIZZLE);
  img.banner = loadImage("./graphics/genesis.png",G2D_SWIZZLE);
  // Init libraries
  intraFontInit();
  font = intraFontLoad("flash0:/font/ltn8.pgf",INTRAFONT_CACHE_MED);
  bigfont = intraFontLoad("flash0:/font/ltn0.pgf",INTRAFONT_CACHE_MED);
  seriffont = intraFontLoad("flash0:/font/ltn1.pgf",INTRAFONT_CACHE_MED);
  intraFontSetEncoding(font,INTRAFONT_STRING_UTF8);
  intraFontSetEncoding(bigfont,INTRAFONT_STRING_UTF8);
  intraFontSetEncoding(seriffont,INTRAFONT_STRING_UTF8);
  // Start display thread
  SceUID thid = sceKernelCreateThread("disp_thread",dispThread,0x10,0x1000,
                                      THREAD_ATTR_USER | THREAD_ATTR_VFPU,0);
  if (thid < 0)
  {
    throwException("Can't create the display thread\n");
  }
  if (sceKernelStartThread(thid,0,0))
  {
    throwException("Can't start the display thread\n");
  }
}
开发者ID:IgorMac,项目名称:gSquare,代码行数:27,代码来源:disp.c


示例9: module_start

/* Entry point */
int module_start(SceSize args, void *argp)
{
	int thid;
	int retv;

	retv = sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
	if(retv){
		return 0;
	}
	retv = sceUsbStart(HOSTFSDRIVER_NAME, 0, 0);
	if(retv){
		return 0;
	}
	retv = sceUsbActivate(HOSTFSDRIVER_PID);

	usbAsyncRegister(ASYNC_SHELL, &g_endp);
	usbAsyncRegister(ASYNC_STDOUT, &g_stdin);
	usbWaitForConnect();

	retv = stdioTtyInit();
	stdioInstallStdoutHandler(usbStdoutPrint);
	stdioInstallStderrHandler(usbStderrPrint);

	printk("Usbshell Start!\n");

	/* Create a high priority thread */
	thid = sceKernelCreateThread("USBShell", main_thread, 12, 0x2000, 0, NULL);
	if(thid >= 0)
	{
		sceKernelStartThread(thid, args, argp);
	}
	return 0;
}
开发者ID:yin8086,项目名称:psplinkusb,代码行数:34,代码来源:main.c


示例10: setup_callbacks

static void setup_callbacks (void)
{
     extern void directfb_dummy(void);
     extern void directfbwm_default(void);
//     extern void IDirectFBImageProvider_DFIFF_ctor(void);
     extern void IDirectFBImageProvider_GIF_ctor(void);
     extern void IDirectFBImageProvider_JPEG_ctor(void);
     extern void IDirectFBImageProvider_PNG_ctor(void);
//     extern void IDirectFBFont_DGIFF_ctor(void);
//     extern void IDirectFBFont_FT2_ctor(void);

     directfb_dummy();
     directfbwm_default();
//     IDirectFBImageProvider_DFIFF_ctor();
     IDirectFBImageProvider_GIF_ctor();
     IDirectFBImageProvider_JPEG_ctor();
     IDirectFBImageProvider_PNG_ctor();
//     IDirectFBFont_DGIFF_ctor();
//     IDirectFBFont_FT2_ctor();


	int id;

	if ((id = sceKernelCreateThread("update_thread", update_thread, 0x11, 0xFA0, 0, 0)) >= 0)
		sceKernelStartThread(id, 0, 0);
}
开发者ID:Distrotech,项目名称:DirectFB,代码行数:26,代码来源:psp-setup.c


示例11: MP3ME_Load

int MP3ME_Load(char *fileName){
    MP3ME_filePos = 0;
    MP3ME_playingSpeed = 0;
    MP3ME_isPlaying = 0;

    getcwd(audioCurrentDir, 256);

    //initFileInfo(&MP3ME_info);
    strcpy(MP3ME_fileName, fileName);
    if (MP3MEgetInfo() != 0){
        strcpy(MP3ME_fileName, "");
        return ERROR_OPENING;
    }

    releaseAudio();
    if (setAudioFrequency(OUTPUT_BUFFER_SIZE/4, MP3ME_info.hz, 2) < 0){
        MP3ME_End();
        return ERROR_INVALID_SAMPLE_RATE;
    }

    MP3ME_thid = -1;
    MP3ME_eof = 0;
    MP3ME_thid = sceKernelCreateThread("decodeThread", decodeThread, THREAD_PRIORITY, DEFAULT_THREAD_STACK_SIZE, PSP_THREAD_ATTR_USER, NULL);
    if(MP3ME_thid < 0)
        return ERROR_CREATE_THREAD;

    sceKernelStartThread(MP3ME_thid, 0, NULL);
    return OPENING_OK;
}
开发者ID:DavisDev,项目名称:lightmp3,代码行数:29,代码来源:mp3playerME.c


示例12: sizeof

static void *psp_audio_init(const char *device,
      unsigned rate, unsigned latency)
{
   psp1_audio_t* psp;
   
   (void)device;
   (void)latency;

  psp = (psp1_audio_t*)calloc(1, sizeof(psp1_audio_t));

   if (!psp)
      return NULL;

   /* Cache aligned, not necessary but helpful. */
   psp->buffer      = (uint32_t*)
      memalign(64, AUDIO_BUFFER_SIZE * sizeof(uint32_t));
   memset(psp->buffer, 0, AUDIO_BUFFER_SIZE * sizeof(uint32_t));

   psp->zeroBuffer  = (uint32_t*)
      memalign(64, AUDIO_OUT_COUNT   * sizeof(uint32_t));
   memset(psp->zeroBuffer, 0, AUDIO_OUT_COUNT * sizeof(uint32_t));

   psp->readPos     = 0;
   psp->writePos    = 0;
   psp->rate        = rate;
   psp->thread      = sceKernelCreateThread
      ("audioMainLoop", audioMainLoop, 0x08, 0x10000, 0, NULL);
   psp->nonblocking = false;

   psp->running     = true;
   sceKernelStartThread(psp->thread, sizeof(psp1_audio_t*), &psp);

   return psp;
}
开发者ID:CautiousAlbino,项目名称:RetroArch,代码行数:34,代码来源:psp1_audio.c


示例13: SetupCallbacks

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
    int thid = 0;
    thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, PSP_THREAD_ATTR_USER, 0);
    if(thid >= 0)
        sceKernelStartThread(thid, 0, 0);
    return thid;
}
开发者ID:pspdevelopment,项目名称:PSPDrone05Rel,代码行数:8,代码来源:main.c


示例14: _start

/**
 * Startup thread
 *
 * Creates the main program thread based on variables defined by the program.
 *
 * @param args - Size (in bytes) of arguments passed to the program by the kernel.
 * @param argp - Pointer to arguments passed by the kernel.
 */
int _start(SceSize args, void *argp)
{
	if (&sce_newlib_nocreate_thread_in_start != NULL) {
		/* The program does not want main() to be run in a seperate thread. */
		_main(args, argp);
		return 1;
	}

	int priority = DEFAULT_THREAD_PRIORITY;
	unsigned int attribute = DEFAULT_THREAD_ATTRIBUTE;
	unsigned int stackSize = DEFAULT_THREAD_STACK_KB_SIZE * 1024;
	const char *threadName = DEFAULT_MAIN_THREAD_NAME;

	if (&sce_newlib_priority != NULL) {
		priority = sce_newlib_priority;
	}
	if (&sce_newlib_attribute != NULL) {
		attribute = sce_newlib_attribute;
	}
	if (&sce_newlib_stack_kb_size != NULL) {
		stackSize = sce_newlib_stack_kb_size * 1024;
	}
	if (&sce_newlib_main_thread_name != NULL) {
		threadName = sce_newlib_main_thread_name;
	}

	SceUID thid;
	thid = sceKernelCreateThread(threadName, (void *) _main, priority, stackSize, attribute, 0);
	sceKernelStartThread(thid, args, argp);

	return 0;
}
开发者ID:CDragu,项目名称:pspsdk,代码行数:40,代码来源:crt0_prx.c


示例15: testTryAllocThread

void testTryAllocThread(const char *title, u32 attr, u32 requestBytes, u32 initialBytes) {
	schedf("%s: ", title);

	SceUID vpl = sceKernelCreateVpl("vpl", PSP_MEMORY_PARTITION_USER, attr, 0x100, NULL);

	// This way we have some allocated + free.
	void *data;
	sceKernelAllocateVpl(vpl, initialBytes, &data, NULL);

	SceUID allocThread = sceKernelCreateThread("allocThread", &allocFunc, 0x12, 0x1000, 0, NULL);
	sceKernelStartThread(allocThread, sizeof(SceUID), &vpl);
	sceKernelDelayThread(400);

	int result = sceKernelTryAllocateVpl(vpl, requestBytes, &data);
	schedf("L2 ");
	sceKernelDelayThread(600);

	sceKernelDeleteVpl(vpl);
	sceKernelWaitThreadEnd(allocThread, NULL);
	sceKernelTerminateDeleteThread(allocThread);

	if (result == 0) {
		schedf("OK (thread=%08X)\n", schedulingResult);
	} else {
		schedf("Failed (thread=%08X, main=%08X)\n", schedulingResult, result);
	}
}
开发者ID:JulianoAmaralChaves,项目名称:pspautotests,代码行数:27,代码来源:try.c


示例16: psp_init

void psp_init(void)
{
	SceUID thid;
	char buff[128], *r;

	/* fw 1.5 sometimes returns 8002032c, although getcwd works */
	r = getcwd(buff, sizeof(buff));
	if (r) sceIoChdir(buff);

	main_thread_id = sceKernelGetThreadId();

	lprintf("running on %08x kernel\n", sceKernelDevkitVersion()),
	lprintf("entered psp_init, threadId %08x, priority %i\n", main_thread_id,
		sceKernelGetThreadCurrentPriority());

	thid = sceKernelCreateThread("update_thread", callback_thread, 0x11, 0xFA0, 0, NULL);
	if (thid >= 0)
	{
		sceKernelStartThread(thid, 0, 0);
	}

	/* video */
	sceDisplaySetMode(0, 480, 272);
	sceDisplaySetFrameBuf(VRAM_FB1, 512, PSP_DISPLAY_PIXEL_FORMAT_565, PSP_DISPLAY_SETBUF_NEXTFRAME);
	current_screen = 1;
	psp_screen = VRAM_FB0;

	/* gu */
	sceGuInit();

	sceGuStart(GU_DIRECT, guCmdList);
	sceGuDrawBuffer(GU_PSM_5650, (void *)VRAMOFFS_FB0, 512);
	sceGuDispBuffer(480, 272, (void *)VRAMOFFS_FB1, 512); // don't care
	sceGuClear(GU_COLOR_BUFFER_BIT | GU_DEPTH_BUFFER_BIT);
	sceGuDepthBuffer((void *)VRAMOFFS_DEPTH, 512);
	sceGuOffset(2048 - (480 / 2), 2048 - (272 / 2));
	sceGuViewport(2048, 2048, 480, 272);
	sceGuDepthRange(0xc350, 0x2710);
	sceGuScissor(0, 0, 480, 272);
	sceGuEnable(GU_SCISSOR_TEST);

	sceGuDepthMask(0xffff);
	sceGuDisable(GU_DEPTH_TEST);

	sceGuFrontFace(GU_CW);
	sceGuEnable(GU_TEXTURE_2D);
	sceGuTexFunc(GU_TFX_REPLACE, GU_TCC_RGB);
	sceGuAmbientColor(0xffffffff);
	sceGuColor(0xffffffff);
	sceGuFinish();
	sceGuSync(0, 0);

	sceDisplayWaitVblankStart();
	sceGuDisplay(GU_TRUE);


	/* input */
	sceCtrlSetSamplingCycle(0);
	sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
}
开发者ID:DSJim,项目名称:genesis4iphone,代码行数:60,代码来源:psp.c


示例17: psp_audio_start

static bool psp_audio_start(void *data)
{
    psp_audio_t* psp = (psp_audio_t*)data;

#if defined(VITA)
    SceKernelThreadInfo info;

    info.size = sizeof(SceKernelThreadInfo);

    if (sceKernelGetThreadInfo(
                psp->thread, &info) < 0) /* Error */
        return false;

    if (info.status != PSP2_THREAD_STOPPED)
        return false;

#else
    SceKernelThreadRunStatus runStatus;

    runStatus.size    = sizeof(SceKernelThreadRunStatus);

    if (sceKernelReferThreadRunStatus(
                psp->thread, &runStatus) < 0) /* Error */
        return false;
    if (runStatus.status != PSP_THREAD_STOPPED)
        return false;

#endif

    psp->running = true;

    sceKernelStartThread(psp->thread, sizeof(psp_audio_t*), &psp);

    return true;
}
开发者ID:jwdehart,项目名称:RetroArch,代码行数:35,代码来源:psp_audio.c


示例18: main

int main(int argc, char *argv[]) {
	testMemcpy("sceDmacMemcpy", &sceDmacMemcpy);
	testMemcpy("sceDmacTryMemcpy", &sceDmacTryMemcpy);

	checkpointNext("Size of copy:");
	// Approximate speed: 225 MB/s.
	checkpoint("  sceDmacMemcpy 1MB: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x00100000));
	checkpoint("  sceDmacTryMemcpy 1MB: %08x", sceDmacTryMemcpy((void*)0x04000000, (void*)0x04100000, 0x00100000));
	checkpoint("  sceDmacMemcpy 1KB: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x00000400));
	checkpoint("  sceDmacMemcpy 512B: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x00000200));
	// This is suspiciously consistent, but maybe it's just chance.
	checkpoint("  sceDmacMemcpy 272B: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x00000110));
	checkpoint("  sceDmacMemcpy 271B: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x0000010F));
	checkpoint("  sceDmacMemcpy 257B: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x00000101));
	checkpoint("  sceDmacMemcpy 256B: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x00000100));
	
	checkpointNext("Concurrent copies:");
	SceUID copyThread = sceKernelCreateThread("dmac", &dmacCopyFunc, 0x10, 0x1000, 0, NULL);
	sceKernelStartThread(copyThread, 0, NULL);
	checkpoint("  sceDmacTryMemcpy 1MB: %08x", sceDmacTryMemcpy((void*)0x04000000, (void*)0x04100000, 0x00100000));
	checkpoint("  sceDmacMemcpy 1MB: %08x", sceDmacMemcpy((void*)0x04000000, (void*)0x04100000, 0x00100000));

	checkpointNext("memalign:");
	void *ptr;
	ptr = memalign(128 , 2048); checkpoint("%d", ((int)ptr) % 128);
	ptr = memalign(1024, 2048); checkpoint("%d", ((int)ptr) % 1024);
	//ptr = memalign(100 , 2048); checkpoint("%d", ((int)ptr) % 100);

	//checkpoint("%i bytes available", oslGetRamStatus().maxAvailable);

	return 0;
}
开发者ID:KentuckyCompass,项目名称:pspautotests,代码行数:32,代码来源:dmactest.c


示例19: sceUtilityLoadNetModule

int JNetwork::connect(const string& serverIP) {
#ifdef NETWORK_SUPPORT
    int err;
    char buffer[4096];
    if(netthread) return 0;


    sceUtilityLoadNetModule(1);
    sceUtilityLoadNetModule(3);

    if((err = pspSdkInetInit())) {
        sprintf(buffer, "JGE Error, could not initialise the network %08X", err);
        printf(buffer);
        printf("\n");
        error = buffer;
        return err;
    }

    if(JNetwork::connect_to_apctl(1)) {
        JNetwork::serverIP = serverIP;
        /* Create a user thread to do the real work */
        netthread = sceKernelCreateThread("net_thread", net_thread, 0x18, 0x10000, PSP_THREAD_ATTR_USER, NULL);

        if(netthread < 0)
        {
            printf("Error, could not create thread\n");
            sceKernelSleepThread();
        }

        sceKernelStartThread(netthread, 0, NULL);
        return netthread;
    }
#endif
    return 0;
}
开发者ID:173210,项目名称:w-menu,代码行数:35,代码来源:JNetwork.cpp


示例20: main

int main(int argc, char **argv) {
	LOCK_TEST("Lock 0 => 0", PSP_MUTEX_ATTR_FIFO, 0, 0);
	LOCK_TEST("Lock 0 => 1", PSP_MUTEX_ATTR_FIFO, 0, 1);
	LOCK_TEST("Lock 0 => 2", PSP_MUTEX_ATTR_FIFO, 0, 2);
	LOCK_TEST("Lock 0 => -1", PSP_MUTEX_ATTR_FIFO, 0, -1);
	LOCK_TEST("Lock 1 => 1", PSP_MUTEX_ATTR_FIFO, 1, 1);
	LOCK_TEST("Lock 0 => 2 (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, 0, 2);
	LOCK_TEST("Lock 0 => -1 (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, 0, -1);
	LOCK_TEST("Lock 1 => 1 (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, 1, 1);
	LOCK_TEST("Lock 1 => INT_MAX - 1 (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, 1, INT_MAX - 1);
	LOCK_TEST("Lock 1 => INT_MAX (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, 1, INT_MAX);
	LOCK_TEST("Lock INT_MAX => INT_MAX (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, INT_MAX, INT_MAX);

	SceUID lockThread = CREATE_SIMPLE_THREAD(lockFunc);
	LOCK_TEST_THREAD("Locked 1 => 1", PSP_MUTEX_ATTR_FIFO, 1, 1);
	LOCK_TEST_THREAD("Locked 0 => 1", PSP_MUTEX_ATTR_FIFO, 0, 1);
	LOCK_TEST_THREAD("Locked 1 => 1 (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, 1, 1);
	LOCK_TEST_THREAD("Locked 0 => 1 (recursive)", PSP_MUTEX_ATTR_ALLOW_RECURSIVE, 0, 1);

	// Probably we can't manage to delete it at the same time.
	SceUID deleteThread = CREATE_SIMPLE_THREAD(deleteMeFunc);
	SceUID mutex = sceKernelCreateMutex("lock", 0, 1, NULL);
	sceKernelStartThread(deleteThread, sizeof(int), &mutex);
	sceKernelDeleteMutex(mutex);

	LOCK_TEST_SIMPLE("NULL => 0", 0, 0);
	LOCK_TEST_SIMPLE("NULL => 1", 0, 1);
	LOCK_TEST_SIMPLE("Invalid => 1", 0xDEADBEEF, 1);
	LOCK_TEST_SIMPLE("Deleted => 1", mutex, 1);
	
	BASIC_SCHED_TEST("NULL",
		result = sceKernelTryLockMutex(0, 1);
	);
开发者ID:HomerSp,项目名称:pspautotests,代码行数:33,代码来源:try.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ scene函数代码示例发布时间:2022-05-30
下一篇:
C++ sceKernelSleepThreadCB函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap