Esempio n. 1
0
s32 sceSTimerSetHandler(s32 timerId, s32 arg1, SceSysTimerCb arg2, s32 arg3)
{
    SceSysTimer *timer = &timers[timerId & 3];
    if (timer->curTimer != timerId)
        return 0x80020097;
    s32 oldIntr = sceKernelCpuSuspendIntr();
    s32 mask;
    if (arg1 <= 0x3FFFFF)
        mask = arg1;
    else
        mask = 0x3FFFFF;
    if (arg2 == NULL) {
        timer->cb = NULL;
        timer->unk24 = 0;
        timer->unk28 = 0;
        _sceSTimerStopCount(timer);
        sceKernelDisableIntr(timer->s32Num);
    } else {
        timer->cb = arg2;
        timer->unk28 = arg3;
        timer->hw->unk0 = timer->hw->unk256 & 0xFFC00000;
        timer->hw->unk0 |= mask;
        timer->hw->unk0 = timer->hw->unk256 | 0x80400000;
        sceKernelEnableIntr(timer->s32Num);
    }
    sceKernelCpuResumeIntr(oldIntr);
    return 0;
}
Esempio n. 2
0
s32 resumeSTimer()
{
    s32 i;
    for (i = 0; i < 4; i++) {
        timers[i].hw->unk12 = timerSave[i].unk8;
        timers[i].hw->unk8 = timerSave[i].unk4;
        (void)timers[i].hw->unk0;
        timers[i].hw->unk0 = timerSave[i].unk0 & 0x7FFFFFFF;
        sceKernelEnableIntr(timers->s32Num);
    }
    return 0;
}
Esempio n. 3
0
int initRpc()
{
	meRpc.mutex = sceKernelCreateMutex("SceMediaEngineRpc", 0x101, 0, 0);
	if (meRpc.mutex < 0)
		return meRpc.mutex;
	meRpc.sema = sceKernelCreateSema("SceMediaEngineAvcPower" , 0x101, 1, 1, 0);
	if (meRpc.sema < 0)
		return meRpc.sema;
	meRpc.event = sceKernelCreateEventFlag("SceMediaEngineRpcWait", 0x201, 0, 0);
	if (meRpc.event < 0)
		return meRpc.event;
	sceSysregIntrEnd();
	int ret = sceKernelRegisterIntrHandler(SCE_MECODEC_INT, 2, (void*)&interruptHandler, (void*)meRpc.event, 0);
	if (ret < 0)
		return ret;
	return sceKernelEnableIntr(SCE_MECODEC_INT);
}