diff options
| author | Dragorn421 <Dragorn421@users.noreply.github.com> | 2024-09-11 11:02:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-09-11 18:02:42 +0900 |
| commit | 76d97ac18acc37a73b4ae627f2f84fe2bae44fd6 (patch) | |
| tree | 5ec3be364f39b6e7324bc3ba763196d1c4b0405f /include | |
| parent | cbf9eacf42c25f887589ba50d4ef2cd41cdc9030 (diff) | |
[headers 14] libc64 headers (#2177)
* [headers 14] libc64 headers
* bss
* bss
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 25 | ||||
| -rw-r--r-- | include/libc64/aprintf.h | 11 | ||||
| -rw-r--r-- | include/libc64/malloc.h | 28 | ||||
| -rw-r--r-- | include/libc64/math64.h (renamed from include/fp_math.h) | 4 | ||||
| -rw-r--r-- | include/libc64/sleep.h | 12 | ||||
| -rw-r--r-- | include/libc64/sprintf.h (renamed from include/libc/stdio.h) | 8 | ||||
| -rw-r--r-- | include/ultra64.h | 1 | ||||
| -rw-r--r-- | include/variables.h | 1 | ||||
| -rw-r--r-- | include/z64.h | 6 |
9 files changed, 63 insertions, 33 deletions
diff --git a/include/functions.h b/include/functions.h index c05600352..f11bea990 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1366,31 +1366,6 @@ s8 PadUtils_GetRelY(Input* input); void PadUtils_UpdateRelXY(Input* input); s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status); -void* SystemArena_Malloc(u32 size); -void* SystemArena_MallocR(u32 size); -void* SystemArena_Realloc(void* ptr, u32 newSize); -void SystemArena_Free(void* ptr); -void* SystemArena_Calloc(u32 num, u32 size); -void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); -void SystemArena_Check(void); -void SystemArena_Init(void* start, u32 size); -void SystemArena_Cleanup(void); -s32 SystemArena_IsInitialized(void); -#if OOT_DEBUG -void* SystemArena_MallocDebug(u32 size, const char* file, int line); -void* SystemArena_MallocRDebug(u32 size, const char* file, int line); -void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); -void SystemArena_FreeDebug(void* ptr, const char* file, int line); -void SystemArena_Display(void); -#endif -s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); -s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...); -void Sleep_Cycles(OSTime cycles); -void Sleep_Nsec(u32 nsec); -void Sleep_Usec(u32 usec); -void Sleep_Msec(u32 ms); -void Sleep_Sec(u32 sec); - s32 osPfsFreeBlocks(OSPfs* pfs, s32* leftoverBytes); void guScale(Mtx* m, f32 x, f32 y, f32 z); OSTask* _VirtualToPhysicalTask(OSTask* intp); diff --git a/include/libc64/aprintf.h b/include/libc64/aprintf.h new file mode 100644 index 000000000..e6aad4bc7 --- /dev/null +++ b/include/libc64/aprintf.h @@ -0,0 +1,11 @@ +#ifndef LIBC64_APRINTF_H +#define LIBC64_APRINTF_H + +#include "ultra64.h" + +#include "stdarg.h" + +s32 PrintUtils_VPrintf(PrintCallback* pfn, const char* fmt, va_list args); +s32 PrintUtils_Printf(PrintCallback* pfn, const char* fmt, ...); + +#endif diff --git a/include/libc64/malloc.h b/include/libc64/malloc.h new file mode 100644 index 000000000..b9ae324b9 --- /dev/null +++ b/include/libc64/malloc.h @@ -0,0 +1,28 @@ +#ifndef LIBC64_MALLOC_H +#define LIBC64_MALLOC_H + +#include "ultra64.h" +#include "libc64/os_malloc.h" + +void* SystemArena_Malloc(u32 size); +void* SystemArena_MallocR(u32 size); +void* SystemArena_Realloc(void* ptr, u32 newSize); +void SystemArena_Free(void* ptr); +void* SystemArena_Calloc(u32 num, u32 size); +void SystemArena_GetSizes(u32* outMaxFree, u32* outFree, u32* outAlloc); +void SystemArena_Check(void); +void SystemArena_Init(void* start, u32 size); +void SystemArena_Cleanup(void); +s32 SystemArena_IsInitialized(void); + +#if OOT_DEBUG +void* SystemArena_MallocDebug(u32 size, const char* file, int line); +void* SystemArena_MallocRDebug(u32 size, const char* file, int line); +void* SystemArena_ReallocDebug(void* ptr, u32 newSize, const char* file, int line); +void SystemArena_FreeDebug(void* ptr, const char* file, int line); +void SystemArena_Display(void); +#endif + +extern Arena gSystemArena; + +#endif diff --git a/include/fp_math.h b/include/libc64/math64.h index 26f9b171b..acd6992b7 100644 --- a/include/fp_math.h +++ b/include/libc64/math64.h @@ -1,5 +1,5 @@ -#ifndef FP_MATH_H -#define FP_MATH_H +#ifndef LIBC64_MATH64_H +#define LIBC64_MATH64_H #include "ultra64.h" diff --git a/include/libc64/sleep.h b/include/libc64/sleep.h new file mode 100644 index 000000000..88eba0a78 --- /dev/null +++ b/include/libc64/sleep.h @@ -0,0 +1,12 @@ +#ifndef LIBC64_SLEEP_H +#define LIBC64_SLEEP_H + +#include "ultra64.h" + +void Sleep_Cycles(OSTime cycles); +void Sleep_Nsec(u32 nsec); +void Sleep_Usec(u32 usec); +void Sleep_Msec(u32 ms); +void Sleep_Sec(u32 sec); + +#endif diff --git a/include/libc/stdio.h b/include/libc64/sprintf.h index ce9181614..485f938f5 100644 --- a/include/libc/stdio.h +++ b/include/libc64/sprintf.h @@ -1,9 +1,11 @@ -#ifndef STDIO_H -#define STDIO_H +#ifndef LIBC64_SPRINTF_H +#define LIBC64_SPRINTF_H + +#include "ultra64.h" #include "stdarg.h" -int sprintf(char* dst, const char* fmt, ...); int vsprintf(char* dst, const char* fmt, va_list args); +int sprintf(char* dst, const char* fmt, ...); #endif diff --git a/include/ultra64.h b/include/ultra64.h index f6460c583..ed88bcb0f 100644 --- a/include/ultra64.h +++ b/include/ultra64.h @@ -7,7 +7,6 @@ #include "libc/stdbool.h" #include "libc/stddef.h" #include "libc/stdint.h" -#include "libc/stdio.h" #include "libc/stdlib.h" #include "libc/string.h" diff --git a/include/variables.h b/include/variables.h index 269f45537..2f96222d5 100644 --- a/include/variables.h +++ b/include/variables.h @@ -223,7 +223,6 @@ extern ActiveSequence gActiveSeqs[4]; extern AudioContext gAudioCtx; extern AudioCustomUpdateFunction gAudioCustomUpdateFunction; -extern Arena gSystemArena; extern OSPifRam __osContPifRam; extern u8 __osContLastCmd; extern u8 __osMaxControllers; diff --git a/include/z64.h b/include/z64.h index 4c797ffae..a6e4cc4d4 100644 --- a/include/z64.h +++ b/include/z64.h @@ -66,12 +66,16 @@ #include "libc64/qrand.h" #include "sys_math.h" #include "sys_math3d.h" -#include "fp_math.h" +#include "libc64/math64.h" #include "sys_matrix.h" #include "main.h" #include "segmented_address.h" #include "stackcheck.h" #include "kaleido_manager.h" +#include "libc64/aprintf.h" +#include "libc64/malloc.h" +#include "libc64/sleep.h" +#include "libc64/sprintf.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 |
