mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-14 20:05:02 +00:00
Decompile sleep.c and printutils.c
- Decompile sleep.c (OK) - Decompile printutils.c (OK) - Fix 1 non-matching in z_room.c - Get rid of some magic numbers
This commit is contained in:
parent
0a25ab74c4
commit
d0cf6e153b
20 changed files with 94 additions and 308 deletions
33
src/code/sleep.c
Normal file
33
src/code/sleep.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <global.h>
|
||||
|
||||
void Sleep_Cycles(OSTime cycles)
|
||||
{
|
||||
OSMesgQueue mq;
|
||||
OSMesg msg;
|
||||
OSTimer timer;
|
||||
|
||||
osCreateMesgQueue(&mq, &msg, OS_MESG_BLOCK);
|
||||
osSetTimer(&timer, cycles, 0, &mq, NULL);
|
||||
osRecvMesg(&mq, NULL, OS_MESG_BLOCK);
|
||||
}
|
||||
|
||||
void Sleep_Nsec(u32 nsec)
|
||||
{
|
||||
Sleep_Cycles(OS_NSEC_TO_CYCLES(nsec));
|
||||
}
|
||||
|
||||
void Sleep_Usec(u32 usec)
|
||||
{
|
||||
Sleep_Cycles(OS_USEC_TO_CYCLES(usec));
|
||||
}
|
||||
|
||||
// originally "msleep"
|
||||
void Sleep_Msec(u32 ms)
|
||||
{
|
||||
Sleep_Cycles((ms * OS_CPU_COUNTER) / 1000ull);
|
||||
}
|
||||
|
||||
void Sleep_Sec(u32 sec)
|
||||
{
|
||||
Sleep_Cycles((sec * OS_CPU_COUNTER));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue