Files
SpaghettiKart/src/os/osGetTime.c
T
Faris Awan 5c23113592 Match/split all of libultra (#23)
* libultra from sm64 integrated; 3 libultra functions matched

* All of libultra done!

authored-by: farisawan-2000 <farisawan.2000@gmail.com>
2021-04-27 22:35:30 -06:00

19 lines
416 B
C

#include "libultra_internal.h"
extern OSTime __osCurrentTime;
extern u32 __osBaseCounter;
OSTime osGetTime()
{
u32 tmptime;
u32 elapseCount;
OSTime currentCount;
register u32 saveMask;
saveMask = __osDisableInt();
tmptime = osGetCount();
elapseCount = tmptime - __osBaseCounter;
currentCount = __osCurrentTime;
__osRestoreInt(saveMask);
return currentCount + elapseCount;
}