Remove functions.h (#2501)

* split most of functions.h

* osdriverominit

* forgot include

* fix

* remove functions.h

* temporary fix for fix_bss

* fix bss

* revert fix_bss.py change
This commit is contained in:
fig02
2025-04-05 19:16:52 -04:00
committed by GitHub
parent 1beeff9658
commit 5133db15a3
50 changed files with 326 additions and 194 deletions

8
include/flag_set.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef FLAG_SET_H
#define FLAG_SET_H
struct PlayState;
void FlagSet_Update(struct PlayState* play);
#endif

View File

@@ -1,84 +0,0 @@
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#include "z64.h"
#include "macros.h"
void Idle_ThreadEntry(void* arg);
#if !PLATFORM_IQUE
void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size);
#else
void gzip_decompress(uintptr_t romStart, u8* dst, size_t size);
#endif
#if DEBUG_FEATURES
void isPrintfInit(void);
#endif
void rmonPrintf(const char* fmt, ...);
#if DEBUG_FEATURES
void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
NORETURN void func_80002384(const char* exp, const char* file, int line);
#endif
OSPiHandle* osDriveRomInit(void);
void Mio0_Decompress(u8* src, u8* dst);
void FlagSet_Update(PlayState* play);
void* MemCpy(void* dest, const void* src, s32 len);
void TransitionTile_Destroy(TransitionTile* this);
TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows);
void TransitionTile_Draw(TransitionTile* this, Gfx** gfxP);
void TransitionTile_Update(TransitionTile* this);
void TransitionTriforce_Start(void* thisx);
void* TransitionTriforce_Init(void* thisx);
void TransitionTriforce_Destroy(void* thisx);
void TransitionTriforce_Update(void* thisx, s32 updateRate);
void TransitionTriforce_SetColor(void* thisx, u32 color);
void TransitionTriforce_SetType(void* thisx, s32 type);
void TransitionTriforce_Draw(void* thisx, Gfx** gfxP);
s32 TransitionTriforce_IsDone(void* thisx);
void TransitionWipe_Start(void* thisx);
void* TransitionWipe_Init(void* thisx);
void TransitionWipe_Destroy(void* thisx);
void TransitionWipe_Update(void* thisx, s32 updateRate);
void TransitionWipe_Draw(void* thisx, Gfx** gfxP);
s32 TransitionWipe_IsDone(void* thisx);
void TransitionWipe_SetType(void* thisx, s32 type);
void TransitionWipe_SetColor(void* thisx, u32 color);
void TransitionCircle_Start(void* thisx);
void* TransitionCircle_Init(void* thisx);
void TransitionCircle_Destroy(void* thisx);
void TransitionCircle_Update(void* thisx, s32 updateRate);
void TransitionCircle_Draw(void* thisx, Gfx** gfxP);
s32 TransitionCircle_IsDone(void* thisx);
void TransitionCircle_SetType(void* thisx, s32 type);
void TransitionCircle_SetColor(void* thisx, u32 color);
void TransitionCircle_SetUnkColor(void* thisx, u32 color);
void TransitionFade_Start(void* thisx);
void* TransitionFade_Init(void* thisx);
void TransitionFade_Destroy(void* thisx);
void TransitionFade_Update(void* thisx, s32 updateRate);
void TransitionFade_Draw(void* thisx, Gfx** gfxP);
s32 TransitionFade_IsDone(void* thisx);
void TransitionFade_SetColor(void* thisx, u32 color);
void TransitionFade_SetType(void* thisx, s32 type);
void SysCfb_Init(s32 n64dd);
void* SysCfb_GetFbPtr(s32 idx);
void* SysCfb_GetFbEnd(void);
void RcpUtils_PrintRegisterStatus(void);
void RcpUtils_Reset(void);
void Runtime_Init(void* start, u32 size);
#endif

View File

@@ -1,7 +1,6 @@
#ifndef GLOBAL_H
#define GLOBAL_H
#include "functions.h"
#include "variables.h"
#include "macros.h"
#include "versions.h"

6
include/idle.h Normal file
View File

@@ -0,0 +1,6 @@
#ifndef IDLE_H
#define IDLE_H
void Idle_ThreadEntry(void* arg);
#endif

10
include/inflate.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef INFLATE_H
#define INFLATE_H
#include "libc/stddef.h"
#include "libc/stdint.h"
#include "ultra64.h"
void gzip_decompress(uintptr_t romStart, u8* dst, size_t size);
#endif

18
include/is_debug.h Normal file
View File

@@ -0,0 +1,18 @@
#ifndef IS_DEBUG_H
#define IS_DEBUG_H
#include "libc/stddef.h"
#include "attributes.h"
#if DEBUG_FEATURES
void isPrintfInit(void);
#endif
void rmonPrintf(const char* fmt, ...);
#if DEBUG_FEATURES
void* is_proutSyncPrintf(void* arg, const char* str, size_t count);
NORETURN void func_80002384(const char* exp, const char* file, int line);
#endif
#endif

View File

@@ -0,0 +1,6 @@
#ifndef LIBU64_RCP_UTILS_H
#define LIBU64_RCP_UTILS_H
void RcpUtils_Reset(void);
#endif

8
include/libu64/runtime.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef LIBU64_RUNTIME_H
#define LIBU64_RUNTIME_H
#include "ultra64.h"
void Runtime_Init(void* start, u32 size);
#endif

9
include/memory_utils.h Normal file
View File

@@ -0,0 +1,9 @@
#ifndef MEMORY_UTILS_H
#define MEMORY_UTILS_H
#include "ultra64.h"
void* MemCpy(void* dest, const void* src, s32 len);
void* MemSet(void* dest, s32 val, s32 len);
#endif

8
include/mio0.h Normal file
View File

@@ -0,0 +1,8 @@
#ifndef MIO0_H
#define MIO0_H
#include "ultra64.h"
void Mio0_Decompress(u8* src, u8* dst);
#endif

10
include/sys_cfb.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef SYS_CFB_H
#define SYS_CFB_H
#include "ultra64.h"
void SysCfb_Init(s32 n64dd);
void* SysCfb_GetFbPtr(s32 idx);
void* SysCfb_GetFbEnd(void);
#endif

View File

@@ -0,0 +1,55 @@
#ifndef TRANSITION_CIRCLE_H
#define TRANSITION_CIRCLE_H
#include "ultra64.h"
#include "color.h"
typedef enum TransitionCircleAppearance {
/* 0 */ TCA_NORMAL,
/* 1 */ TCA_WAVE,
/* 2 */ TCA_RIPPLE,
/* 3 */ TCA_STARBURST
} TransitionCircleAppearance;
typedef enum TransitionCircleColor {
/* 0 */ TCC_BLACK,
/* 1 */ TCC_WHITE,
/* 2 */ TCC_GRAY,
/* 3 */ TCC_SPECIAL // color varies depending on appearance. unused and appears broken
} TransitionCircleColor;
typedef enum TransitionCircleSpeed {
/* 0 */ TCS_FAST,
/* 1 */ TCS_SLOW
} TransitionCircleSpeed;
typedef struct TransitionCircle {
/* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ Color_RGBA8_u32 unkColor;
/* 0x008 */ s32 texX;
/* 0x00C */ s32 texY;
/* 0x010 */ s32 speed;
/* 0x014 */ u8 direction;
/* 0x015 */ u8 colorType;
/* 0x016 */ u8 speedType;
/* 0x017 */ u8 appearanceType;
/* 0x018 */ u8 isDone;
/* 0x019 */ u8 frame;
/* 0x01A */ u16 normal;
/* 0x020 */ Mtx projection;
/* 0x060 */ Mtx lookAt;
/* 0x0A0 */ void* texture;
/* 0x0A8 */ Mtx modelView[2][3];
} TransitionCircle; // size = 0x228
void TransitionCircle_Start(void* thisx);
void* TransitionCircle_Init(void* thisx);
void TransitionCircle_Destroy(void* thisx);
void TransitionCircle_Update(void* thisx, s32 updateRate);
void TransitionCircle_Draw(void* thisx, Gfx** gfxP);
s32 TransitionCircle_IsDone(void* thisx);
void TransitionCircle_SetType(void* thisx, s32 type);
void TransitionCircle_SetColor(void* thisx, u32 color);
void TransitionCircle_SetUnkColor(void* thisx, u32 color);
#endif

24
include/transition_fade.h Normal file
View File

@@ -0,0 +1,24 @@
#ifndef TRANSITION_FADE_H
#define TRANSITION_FADE_H
#include "ultra64.h"
#include "color.h"
typedef struct TransitionFade {
/* 0x000 */ u8 type;
/* 0x001 */ u8 isDone;
/* 0x002 */ u8 direction;
/* 0x004 */ Color_RGBA8_u32 color;
/* 0x008 */ u16 timer;
} TransitionFade; // size = 0xC
void TransitionFade_Start(void* thisx);
void* TransitionFade_Init(void* thisx);
void TransitionFade_Destroy(void* thisx);
void TransitionFade_Update(void* thisx, s32 updateRate);
void TransitionFade_Draw(void* thisx, Gfx** gfxP);
s32 TransitionFade_IsDone(void* thisx);
void TransitionFade_SetColor(void* thisx, u32 color);
void TransitionFade_SetType(void* thisx, s32 type);
#endif

30
include/transition_tile.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef TRANSITION_TILE_H
#define TRANSITION_TILE_H
#include "ultra64.h"
typedef struct TransitionTileVtxData {
/* 0x0 */ f32 x;
/* 0x4 */ f32 y;
} TransitionTileVtxData; // size = 0x8
typedef struct TransitionTile {
/* 0x00 */ s32 cols;
/* 0x04 */ s32 rows;
/* 0x08 */ s32 frame;
/* 0x0C */ TransitionTileVtxData* vtxData;
/* 0x10 */ Vtx* vtxFrame1;
/* 0x14 */ Vtx* vtxFrame2;
/* 0x18 */ Mtx projection;
/* 0x58 */ Mtx modelView;
/* 0x98 */ Mtx unk_98;
/* 0xD8 */ Gfx* gfx; // "gfxtbl"
/* 0xDC */ u16* zBuffer;
} TransitionTile; // size = 0xE0
TransitionTile* TransitionTile_Init(TransitionTile* this, s32 cols, s32 rows);
void TransitionTile_Destroy(TransitionTile* this);
void TransitionTile_Update(TransitionTile* this);
void TransitionTile_Draw(TransitionTile* this, Gfx** gfxP);
#endif

View File

@@ -0,0 +1,27 @@
#ifndef TRANSITION_TRIFORCE_H
#define TRANSITION_TRIFORCE_H
#include "ultra64.h"
#include "color.h"
typedef struct TransitionTriforce {
/* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ f32 transPos;
/* 0x008 */ f32 step;
/* 0x00C */ s32 state;
/* 0x010 */ s32 type;
/* 0x018 */ Mtx projection;
/* 0x058 */ s32 frame;
/* 0x060 */ Mtx modelView[2][3];
} TransitionTriforce; // size = 0x1E0
void TransitionTriforce_Start(void* thisx);
void* TransitionTriforce_Init(void* thisx);
void TransitionTriforce_Destroy(void* thisx);
void TransitionTriforce_Update(void* thisx, s32 updateRate);
void TransitionTriforce_SetColor(void* thisx, u32 color);
void TransitionTriforce_SetType(void* thisx, s32 type);
void TransitionTriforce_Draw(void* thisx, Gfx** gfxP);
s32 TransitionTriforce_IsDone(void* thisx);
#endif

30
include/transition_wipe.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef TRANSITION_WIPE_H
#define TRANSITION_WIPE_H
#include "ultra64.h"
#include "color.h"
typedef struct TransitionWipe {
/* 0x000 */ Color_RGBA8_u32 color;
/* 0x004 */ Color_RGBA8_u32 unkColor;
/* 0x008 */ u8 direction;
/* 0x009 */ u8 frame;
/* 0x00A */ u8 isDone;
/* 0x00C */ u16 texX;
/* 0x00E */ u16 texY;
/* 0x010 */ u16 normal;
/* 0x018 */ Mtx projection;
/* 0x058 */ Mtx lookAt;
/* 0x098 */ Mtx modelView[2][3];
} TransitionWipe; // size = 0x218
void TransitionWipe_Start(void* thisx);
void* TransitionWipe_Init(void* thisx);
void TransitionWipe_Destroy(void* thisx);
void TransitionWipe_Update(void* thisx, s32 updateRate);
void TransitionWipe_Draw(void* thisx, Gfx** gfxP);
s32 TransitionWipe_IsDone(void* thisx);
void TransitionWipe_SetType(void* thisx, s32 type);
void TransitionWipe_SetColor(void* thisx, u32 color);
#endif

View File

@@ -105,6 +105,7 @@ OSMesgQueue* osPiGetCmdQueue(void);
s32 osEPiReadIo(OSPiHandle* handle, u32 devAddr, u32* data);
void osViSetSpecialFeatures(u32 func);
OSPiHandle* osCartRomInit(void);
OSPiHandle* osDriveRomInit(void);
void __osSetFpcCsr(u32);
u32 __osGetFpcCsr(void);
s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data);

10
include/yaz0.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef YAZ0_H
#define YAZ0_H
#include "libc/stddef.h"
#include "libc/stdint.h"
#include "ultra64.h"
void Yaz0_Decompress(uintptr_t romStart, u8* dst, size_t size);
#endif

View File

@@ -4,6 +4,7 @@
#include "ultra64.h"
#include "prerender.h"
#include "transition_tile.h"
#include "z64actor.h"
#include "z64bgcheck.h"
#include "z64camera.h"

View File

@@ -3,6 +3,10 @@
#include "ultra64/ultratypes.h"
#include "ultra64/gbi.h" // for Gfx
#include "transition_circle.h"
#include "transition_fade.h"
#include "transition_triforce.h"
#include "transition_wipe.h"
#include "z64transition_instances.h"
#define TRANS_TRIGGER_OFF 0 // transition is not active

Some files were not shown because too many files have changed in this diff Show More