您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ usToCycles函数代码示例

51自学网 2021-06-03 09:17:47
  C++
这篇教程C++ usToCycles函数代码示例写得很实用,希望能帮到您。

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

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

示例1: __CtrlTimerUpdate

void __CtrlTimerUpdate(u64 userdata, int cyclesLate){	// This only runs in timer mode (ctrlCycle > 0.)	_dbg_assert_msg_(SCECTRL, ctrlCycle > 0, "Ctrl: sampling cycle should be > 0");	__CtrlDoSample();	CoreTiming::ScheduleEvent(usToCycles(ctrlCycle), ctrlTimer, 0);}
开发者ID:716Girl,项目名称:ppsspp,代码行数:8,


示例2: StartImpl

ResultCode Applet::Start(const Service::APT::AppletStartupParameter& parameter) {    ResultCode result = StartImpl(parameter);    if (result.IsError())        return result;    // Schedule the update event    CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us), applet_update_event, static_cast<u64>(id));    return result;}
开发者ID:IwantToPlaySo-iMergeToFork,项目名称:citra,代码行数:8,


示例3: __KernelScheduleVTimer

void __KernelScheduleVTimer(VTimer *vt, u64 schedule) {	CoreTiming::UnscheduleEvent(vtimerTimer, vt->GetUID());	vt->nvt.schedule = schedule;	if (vt->nvt.active == 1 && vt->nvt.handlerAddr != 0)		CoreTiming::ScheduleEvent(usToCycles(vt->nvt.schedule), vtimerTimer, vt->GetUID());}
开发者ID:CrymsonZX,项目名称:ppsspp,代码行数:8,


示例4: ReapplyGfxState

void EmuScreen::render() {	if (invalid_)		return;	// Reapply the graphics state of the PSP	ReapplyGfxState();	// We just run the CPU until we get to vblank. This will quickly sync up pretty nicely.	// The actual number of cycles doesn't matter so much here as we will break due to CORE_NEXTFRAME, most of the time hopefully...	int blockTicks = usToCycles(1000000 / 10);	// Run until CORE_NEXTFRAME	while (coreState == CORE_RUNNING) {		u64 nowTicks = CoreTiming::GetTicks();		mipsr4k.RunLoopUntil(nowTicks + blockTicks);	}	// Hopefully coreState is now CORE_NEXTFRAME	if (coreState == CORE_NEXTFRAME) {		// set back to running for the next frame		coreState = CORE_RUNNING;	} else if (coreState == CORE_POWERDOWN)	{		ILOG("SELF-POWERDOWN!");		screenManager()->switchScreen(new MenuScreen());	}	if (invalid_)		return;	if (g_Config.bBufferedRendering)		fbo_unbind();	UIShader_Prepare();	uiTexture->Bind(0);	glstate.viewport.set(0, 0, pixel_xres, pixel_yres);	glstate.viewport.restore();	ui_draw2d.Begin(UIShader_Get(), DBMODE_NORMAL);	if (g_Config.bShowTouchControls)		DrawGamepad(ui_draw2d);	DrawWatermark();	glsl_bind(UIShader_Get());	ui_draw2d.End();	ui_draw2d.Flush();	// Tiled renderers like PowerVR should benefit greatly from this. However - seems I can't call it?#if defined(USING_GLES2)	bool hasDiscard = false;  // TODO	if (hasDiscard) {		//glDiscardFramebuffer(GL_COLOR_EXT | GL_DEPTH_EXT | GL_STENCIL_EXT);	}#endif}
开发者ID:iattilagy,项目名称:ppsspp,代码行数:58,


示例5: __KernelSetSemaTimeout

void __KernelSetSemaTimeout(Semaphore *s, u32 timeoutPtr){	if (timeoutPtr == 0 || semaWaitTimer == 0)		return;	// This should call __KernelMutexTimeout() later, unless we cancel it.	int micro = (int) Memory::Read_U32(timeoutPtr);	CoreTiming::ScheduleEvent(usToCycles(micro), semaWaitTimer, __KernelGetCurThread());}
开发者ID:btsantos,项目名称:ppsspp,代码行数:9,


示例6: __KernelScheduleVTimer

void __KernelScheduleVTimer(VTimer *vt, u64 schedule) {	CoreTiming::UnscheduleEvent(vtimerTimer, vt->GetUID());	vt->nvt.schedule = schedule;	if (vt->nvt.active == 1)		// this delay makes the test pass, not sure if it's right		CoreTiming::ScheduleEvent(usToCycles(vt->nvt.schedule + 372), vtimerTimer, vt->GetUID());}
开发者ID:DJHartley,项目名称:ppsspp,代码行数:9,


示例7: __KernelWaitLwMutex

void __KernelWaitLwMutex(LwMutex *mutex, u32 timeoutPtr){	if (timeoutPtr == 0 || lwMutexWaitTimer == 0)		return;	// This should call __KernelMutexTimeout() later, unless we cancel it.	int micro = (int) Memory::Read_U32(timeoutPtr);	CoreTiming::ScheduleEvent(usToCycles(micro), lwMutexWaitTimer, __KernelGetCurThread());}
开发者ID:fluffyfreak,项目名称:ppsspp,代码行数:9,


示例8: __KernelUmdActivate

void __KernelUmdActivate(){	u32 notifyArg = PSP_UMD_PRESENT | PSP_UMD_READABLE;	__KernelNotifyCallbackType(THREAD_CALLBACK_UMD, -1, notifyArg);	// Don't activate immediately, take time to "spin up."	CoreTiming::RemoveAllEvents(umdStatChangeEvent);	CoreTiming::ScheduleEvent(usToCycles(MICRO_DELAY_ACTIVATE), umdStatChangeEvent, 1);}
开发者ID:KrisLee,项目名称:ppsspp,代码行数:9,


示例9: __UmdWaitStat

void __UmdWaitStat(u32 timeout){	// This happens to be how the hardware seems to time things.	if (timeout <= 4)		timeout = 15;	else if (timeout <= 215)		timeout = 250;	CoreTiming::ScheduleEvent(usToCycles((int) timeout), umdStatTimeoutEvent, __KernelGetCurThread());}
开发者ID:KrisLee,项目名称:ppsspp,代码行数:10,


示例10: Cancel

void Timer::Set(s64 initial, s64 interval) {    // Ensure we get rid of any previous scheduled event    Cancel();    initial_delay = initial;    interval_delay = interval;    u64 initial_microseconds = initial / 1000;    CoreTiming::ScheduleEvent(usToCycles(initial_microseconds), timer_callback_event_type,                              callback_handle);}
开发者ID:JamePeng,项目名称:citra,代码行数:11,


示例11: hleDelayResult

u32 hleDelayResult(u32 result, const char *reason, int usec){	if (__KernelIsDispatchEnabled())	{		CoreTiming::ScheduleEvent(usToCycles(usec), delayedResultEvent, __KernelGetCurThread());		__KernelWaitCurThread(WAITTYPE_HLEDELAY, 1, result, 0, false, reason);	}	else		WARN_LOG(HLE, "Dispatch disabled, not delaying HLE result (right thing to do?)");	return result;}
开发者ID:AbandonedCart,项目名称:PPSSPPXperia,代码行数:11,


示例12: sceKernelSetSysClockAlarm

SceUID sceKernelSetSysClockAlarm(u32 microPtr, u32 handlerPtr, u32 commonPtr){	u64 micro;	if (Memory::IsValidAddress(microPtr))		micro = Memory::Read_U64(microPtr);	else		return -1;	DEBUG_LOG(HLE, "sceKernelSetSysClockAlarm(%lld, %08x, %08x)", micro, handlerPtr, commonPtr);	return __KernelSetAlarm(usToCycles(micro), handlerPtr, commonPtr);}
开发者ID:Ced2911,项目名称:ppsspp,代码行数:12,


示例13: __UmdWaitStat

void __UmdWaitStat(u32 timeout){	if (umdStatTimer == 0)		umdStatTimer = CoreTiming::RegisterEvent("MutexTimeout", &__UmdStatTimeout);	// This happens to be how the hardware seems to time things.	if (timeout <= 4)		timeout = 15;	else if (timeout <= 215)		timeout = 250;	CoreTiming::ScheduleEvent(usToCycles((int) timeout), umdStatTimer, __KernelGetCurThread());}
开发者ID:Falaina,项目名称:ppsspp,代码行数:13,


示例14: __KernelUmdActivate

static void __KernelUmdActivate(){	u32 notifyArg = PSP_UMD_PRESENT | PSP_UMD_READABLE;	// PSP_UMD_READY will be returned when sceKernelGetCompiledSdkVersion() != 0	if (sceKernelGetCompiledSdkVersion() != 0) {		notifyArg |= PSP_UMD_READY;	}	if (driveCBId != 0)		__KernelNotifyCallback(driveCBId, notifyArg);	// Don't activate immediately, take time to "spin up."	CoreTiming::RemoveAllEvents(umdStatChangeEvent);	CoreTiming::ScheduleEvent(usToCycles(MICRO_DELAY_ACTIVATE), umdStatChangeEvent, 1);}
开发者ID:AdmiralCurtiss,项目名称:ppsspp,代码行数:14,


示例15: LOG_TRACE

void Timer::Signal(int cycles_late) {    LOG_TRACE(Kernel, "Timer %u fired", GetObjectId());    signaled = true;    // Resume all waiting threads    WakeupAllWaitingThreads();    if (interval_delay != 0) {        // Reschedule the timer with the interval delay        u64 interval_microseconds = interval_delay / 1000;        CoreTiming::ScheduleEvent(usToCycles(interval_microseconds) - cycles_late,                                  timer_callback_event_type, callback_handle);    }}
开发者ID:JayFoxRox,项目名称:citra,代码行数:15,


示例16: DisplayWaitForVblanks

static int DisplayWaitForVblanks(const char *reason, int vblanks, bool callbacks = false) {	const s64 ticksIntoFrame = CoreTiming::GetTicks() - frameStartTicks;	const s64 cyclesToNextVblank = msToCycles(frameMs) - ticksIntoFrame;	// These syscalls take about 115 us, so if the next vblank is before then, we're waiting extra.	// At least, on real firmware a wait >= 16500 into the frame will wait two.	if (cyclesToNextVblank <= usToCycles(115)) {		++vblanks;	}	vblankWaitingThreads.push_back(WaitVBlankInfo(__KernelGetCurThread(), vblanks));	__KernelWaitCurThread(WAITTYPE_VBLANK, 1, 0, 0, callbacks, reason);	return hleLogSuccessVerboseI(SCEDISPLAY, 0, "waiting for %d vblanks", vblanks);}
开发者ID:RisingFog,项目名称:ppsspp,代码行数:15,


示例17: Cancel

void Timer::Set(s64 initial, s64 interval) {    // Ensure we get rid of any previous scheduled event    Cancel();    initial_delay = initial;    interval_delay = interval;    if (initial == 0) {        // Immediately invoke the callback        Signal(0);    } else {        u64 initial_microseconds = initial / 1000;        CoreTiming::ScheduleEvent(usToCycles(initial_microseconds), timer_callback_event_type,                                  callback_handle);    }}
开发者ID:JayFoxRox,项目名称:citra,代码行数:16,


示例18: __KernelSetEventFlagTimeout

void __KernelSetEventFlagTimeout(EventFlag *e, u32 timeoutPtr){	if (timeoutPtr == 0 || eventFlagWaitTimer == 0)		return;	int micro = (int) Memory::Read_U32(timeoutPtr);	// This seems like the actual timing of timeouts on hardware.	if (micro <= 1)		micro = 5;	else if (micro <= 209)		micro = 240;	// This should call __KernelEventFlagTimeout() later, unless we cancel it.	CoreTiming::ScheduleEvent(usToCycles(micro), eventFlagWaitTimer, __KernelGetCurThread());}
开发者ID:ChrisAldama,项目名称:ppsspp,代码行数:16,


示例19: AppletUpdateEvent

/// Handles updating the current Applet every time it's called.static void AppletUpdateEvent(u64 applet_id, int cycles_late) {    Service::APT::AppletId id = static_cast<Service::APT::AppletId>(applet_id);    std::shared_ptr<Applet> applet = Applet::Get(id);    ASSERT_MSG(applet != nullptr, "Applet doesn't exist! applet_id=%08X", id);    applet->Update();    // If the applet is still running after the last update, reschedule the event    if (applet->IsRunning()) {        CoreTiming::ScheduleEvent(usToCycles(applet_update_interval_us) - cycles_late,            applet_update_event, applet_id);    } else {        // Otherwise the applet has terminated, in which case we should clean it up        applets[id] = nullptr;    }}
开发者ID:IwantToPlaySo-iMergeToFork,项目名称:citra,代码行数:17,


示例20: __KernelWaitMbx

void __KernelWaitMbx(Mbx *m, u32 timeoutPtr){	if (timeoutPtr == 0 || mbxWaitTimer == -1)		return;	int micro = (int) Memory::Read_U32(timeoutPtr);	// This seems to match the actual timing.	if (micro <= 2)		micro = 10;	else if (micro <= 209)		micro = 250;	// This should call __KernelMbxTimeout() later, unless we cancel it.	CoreTiming::ScheduleEvent(usToCycles(micro), mbxWaitTimer, __KernelGetCurThread());}
开发者ID:Summeli,项目名称:ppsspp,代码行数:16,


示例21: __KernelSetSemaTimeout

void __KernelSetSemaTimeout(Semaphore *s, u32 timeoutPtr){	if (timeoutPtr == 0 || semaWaitTimer == -1)		return;	int micro = (int) Memory::Read_U32(timeoutPtr);	// This happens to be how the hardware seems to time things.	if (micro <= 3)		micro = 15;	else if (micro <= 249)		micro = 250;	// This should call __KernelSemaTimeout() later, unless we cancel it.	CoreTiming::ScheduleEvent(usToCycles(micro), semaWaitTimer, __KernelGetCurThread());}
开发者ID:HomerSp,项目名称:ppsspp,代码行数:16,


示例22: __KernelSetMsgPipeTimeout

static bool __KernelSetMsgPipeTimeout(u32 timeoutPtr){	if (timeoutPtr == 0 || waitTimer == -1)		return true;	int micro = (int) Memory::Read_U32(timeoutPtr);	if (micro <= 2)	{		// Don't wait or reschedule, just timeout immediately.		return false;	}	if (micro <= 210)		micro = 250;	CoreTiming::ScheduleEvent(usToCycles(micro), waitTimer, __KernelGetCurThread());	return true;}
开发者ID:libretro,项目名称:PSP1,代码行数:17,


示例23: __DmacMemcpy

int __DmacMemcpy(u32 dst, u32 src, u32 size) {	Memory::Memcpy(dst, Memory::GetPointer(src), size);	src &= ~0x40000000;	dst &= ~0x40000000;	if (Memory::IsVRAMAddress(src) || Memory::IsVRAMAddress(dst)) {		gpu->UpdateMemory(dst, src, size);	}	// This number seems strangely reproducible.	if (size >= 272) {		// Approx. 225 MiB/s or 235929600 B/s, so let's go with 236 B/us.		int delayUs = size / 236;		dmacMemcpyDeadline = CoreTiming::GetTicks() + usToCycles(delayUs);		return hleDelayResult(0, "dmac copy", delayUs);	}	return 0;}
开发者ID:CLYBOY,项目名称:ppsspp,代码行数:18,


示例24: __KernelSetVplTimeout

void __KernelSetVplTimeout(u32 timeoutPtr){	if (timeoutPtr == 0 || vplWaitTimer == -1)		return;	int micro = (int) Memory::Read_U32(timeoutPtr);	// This happens to be how the hardware seems to time things.	if (micro <= 5)		micro = 10;	// Yes, this 7 is reproducible.  6 is (a lot) longer than 7.	else if (micro == 7)		micro = 15;	else if (micro <= 215)		micro = 250;	CoreTiming::ScheduleEvent(usToCycles(micro), vplWaitTimer, __KernelGetCurThread());}
开发者ID:Chalky2013,项目名称:ppsspp,代码行数:18,


示例25: __GeInit

void __GeInit(){	memset(&ge_used_callbacks, 0, sizeof(ge_used_callbacks));	ge_pending_cb.clear();	__RegisterIntrHandler(PSP_GE_INTR, new GeIntrHandler());	geSyncEvent = CoreTiming::RegisterEvent("GeSyncEvent", &__GeExecuteSync);	geInterruptEvent = CoreTiming::RegisterEvent("GeInterruptEvent", &__GeExecuteInterrupt);	geCycleEvent = CoreTiming::RegisterEvent("GeCycleEvent", &__GeCheckCycles);	listWaitingThreads.clear();	drawWaitingThreads.clear();	// When we're using separate CPU/GPU threads, we need to keep them in sync.	if (IsOnSeparateCPUThread()) {		CoreTiming::ScheduleEvent(usToCycles(geIntervalUs), geCycleEvent, 0);	}}
开发者ID:AbandonedCart,项目名称:PPSSPPXperia,代码行数:18,


示例26: NativeRender

void NativeRender(){	glstate.Restore();    ReapplyGfxState();    s64 blockTicks = usToCycles(1000000 / 10);    while(coreState == CORE_RUNNING)    {		PSP_RunLoopFor((int)blockTicks);	}	// Hopefully coreState is now CORE_NEXTFRAME	if(coreState == CORE_NEXTFRAME)    {		// set back to running for the next frame		coreState = CORE_RUNNING;    }}
开发者ID:jedivind,项目名称:PPSSPP-Core,代码行数:19,


示例27: NativeRender

void NativeRender(){	glstate.Restore();    ReapplyGfxState();    s64 blockTicks = usToCycles(1000000 / 10);    while(coreState == CORE_RUNNING)    {		u64 nowTicks = CoreTiming::GetTicks();		mipsr4k.RunLoopUntil(nowTicks + blockTicks);	}	// Hopefully coreState is now CORE_NEXTFRAME	if(coreState == CORE_NEXTFRAME)    {		// set back to running for the next frame		coreState = CORE_RUNNING;    }}
开发者ID:PGGB,项目名称:PPSSPP-Core,代码行数:19,


示例28: handleResult

	virtual void handleResult(int result)	{		// A non-zero result means to reschedule.		if (result > 0)		{			u32 error;			Alarm *alarm = kernelObjects.Get<Alarm>(alarmID, error);			__KernelScheduleAlarm(alarm, (u64) usToCycles(result));		}		else		{			if (result < 0)				WARN_LOG(HLE, "Alarm requested reschedule for negative value %u, ignoring", (unsigned) result);			// Delete the alarm if it's not rescheduled.			kernelObjects.Destroy<Alarm>(alarmID);			__ReleaseSubIntrHandler(PSP_SYSTIMER0_INTR, alarmID);		}	}
开发者ID:HomerSp,项目名称:ppsspp,代码行数:19,


示例29: sceCtrlSetSamplingCycle

u32 sceCtrlSetSamplingCycle(u32 cycle){	DEBUG_LOG(SCECTRL, "sceCtrlSetSamplingCycle(%u)", cycle);	if ((cycle > 0 && cycle < 5555) || cycle > 20000)	{		WARN_LOG(SCECTRL, "SCE_KERNEL_ERROR_INVALID_VALUE=sceCtrlSetSamplingCycle(%u)", cycle);		return SCE_KERNEL_ERROR_INVALID_VALUE;	}	u32 prev = ctrlCycle;	ctrlCycle = cycle;	if (prev > 0)		CoreTiming::UnscheduleEvent(ctrlTimer, 0);	if (cycle > 0)		CoreTiming::ScheduleEvent(usToCycles(ctrlCycle), ctrlTimer, 0);	return prev;}
开发者ID:Bulkman,项目名称:ppsspp,代码行数:20,



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


C++ usToTicks函数代码示例
C++ uround函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。