1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-23 22:05:09 +00:00
oot/src/libultra_code/osStopTimer.c
Random 3d050f2861
Decompile a bunch of small files (#160)
* Decompile a bunch of small files

* Rename dacrate to dacRate

* Run format.sh

* Minor fixes in PR #160
2020-05-25 23:18:14 +02:00

29 lines
534 B
C

#include <global.h>
s32 osStopTimer(OSTimer* timer) {
register s32 prevInt;
OSTimer* next;
if (!timer->next) {
return -1;
}
prevInt = __osDisableInt();
next = timer->next;
if (next != __osTimerList) {
next->value += timer->value;
}
timer->prev->next = timer->next;
timer->next->prev = timer->prev;
timer->next = NULL;
timer->prev = NULL;
if (__osTimerList->next == __osTimerList) {
__osSetCompare(0);
}
__osRestoreInt(prevInt);
return 0;
}