diff options
| author | mzxrules <mzxrules@gmail.com> | 2025-01-24 13:25:05 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-24 13:25:05 -0500 |
| commit | f448a48cd66d6a60fdac5ed1efec078a434a1fe7 (patch) | |
| tree | 2897cb2ce3a35132af15fa269562bb4eabea5607 /include | |
| parent | ab37332793161e1731176588fd901c0d90461f74 (diff) | |
Create headers for some libu64 files (#2440)
* Create headers for some libu64 files
* apply bss patch
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 26 | ||||
| -rw-r--r-- | include/libu64/debug.h | 25 | ||||
| -rw-r--r-- | include/libu64/gfxprint.h (renamed from include/gfxprint.h) | 4 | ||||
| -rw-r--r-- | include/libu64/pad.h | 31 | ||||
| -rw-r--r-- | include/libu64/padsetup.h | 8 | ||||
| -rw-r--r-- | include/padmgr.h | 8 | ||||
| -rw-r--r-- | include/z64.h | 3 |
7 files changed, 69 insertions, 36 deletions
diff --git a/include/functions.h b/include/functions.h index 6984ea163..758f94648 100644 --- a/include/functions.h +++ b/include/functions.h @@ -26,14 +26,6 @@ NORETURN void func_80002384(const char* exp, const char* file, int line); #endif OSPiHandle* osDriveRomInit(void); void Mio0_Decompress(u8* src, u8* dst); -#if DEBUG_FEATURES -void LogUtils_LogHexDump(void* ptr, s32 size0); -void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line); -void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line); -void LogUtils_LogThreadId(const char* name, int line); -#endif -void LogUtils_HungupThread(const char* name, int line); -void LogUtils_ResetHungup(void); EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params); EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params); @@ -290,24 +282,6 @@ size_t Overlay_Load(uintptr_t vromStart, uintptr_t vromEnd, void* vramStart, voi // ? func_800FC83C(?); // ? func_800FCAB4(?); void SystemHeap_Init(void* start, u32 size); -void PadUtils_Init(Input* input); -void func_800FCB70(void); -void PadUtils_ResetPressRel(Input* input); -u32 PadUtils_CheckCurExact(Input* input, u16 value); -u32 PadUtils_CheckCur(Input* input, u16 key); -u32 PadUtils_CheckPressed(Input* input, u16 key); -u32 PadUtils_CheckReleased(Input* input, u16 key); -u16 PadUtils_GetCurButton(Input* input); -u16 PadUtils_GetPressButton(Input* input); -s8 PadUtils_GetCurX(Input* input); -s8 PadUtils_GetCurY(Input* input); -void PadUtils_SetRelXY(Input* input, s32 x, s32 y); -s8 PadUtils_GetRelXImpl(Input* input); -s8 PadUtils_GetRelYImpl(Input* input); -s8 PadUtils_GetRelX(Input* input); -s8 PadUtils_GetRelY(Input* input); -void PadUtils_UpdateRelXY(Input* input); -s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status); f32 absf(f32); diff --git a/include/libu64/debug.h b/include/libu64/debug.h new file mode 100644 index 000000000..598c90195 --- /dev/null +++ b/include/libu64/debug.h @@ -0,0 +1,25 @@ +#ifndef LIBU64_DEBUG_H +#define LIBU64_DEBUG_H + +#include "ultra64.h" + +#if PLATFORM_N64 || DEBUG_FEATURES +f32 LogUtils_CheckFloatRange(const char* exp, int line, const char* valueName, f32 value, const char* minName, f32 min, + const char* maxName, f32 max); +#endif + +#if DEBUG_FEATURES +s32 LogUtils_CheckIntRange(const char* exp, int line, const char* valueName, s32 value, const char* minName, s32 min, + const char* maxName, s32 max); +void LogUtils_LogHexDump(void* ptr, s32 size0); +void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, int line); +void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, int line); +void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, int line); +void LogUtils_CheckValidPointer(const char* exp, void* ptr, const char* file, int line); +void LogUtils_LogThreadId(const char* name, int line); +#endif + +void LogUtils_HungupThread(const char* name, int line); +void LogUtils_ResetHungup(void); + +#endif diff --git a/include/gfxprint.h b/include/libu64/gfxprint.h index 039b564b4..4106d9fd1 100644 --- a/include/gfxprint.h +++ b/include/libu64/gfxprint.h @@ -1,5 +1,5 @@ -#ifndef GFXPRINT_H -#define GFXPRINT_H +#ifndef LIBU64_GFXPRINT_H +#define LIBU64_GFXPRINT_H #include "ultra64.h" #include "color.h" diff --git a/include/libu64/pad.h b/include/libu64/pad.h new file mode 100644 index 000000000..f5ab44d8c --- /dev/null +++ b/include/libu64/pad.h @@ -0,0 +1,31 @@ +#ifndef LIBU64_PAD_H +#define LIBU64_PAD_H + +#include "ultra64.h" + +typedef struct Input { + /* 0x00 */ OSContPad cur; + /* 0x06 */ OSContPad prev; + /* 0x0C */ OSContPad press; // X/Y store delta from last frame + /* 0x12 */ OSContPad rel; // X/Y store adjusted +} Input; // size = 0x18 + +void PadUtils_Init(Input* input); +void func_800FCB70(void); +void PadUtils_ResetPressRel(Input* input); +u32 PadUtils_CheckCurExact(Input* input, u16 value); +u32 PadUtils_CheckCur(Input* input, u16 key); +u32 PadUtils_CheckPressed(Input* input, u16 key); +u32 PadUtils_CheckReleased(Input* input, u16 key); +u16 PadUtils_GetCurButton(Input* input); +u16 PadUtils_GetPressButton(Input* input); +s8 PadUtils_GetCurX(Input* input); +s8 PadUtils_GetCurY(Input* input); +void PadUtils_SetRelXY(Input* input, s32 x, s32 y); +s8 PadUtils_GetRelXImpl(Input* input); +s8 PadUtils_GetRelYImpl(Input* input); +s8 PadUtils_GetRelX(Input* input); +s8 PadUtils_GetRelY(Input* input); +void PadUtils_UpdateRelXY(Input* input); + +#endif diff --git a/include/libu64/padsetup.h b/include/libu64/padsetup.h new file mode 100644 index 000000000..0aab4a729 --- /dev/null +++ b/include/libu64/padsetup.h @@ -0,0 +1,8 @@ +#ifndef LIBU64_PADSETUP_H +#define LIBU64_PADSETUP_H + +#include "ultra64.h" + +s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status); + +#endif diff --git a/include/padmgr.h b/include/padmgr.h index 5bfa98308..4b9e6890c 100644 --- a/include/padmgr.h +++ b/include/padmgr.h @@ -2,6 +2,7 @@ #define PADMGR_H #include "ultra64.h" +#include "libu64/pad.h" #include "irqmgr.h" #include "versions.h" @@ -11,13 +12,6 @@ typedef enum ControllerPakType { CONT_PAK_OTHER } ControllerPakType; -typedef struct Input { - /* 0x00 */ OSContPad cur; - /* 0x06 */ OSContPad prev; - /* 0x0C */ OSContPad press; // X/Y store delta from last frame - /* 0x12 */ OSContPad rel; // X/Y store adjusted -} Input; // size = 0x18 - typedef struct PadMgr { /* 0x0000 */ OSContStatus padStatus[MAXCONTROLLERS]; /* 0x0010 */ OSMesg serialMsg; diff --git a/include/z64.h b/include/z64.h index ecaa19715..e7677a8ee 100644 --- a/include/z64.h +++ b/include/z64.h @@ -54,7 +54,7 @@ #include "sequence.h" #include "sfx.h" #include "color.h" -#include "gfxprint.h" +#include "libu64/gfxprint.h" #include "z_lib.h" #include "ichain.h" #include "regs.h" @@ -86,6 +86,7 @@ #include "libc64/malloc.h" #include "libc64/sleep.h" #include "libc64/sprintf.h" +#include "libu64/debug.h" #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 |
