1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-12 18:01:16 +00:00

[headers 9] Add src/libc64/ and new "z64" rand.h (#2164)

* rand.h -> libc64/qrand.h

* Add rand.h with z64 rand wrappers

* yeet comment

* code/rand.c -> libc64/qrand.c

* fixup

* move libc64 source to src/libc64/

* fix

* bss

* update file splits disasm metadata
This commit is contained in:
Dragorn421 2024-09-08 23:11:41 +02:00 committed by GitHub
parent a903f8b8bc
commit c7ec814d78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 52 additions and 49 deletions

View file

@ -1,28 +0,0 @@
#include "global.h"
void Sleep_Cycles(OSTime cycles) {
OSMesgQueue mq;
OSMesg msg;
OSTimer timer;
osCreateMesgQueue(&mq, &msg, 1);
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);
}

View file

@ -1,37 +0,0 @@
#include "stdarg.h"
#include "stdio.h"
#include "string.h"
#include "ultra64/xstdio.h"
#if PLATFORM_N64
// Generated by CVS "$Id$" keyword
char sSprintfFileInfo[] = "$Id: sprintf.c,v 1.5 1997/03/19 02:28:53 hayakawa Exp $";
#endif
void* proutSprintf(void* dst, const char* fmt, size_t size) {
return (char*)memcpy(dst, fmt, size) + size;
}
int vsprintf(char* dst, const char* fmt, va_list args) {
int ret = _Printf(proutSprintf, dst, fmt, args);
if (ret > -1) {
dst[ret] = '\0';
}
return ret;
}
int sprintf(char* dst, const char* fmt, ...) {
int ret;
va_list args;
va_start(args, fmt);
ret = _Printf(proutSprintf, dst, fmt, args);
if (ret > -1) {
dst[ret] = '\0';
}
va_end(args);
return ret;
}