Files
mm/src/libultra/os/settimer.c
T
Derek Hensley 9bb978527f Misc Cleanup 14 (#1214)
* bgId

* z64scene.h whitespace

* SubS_ComputeTrackPointRot casts

* Macros cleanup

* ifs

* Empty Loops

* Lights_FindBufSlot void

* SkelAnime_GetFrameData

* };

* Struct inits

* fs

* @todo

* Bug comments

* EnPofusen and ObjUm

* Trailing comma

* Revert "bgId"

This reverts commit eea073c5ac.

* Revert "z64scene.h whitespace"

This reverts commit 399fd57550.

* Revert "SubS_ComputeTrackPointRot casts"

This reverts commit dea896c874.

* FAKE

* Review

* Format
2023-03-21 11:12:22 -03:00

44 lines
868 B
C

#include "global.h"
int osSetTimer(OSTimer* t, OSTime value, OSTime interval, OSMesgQueue* mq, OSMesg msg) {
OSTime tim;
OSTimer* spC;
u32 sp14;
u32 sp10;
u32 saveMask;
t->next = NULL;
t->prev = NULL;
t->interval = interval;
if (value != 0) {
t->value = value;
} else {
t->value = interval;
}
t->mq = mq;
t->msg = msg;
saveMask = __osDisableInt();
if (__osTimerList->next != __osTimerList) {
//! FAKE:
if (1) {}
spC = __osTimerList->next;
sp14 = osGetCount();
sp10 = sp14 - __osTimerCounter;
if (sp10 < spC->value) {
spC->value -= sp10;
} else {
spC->value = 1;
}
}
tim = __osInsertTimer(t);
__osSetTimerIntr(__osTimerList->next->value);
__osRestoreInt(saveMask);
return 0;
}