1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-27 11:34:29 +00:00

Reduce header interdependency

This commit is contained in:
Pablo 2024-10-26 15:18:14 +02:00
parent 2c1d2d74bc
commit ea89aaf475
96 changed files with 283 additions and 194 deletions

View file

@ -1,7 +1,7 @@
#ifndef CIC6105_H
#define CIC6105_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
extern s32 B_80008EE0;

View file

@ -1,7 +1,8 @@
#ifndef FAULT_H
#define FAULT_H
#include "ultra64.h"
#include "ultra64/message.h"
#include "ultra64/ultratypes.h"
#include "attributes.h"
#include "padmgr.h"

View file

@ -251,7 +251,6 @@ ListAlloc* ListAlloc_Init(ListAlloc* this);
void* ListAlloc_Alloc(ListAlloc* this, u32 size);
void ListAlloc_Free(ListAlloc* this, void* data);
void ListAlloc_FreeAll(ListAlloc* this);
void Main(void* arg);
void SysCfb_Init(s32 n64dd);
void* SysCfb_GetFbPtr(s32 idx);
void* SysCfb_GetFbEnd(void);

View file

@ -1,12 +1,15 @@
#ifndef GFX_H
#define GFX_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "ultra64/gbi.h"
#include "ultra64/message.h"
#include "sched.h"
#include "thga.h"
#include "versions.h"
struct OSViMode;
// Texture memory size, 4 KiB
#define TMEM_SIZE 0x1000
@ -35,7 +38,7 @@ typedef struct GraphicsContext {
/* 0x01B0 */ Gfx* workBuffer;
/* 0x01B4 */ TwoHeadGfxArena work;
/* 0x01C4 */ char unk_01C4[0xC0];
/* 0x0284 */ OSViMode* viMode;
/* 0x0284 */ struct OSViMode* viMode;
/* 0x0288 */ char unk_0288[0x20]; // Unused, could this be Zelda 2/3 ?
/* 0x02A8 */ TwoHeadGfxArena overlay; // "Zelda 4"
/* 0x02B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0"

View file

@ -1,7 +1,7 @@
#ifndef GFX_SETUPDL_H
#define GFX_SETUPDL_H
#include "ultra64.h"
#include "ultra64/gbi.h"
struct GraphicsContext;
struct PlayState;

View file

@ -1,7 +1,8 @@
#ifndef GFXALLOC_H
#define GFXALLOC_H
#include "ultra64.h"
#include "ultra64/gbi.h"
#include "ultra64/ultratypes.h"
Gfx* Gfx_Open(Gfx* gfx);
Gfx* Gfx_Close(Gfx* gfx, Gfx* dst);

View file

@ -1,7 +1,8 @@
#ifndef GFXPRINT_H
#define GFXPRINT_H
#include "ultra64.h"
#include "ultra64/gbi.h"
#include "ultra64/ultratypes.h"
#include "color.h"
typedef struct GfxPrint {

View file

@ -1,7 +1,7 @@
#ifndef ICHAIN_H
#define ICHAIN_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
struct Actor;

View file

@ -1,7 +1,10 @@
#ifndef IRQMGR_H
#define IRQMGR_H
#include "ultra64.h"
#include "ultra64/message.h"
#include "ultra64/time.h"
#include "ultra64/thread.h"
#include "ultra64/ultratypes.h"
#define OS_SC_RETRACE_MSG 1
#define OS_SC_DONE_MSG 2

View file

@ -1,8 +1,9 @@
#ifndef JPEG_H
#define JPEG_H
#include "ultra64.h"
#include "sched.h"
#include "ultra64/message.h"
#include "ultra64/ultratypes.h"
typedef struct JpegQuantizationTable {
/* 0x00 */ u16 table[8*8];

View file

@ -1,7 +1,7 @@
#ifndef KALEIDO_MANAGER_H
#define KALEIDO_MANAGER_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "romfile.h"
struct PlayState;

View file

@ -1,7 +1,7 @@
#ifndef LETTERBOX_H
#define LETTERBOX_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
void Letterbox_SetSizeTarget(s32 target);
u32 Letterbox_GetSizeTarget(void);

View file

@ -1,7 +1,7 @@
#ifndef MAIN_H
#define MAIN_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
extern s32 gScreenWidth;
extern s32 gScreenHeight;

View file

@ -1,7 +1,7 @@
#ifndef MAP_H
#define MAP_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
struct PlayState;

View file

@ -1,7 +1,7 @@
#ifndef MEMPAK_H
#define MEMPAK_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
s32 Mempak_Init(s32 controllerNum);
s32 Mempak_GetFreeBytes(s32 controllerNum);

View file

@ -1,7 +1,7 @@
#ifndef MESSAGE_DATA_STATIC_H
#define MESSAGE_DATA_STATIC_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "message_data_fmt.h"
#include "versions.h"

View file

@ -1,11 +1,13 @@
#ifndef N64DD_H
#define N64DD_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "ultra64/gbi.h"
#include "ultra64/message.h"
#include "stddef.h"
#include "ultra64/leo.h"
#include "z64pause.h"
#include "z64scene.h"
#include "z64map_mark.h"
#include "stdint.h"
#include "unk.h"
#include "versions.h"
struct Font;
@ -17,6 +19,10 @@ struct RegEditor;
struct RoomContext;
struct SaveContext;
struct Scene;
struct MapMarkData;
struct PauseMapMarksData;
struct SceneDrawConfigFunc;
struct DmaRequest;
// TODO Use the specific pointer types instead of void*
typedef struct n64ddStruct_800FEE70_pointers {
@ -40,10 +46,10 @@ typedef struct n64ddStruct_80121220 {
s32 (*unk_20)(struct MapData*);
s32 (*unk_24)(void);
s32 (*unk_28)(struct PlayState*);
s32 (*unk_2C)(MapMarkData***);
s32 (*unk_30)(MapMarkData***);
void (*unk_34)(PauseMapMarksData**);
void (*unk_38)(PauseMapMarksData**);
s32 (*unk_2C)(struct MapMarkData***);
s32 (*unk_30)(struct MapMarkData***);
void (*unk_34)(struct PauseMapMarksData**);
void (*unk_38)(struct PauseMapMarksData**);
void (*unk_3C)(void);
void (*unk_40)(void);
s32 (*unk_44)(struct PlayState*);
@ -62,7 +68,7 @@ typedef struct n64ddStruct_80121220 {
#if OOT_PAL
s32 (*unk_6C_PAL)(struct Font*);
#endif
void (*unk_6C)(struct PlayState*, SceneDrawConfigFunc*);
void (*unk_6C)(struct PlayState*, struct SceneDrawConfigFunc*);
s32 (*unk_70)(struct DmaRequest* req, void* ram, uintptr_t vrom, size_t size, u32 unk, OSMesgQueue* queue, OSMesg msg);
void (*unk_74)(struct GameState*);
s32 (*unk_78)(struct PlayState*, void*, void*);

View file

@ -1,7 +1,7 @@
#ifndef ONE_POINT_CUTSCENE_H
#define ONE_POINT_CUTSCENE_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
struct Actor;
struct PlayState;

View file

@ -1,7 +1,10 @@
#ifndef PADMGR_H
#define PADMGR_H
#include "ultra64.h"
#include "ultra64/controller.h"
#include "ultra64/message.h"
#include "ultra64/pfs.h"
#include "ultra64/ultratypes.h"
#include "irqmgr.h"
#include "versions.h"

View file

@ -1,7 +1,6 @@
#ifndef QUAKE_H
#define QUAKE_H
#include "z64camera.h"
#include "z64math.h"
typedef struct ShakeInfo {
@ -28,7 +27,9 @@ typedef enum QuakeType {
// continues indefinitely i.e. does not terminate when the timer reaches 0
// must be manually removed
s16 Quake_Request(Camera* camera, u32 type);
struct Camera;
s16 Quake_Request(struct Camera* camera, u32 type);
u32 Quake_SetSpeed(s16 index, s16 speed);
u32 Quake_SetPerturbations(s16 index, s16 y, s16 x, s16 fov, s16 roll);
@ -39,6 +40,6 @@ s16 Quake_GetTimeLeft(s16 index);
u32 Quake_RemoveRequest(s16 index);
void Quake_Init(void);
s16 Quake_Update(Camera* camera, ShakeInfo* camShake);
s16 Quake_Update(struct Camera* camera, ShakeInfo* camShake);
#endif

View file

@ -1,7 +1,7 @@
#ifndef ROMFILE_H
#define ROMFILE_H
#include "ultra64.h"
#include "stdint.h"
typedef struct RomFile {
/* 0x00 */ uintptr_t vromStart;

View file

@ -1,7 +1,7 @@
#ifndef RUMBLE_H
#define RUMBLE_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#define RUMBLE_MAX_REQUESTS 64

View file

@ -1,10 +1,16 @@
#ifndef SCHED_H
#define SCHED_H
#include "ultra64.h"
#include "ultra64/message.h"
#include "ultra64/sptask.h"
#include "ultra64/time.h"
#include "ultra64/ultratypes.h"
#include "irqmgr.h"
#include "unk.h"
#include "versions.h"
struct OSViMode;
#define OS_SC_NEEDS_RDP 0x0001 // Task uses the RDP
#define OS_SC_NEEDS_RSP 0x0002 // Task uses the RSP
#define OS_SC_DRAM_DLIST 0x0004 // Unimplemented
@ -23,7 +29,7 @@
typedef struct CfbInfo {
/* 0x00 */ u16* framebuffer; // current framebuffer
/* 0x04 */ u16* swapBuffer; // framebuffer to swap to
/* 0x08 */ OSViMode* viMode;
/* 0x08 */ struct OSViMode* viMode;
/* 0x0C */ u32 viFeatures;
/* 0x10 */ u8 unk_10; // set to 0, never read
/* 0x11 */ s8 updateRate; // how many VIs should elapse before next swap

View file

@ -2,7 +2,7 @@
#define SEGMENT_SYMBOLS_H
#include "versions.h"
#include "z64.h"
#include "ultra64/ultratypes.h"
#define DECLARE_SEGMENT(name) \
extern u8 _##name##SegmentStart[]; \

View file

@ -1,7 +1,7 @@
#ifndef SEGMENTED_ADDRESS_H
#define SEGMENTED_ADDRESS_H
#include "ultra64.h"
#include "ultra64/mbi.h"
#include "stdint.h"
extern uintptr_t gSegments[NUM_SEGMENTS];

View file

@ -1,7 +1,7 @@
#ifndef SEQUENCE_H
#define SEQUENCE_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "versions.h"
#define DEFINE_SEQUENCE(_0, seqId, _2, _3, _4) seqId,

View file

@ -1,9 +1,8 @@
#ifndef SFX_H
#define SFX_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "versions.h"
#include "z64math.h"
typedef enum SfxBankType {
/* 0 */ BANK_PLAYER,
@ -129,18 +128,20 @@ typedef struct SfxParams {
#define SFX_DIST_SCALING 10.0f
#endif
struct Vec3f;
void Audio_SetSfxBanksMute(u16 muteMask);
void Audio_QueueSeqCmdMute(u8 channelIndex);
void Audio_ClearBGMMute(u8 channelIndex);
void Audio_PlaySfxGeneral(u16 sfxId, Vec3f* pos, u8 token, f32* freqScale, f32* vol, s8* reverbAdd);
void Audio_PlaySfxGeneral(u16 sfxId, struct Vec3f* pos, u8 token, f32* freqScale, f32* vol, s8* reverbAdd);
void Audio_ProcessSfxRequest(void);
void Audio_ChooseActiveSfx(u8 bankId);
void Audio_PlayActiveSfx(u8 bankId);
void Audio_StopSfxByBank(u8 bankId);
void Audio_RemoveSfxFromBankByPos(u8 bankId, Vec3f* pos);
void Audio_StopSfxByPosAndBank(u8 bankId, Vec3f* pos);
void Audio_StopSfxByPos(Vec3f* pos);
void Audio_StopSfxByPosAndId(Vec3f* pos, u16 sfxId);
void Audio_RemoveSfxFromBankByPos(u8 bankId, struct Vec3f* pos);
void Audio_StopSfxByPosAndBank(u8 bankId, struct Vec3f* pos);
void Audio_StopSfxByPos(struct Vec3f* pos);
void Audio_StopSfxByPosAndId(struct Vec3f* pos, u16 sfxId);
void Audio_StopSfxByTokenAndId(u8 token, u16 sfxId);
void Audio_StopSfxById(u32 sfxId);
void Audio_ProcessSfxRequests(void);
@ -148,7 +149,7 @@ void func_800F8F88(void);
u8 Audio_IsSfxPlaying(u32 sfxId);
void Audio_ResetSfx(void);
extern Vec3f gSfxDefaultPos;
extern struct Vec3f gSfxDefaultPos;
extern f32 gSfxDefaultFreqAndVolScale;
extern s8 gSfxDefaultReverb;

View file

@ -1,7 +1,7 @@
#ifndef STACKCHECK_H
#define STACKCHECK_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
typedef enum StackStatus {
/* 0 */ STACK_STATUS_OK,

View file

@ -1,7 +1,7 @@
#ifndef SYS_MATH_H
#define SYS_MATH_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
f32 Math_FactorialF(f32 n);
f32 Math_Factorial(s32 n);

View file

@ -1,78 +1,84 @@
#ifndef SYS_MATH3D_H
#define SYS_MATH3D_H
#include "ultra64.h"
#include "z64math.h"
#include "ultra64/ultratypes.h"
struct PlayState;
struct Vec3f;
struct InfiniteLine;
struct TriNorm;
struct Sphere16;
struct Cylinder16;
struct Linef;
struct Plane;
s32 Math3D_PlaneVsLineSegClosestPoint(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA, f32 planeBB,
f32 planeBC, f32 planeBDist, Vec3f* linePointA, Vec3f* linePointB,
Vec3f* closestPoint);
void Math3D_LineClosestToPoint(InfiniteLine* line, Vec3f* pos, Vec3f* closestPoint);
f32 planeBC, f32 planeBDist, struct Vec3f* linePointA, struct Vec3f* linePointB,
struct Vec3f* closestPoint);
void Math3D_LineClosestToPoint(struct InfiniteLine* line, struct Vec3f* pos, struct Vec3f* closestPoint);
s32 Math3D_PlaneVsPlaneVsLineClosestPoint(f32 planeAA, f32 planeAB, f32 planeAC, f32 planeADist, f32 planeBA,
f32 planeBB, f32 planeBC, f32 planeBDist, Vec3f* point, Vec3f* closestPoint);
void Math3D_LineSplitRatio(Vec3f* v0, Vec3f* v1, f32 ratio, Vec3f* ret);
f32 Math3D_Cos(Vec3f* a, Vec3f* b);
s32 Math3D_CosOut(Vec3f* a, Vec3f* b, f32* dst);
void Math3D_Vec3fReflect(Vec3f* vec, Vec3f* normal, Vec3f* reflVec);
f32 planeBB, f32 planeBC, f32 planeBDist, struct Vec3f* point, struct Vec3f* closestPoint);
void Math3D_LineSplitRatio(struct Vec3f* v0, struct Vec3f* v1, f32 ratio, struct Vec3f* ret);
f32 Math3D_Cos(struct Vec3f* a, struct Vec3f* b);
s32 Math3D_CosOut(struct Vec3f* a, struct Vec3f* b, f32* dst);
void Math3D_Vec3fReflect(struct Vec3f* vec, struct Vec3f* normal, struct Vec3f* reflVec);
s32 Math3D_PointInSquare2D(f32 upperLeftX, f32 lowerRightX, f32 upperLeftY, f32 lowerRightY, f32 x, f32 y);
f32 Math3D_Dist1DSq(f32 a, f32 b);
f32 Math3D_Dist2DSq(f32 x0, f32 y0, f32 x1, f32 y1);
f32 Math3D_Vec3fMagnitudeSq(Vec3f* vec);
f32 Math3D_Vec3fMagnitude(Vec3f* vec);
f32 Math3D_Vec3fDistSq(Vec3f* a, Vec3f* b);
void Math3D_Vec3f_Cross(Vec3f* a, Vec3f* b, Vec3f* ret);
void Math3D_SurfaceNorm(Vec3f* va, Vec3f* vb, Vec3f* vc, Vec3f* normal);
f32 Math3D_Vec3f_DistXYZ(Vec3f* a, Vec3f* b);
s32 Math3D_PointRelativeToCubeFaces(Vec3f* point, Vec3f* min, Vec3f* max);
s32 Math3D_PointRelativeToCubeEdges(Vec3f* point, Vec3f* min, Vec3f* max);
s32 Math3D_PointRelativeToCubeVertices(Vec3f* point, Vec3f* min, Vec3f* max);
s32 Math3D_LineVsCube(Vec3f* min, Vec3f* max, Vec3f* a, Vec3f* b);
void Math3D_RotateXZPlane(Vec3f* pointOnPlane, s16 angle, f32* a, f32* c, f32* d);
void Math3D_DefPlane(Vec3f* va, Vec3f* vb, Vec3f* vc, f32* nx, f32* ny, f32* nz, f32* originDist);
f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p);
f32 Math3D_DistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* p);
s32 Math3D_TriChkPointParaYSlopedY(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 z, f32 x);
s32 Math3D_TriChkPointParaYIntersectDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z,
f32 Math3D_Vec3fMagnitudeSq(struct Vec3f* vec);
f32 Math3D_Vec3fMagnitude(struct Vec3f* vec);
f32 Math3D_Vec3fDistSq(struct Vec3f* a, struct Vec3f* b);
void Math3D_Vec3f_Cross(struct Vec3f* a, struct Vec3f* b, struct Vec3f* ret);
void Math3D_SurfaceNorm(struct Vec3f* va, struct Vec3f* vb, struct Vec3f* vc, struct Vec3f* normal);
f32 Math3D_Vec3f_DistXYZ(struct Vec3f* a, struct Vec3f* b);
s32 Math3D_PointRelativeToCubeFaces(struct Vec3f* point, struct Vec3f* min, struct Vec3f* max);
s32 Math3D_PointRelativeToCubeEdges(struct Vec3f* point, struct Vec3f* min, struct Vec3f* max);
s32 Math3D_PointRelativeToCubeVertices(struct Vec3f* point, struct Vec3f* min, struct Vec3f* max);
s32 Math3D_LineVsCube(struct Vec3f* min, struct Vec3f* max, struct Vec3f* a, struct Vec3f* b);
void Math3D_RotateXZPlane(struct Vec3f* pointOnPlane, s16 angle, f32* a, f32* c, f32* d);
void Math3D_DefPlane(struct Vec3f* va, struct Vec3f* vb, struct Vec3f* vc, f32* nx, f32* ny, f32* nz, f32* originDist);
f32 Math3D_UDistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, struct Vec3f* p);
f32 Math3D_DistPlaneToPos(f32 nx, f32 ny, f32 nz, f32 originDist, struct Vec3f* p);
s32 Math3D_TriChkPointParaYSlopedY(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 z, f32 x);
s32 Math3D_TriChkPointParaYIntersectDist(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z,
f32 x, f32* yIntersect, f32 chkDist);
s32 Math3D_TriChkPointParaYIntersectInsideTri(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist,
s32 Math3D_TriChkPointParaYIntersectInsideTri(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist,
f32 z, f32 x, f32* yIntersect, f32 chkDist);
s32 Math3D_TriChkLineSegParaYIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z,
s32 Math3D_TriChkLineSegParaYIntersect(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 z,
f32 x, f32* yIntersect, f32 y0, f32 y1);
s32 Math3D_TriChkPointParaYDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, Plane* plane, f32 z, f32 x, f32 chkDist);
s32 Math3D_TriChkPointParaXIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 y,
s32 Math3D_TriChkPointParaYDist(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, struct Plane* plane, f32 z, f32 x, f32 chkDist);
s32 Math3D_TriChkPointParaXIntersect(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 y,
f32 z, f32* xIntersect);
s32 Math3D_TriChkLineSegParaXIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 y,
s32 Math3D_TriChkLineSegParaXIntersect(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 y,
f32 z, f32* xIntersect, f32 x0, f32 x1);
s32 Math3D_TriChkPointParaXDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, Plane* plane, f32 y, f32 z, f32 chkDist);
s32 Math3D_TriChkPointParaZIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x,
s32 Math3D_TriChkPointParaXDist(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, struct Plane* plane, f32 y, f32 z, f32 chkDist);
s32 Math3D_TriChkPointParaZIntersect(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x,
f32 y, f32* zIntersect);
s32 Math3D_TriChkLineSegParaZIntersect(Vec3f* v0, Vec3f* v1, Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x,
s32 Math3D_TriChkLineSegParaZIntersect(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, f32 nx, f32 ny, f32 nz, f32 originDist, f32 x,
f32 y, f32* zIntersect, f32 z0, f32 z1);
s32 Math3D_TriChkLineSegParaZDist(Vec3f* v0, Vec3f* v1, Vec3f* v2, Plane* plane, f32 x, f32 y, f32 chkDist);
s32 Math3D_LineSegVsPlane(f32 nx, f32 ny, f32 nz, f32 originDist, Vec3f* linePointA, Vec3f* linePointB,
Vec3f* intersect, s32 fromFront);
void Math3D_TriNorm(TriNorm* tri, Vec3f* va, Vec3f* vb, Vec3f* vc);
s32 Math3D_TriChkLineSegParaZDist(struct Vec3f* v0, struct Vec3f* v1, struct Vec3f* v2, struct Plane* plane, f32 x, f32 y, f32 chkDist);
s32 Math3D_LineSegVsPlane(f32 nx, f32 ny, f32 nz, f32 originDist, struct Vec3f* linePointA, struct Vec3f* linePointB,
struct Vec3f* intersect, s32 fromFront);
void Math3D_TriNorm(struct TriNorm* tri, struct Vec3f* va, struct Vec3f* vb, struct Vec3f* vc);
s32 Math3D_PointDistSqToLine2D(f32 x0, f32 y0, f32 x1, f32 y1, f32 x2, f32 y2, f32* lineLenSq);
s32 Math3D_LineVsSph(Sphere16* sphere, Linef* line);
s32 Math3D_TriVsSphIntersect(Sphere16* sphere, TriNorm* tri, Vec3f* intersectPoint);
s32 Math3D_CylVsLineSeg(Cylinder16* cyl, Vec3f* linePointA, Vec3f* linePointB, Vec3f* intersectA, Vec3f* intersectB);
s32 Math3D_CylVsTri(Cylinder16* cyl, TriNorm* tri);
s32 Math3D_CylTriVsIntersect(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect);
s32 Math3D_SphVsSph(Sphere16* sphereA, Sphere16* sphereB);
s32 Math3D_SphVsSphOverlap(Sphere16* sphereA, Sphere16* sphereB, f32* overlapSize);
s32 Math3D_SphVsSphOverlapCenterDist(Sphere16* sphereA, Sphere16* sphereB, f32* overlapSize, f32* centerDist);
s32 Math3D_SphVsCylOverlap(Sphere16* sph, Cylinder16* cyl, f32* overlapSize);
s32 Math3D_SphVsCylOverlapCenterDist(Sphere16* sph, Cylinder16* cyl, f32* overlapSize, f32* centerDist);
s32 Math3D_CylVsCylOverlap(Cylinder16* ca, Cylinder16* cb, f32* overlapSize);
s32 Math3D_CylVsCylOverlapCenterDist(Cylinder16* ca, Cylinder16* cb, f32* overlapSize, f32* centerDist);
s32 Math3D_TriVsTriIntersect(TriNorm* ta, TriNorm* tb, Vec3f* intersect);
s32 Math3D_XZInSphere(Sphere16* sphere, f32 x, f32 z);
s32 Math3D_XYInSphere(Sphere16* sphere, f32 x, f32 y);
s32 Math3D_YZInSphere(Sphere16* sphere, f32 y, f32 z);
s32 Math3D_LineVsSph(struct Sphere16* sphere, struct Linef* line);
s32 Math3D_TriVsSphIntersect(struct Sphere16* sphere, struct TriNorm* tri, struct Vec3f* intersectPoint);
s32 Math3D_CylVsLineSeg(struct Cylinder16* cyl, struct Vec3f* linePointA, struct Vec3f* linePointB, struct Vec3f* intersectA, struct Vec3f* intersectB);
s32 Math3D_CylVsTri(struct Cylinder16* cyl, struct TriNorm* tri);
s32 Math3D_CylTriVsIntersect(struct Cylinder16* cyl, struct TriNorm* tri, struct Vec3f* intersect);
s32 Math3D_SphVsSph(struct Sphere16* sphereA, struct Sphere16* sphereB);
s32 Math3D_SphVsSphOverlap(struct Sphere16* sphereA, struct Sphere16* sphereB, f32* overlapSize);
s32 Math3D_SphVsSphOverlapCenterDist(struct Sphere16* sphereA, struct Sphere16* sphereB, f32* overlapSize, f32* centerDist);
s32 Math3D_SphVsCylOverlap(struct Sphere16* sph, struct Cylinder16* cyl, f32* overlapSize);
s32 Math3D_SphVsCylOverlapCenterDist(struct Sphere16* sph, struct Cylinder16* cyl, f32* overlapSize, f32* centerDist);
s32 Math3D_CylVsCylOverlap(struct Cylinder16* ca, struct Cylinder16* cb, f32* overlapSize);
s32 Math3D_CylVsCylOverlapCenterDist(struct Cylinder16* ca, struct Cylinder16* cb, f32* overlapSize, f32* centerDist);
s32 Math3D_TriVsTriIntersect(struct TriNorm* ta, struct TriNorm* tb, struct Vec3f* intersect);
s32 Math3D_XZInSphere(struct Sphere16* sphere, f32 x, f32 z);
s32 Math3D_XYInSphere(struct Sphere16* sphere, f32 x, f32 y);
s32 Math3D_YZInSphere(struct Sphere16* sphere, f32 y, f32 z);
void Math3D_DrawSphere(struct PlayState* play, Sphere16* sph);
void Math3D_DrawCylinder(struct PlayState* play, Cylinder16* cyl);
void Math3D_DrawSphere(struct PlayState* play, struct Sphere16* sph);
void Math3D_DrawCylinder(struct PlayState* play, struct Cylinder16* cyl);
#endif

View file

@ -1,10 +1,13 @@
#ifndef SYS_MATRIX_H
#define SYS_MATRIX_H
#include "z64math.h"
#include "ultra64/gbi.h"
#include "ultra64/ultratypes.h"
struct GraphicsContext;
struct GameState;
struct Vec3f;
struct Vec3s;
typedef enum MatrixMode {
/* 0 */ MTXMODE_NEW, // generates a new matrix
@ -34,8 +37,8 @@ void Matrix_RotateZ(f32 z, u8 mode);
/* Compound operations */
void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode);
void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation);
void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot);
void Matrix_TranslateRotateZYX(struct Vec3f* translation, struct Vec3s* rotation);
void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, struct Vec3s* rot);
void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY,
f32 translateZ);
@ -66,8 +69,8 @@ Mtx* Matrix_Finalize(struct GraphicsContext* gfxCtx);
/* Vector operations */
void Matrix_MultVec3f(Vec3f* src, Vec3f* dest);
void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf);
void Matrix_MultVec3f(struct Vec3f* src, struct Vec3f* dest);
void Matrix_MultVec3fExt(struct Vec3f* src, struct Vec3f* dest, MtxF* mf);
/* Copy and another conversion */
@ -78,8 +81,8 @@ void Matrix_MtxToMtxF(Mtx* src, MtxF* dest);
void Matrix_Transpose(MtxF* mf);
void Matrix_ReplaceRotation(MtxF* mf);
void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag);
void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag);
void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode);
void Matrix_MtxFToYXZRotS(MtxF* mf, struct Vec3s* rotDest, s32 flag);
void Matrix_MtxFToZYXRotS(MtxF* mf, struct Vec3s* rotDest, s32 flag);
void Matrix_RotateAxis(f32 angle, struct Vec3f* axis, u8 mode);
#endif

View file

@ -1,8 +1,8 @@
#ifndef THA_H
#define THA_H
#include "ultra64.h"
#include "alignment.h"
#include "stddef.h"
#include "stdint.h"
typedef struct TwoHeadArena {
/* 0x00 */ size_t size;

View file

@ -1,7 +1,10 @@
#ifndef UCODE_DISAS_H
#define UCODE_DISAS_H
#include "ultra64.h"
#include "stdint.h"
#include "ultra64/ultratypes.h"
union Gfx;
typedef enum UcodeType {
/* 0 */ UCODE_TYPE_NULL,
@ -17,7 +20,7 @@ typedef struct UCodeInfo {
typedef struct UCodeDisas {
/* 0x00 */ uintptr_t segments[NUM_SEGMENTS];
/* 0x40 */ Gfx* dlStack[18];
/* 0x40 */ union Gfx* dlStack[18];
/* 0x88 */ s32 dlDepth;
/* 0x8C */ u32 dlCnt;
/* 0x90 */ u32 vtxCnt;
@ -42,7 +45,7 @@ typedef struct UCodeDisas {
void UCodeDisas_Init(UCodeDisas*);
void UCodeDisas_Destroy(UCodeDisas*);
void UCodeDisas_Disassemble(UCodeDisas*, Gfx*);
void UCodeDisas_Disassemble(UCodeDisas*, union Gfx*);
void UCodeDisas_RegisterUCode(UCodeDisas*, s32, UCodeInfo*);
void UCodeDisas_SetCurUCode(UCodeDisas*, void*);

View file

@ -2,8 +2,6 @@
#define VARIABLES_H
#include "z64.h"
#include "libc64/os_malloc.h"
#include "segment_symbols.h"
extern Mtx D_01000000;

View file

@ -78,7 +78,6 @@
#include "sys_math3d.h"
#include "libc64/math64.h"
#include "sys_matrix.h"
#include "main.h"
#include "segmented_address.h"
#include "stackcheck.h"
#include "kaleido_manager.h"

View file

@ -1,7 +1,7 @@
#ifndef Z64_ANIMATION_H
#define Z64_ANIMATION_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "z64dma.h"
#include "z64math.h"
#include "macros.h"
@ -9,6 +9,7 @@
struct PlayState;
struct Actor;
struct SkelAnime;
union Gfx;
/*
* Skeletons and limbs
@ -20,14 +21,14 @@ typedef struct StandardLimb {
/* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent
/* 0x06 */ u8 child;
/* 0x07 */ u8 sibling;
/* 0x08 */ Gfx* dList;
/* 0x08 */ union Gfx* dList;
} StandardLimb; // size = 0xC
typedef struct LodLimb {
/* 0x00 */ Vec3s jointPos; // Root is position in model space, children are relative to parent
/* 0x06 */ u8 child;
/* 0x07 */ u8 sibling;
/* 0x08 */ Gfx* dLists[2]; // Near and far
/* 0x08 */ union Gfx* dLists[2]; // Near and far
} LodLimb; // size = 0x10
// Model has limbs with only rigid meshes
@ -204,20 +205,20 @@ s32 SkelAnime_Update(SkelAnime* skelAnime);
// Draw
typedef s32 (*OverrideLimbDraw)(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void*,
Gfx** gfx);
typedef void (*PostLimbDraw)(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void*, Gfx** gfx);
typedef s32 (*OverrideLimbDraw)(struct PlayState* play, s32 limbIndex, union Gfx** dList, Vec3f* pos, Vec3s* rot, void*,
union Gfx** gfx);
typedef void (*PostLimbDraw)(struct PlayState* play, s32 limbIndex, union Gfx** dList, Vec3s* rot, void*, union Gfx** gfx);
typedef s32 (*OverrideLimbDrawOpa)(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void*);
typedef void (*PostLimbDrawOpa)(struct PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, void*);
typedef s32 (*OverrideLimbDrawOpa)(struct PlayState* play, s32 limbIndex, union Gfx** dList, Vec3f* pos, Vec3s* rot, void*);
typedef void (*PostLimbDrawOpa)(struct PlayState* play, s32 limbIndex, union Gfx** dList, Vec3s* rot, void*);
Gfx* SkelAnime_Draw(struct PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw,
PostLimbDraw postLimbDraw, void* arg, Gfx* gfx);
union Gfx* SkelAnime_Draw(struct PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDraw overrideLimbDraw,
PostLimbDraw postLimbDraw, void* arg, union Gfx* gfx);
void SkelAnime_DrawOpa(struct PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw,
PostLimbDrawOpa postLimbDraw, void* arg);
Gfx* SkelAnime_DrawFlex(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* arg, Gfx* gfx);
union Gfx* SkelAnime_DrawFlex(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, void* arg, union Gfx* gfx);
void SkelAnime_DrawFlexOpa(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount,
OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, void* arg);

View file

@ -1,11 +1,13 @@
#ifndef Z64_ANIMATION_LEGACY_H
#define Z64_ANIMATION_LEGACY_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "z64math.h"
union Gfx;
typedef struct LegacyLimb {
/* 0x000 */ Gfx* dList;
/* 0x000 */ union Gfx* dList;
/* 0x004 */ Vec3f trans;
/* 0x010 */ Vec3s rot;
/* 0x018 */ struct LegacyLimb* sibling;
@ -28,7 +30,7 @@ typedef struct LegacyAnimationHeader {
/* 0x08 */ LegacyJointKey* jointKey;
} LegacyAnimationHeader; // size = 0xC
s32 SkelAnime_GetFrameDataLegacy(LegacyAnimationHeader* animation, s32 frame, Vec3s* frameTable);
s32 SkelAnime_GetFrameDataLegacy(LegacyAnimationHeader* animation, s32 frame, struct Vec3s* frameTable);
s16 Animation_GetLimbCountLegacy(LegacyAnimationHeader* animation);
s16 Animation_GetLengthLegacy(LegacyAnimationHeader* animation);
s16 Animation_GetLastFrameLegacy(LegacyAnimationHeader* animation);

View file

@ -1,11 +1,17 @@
#ifndef Z64_AUDIO_H
#define Z64_AUDIO_H
#include "ultra64.h"
#include "ultra64/message.h"
#include "stddef.h"
#include "ultra64/pi.h"
#include "ultra64/sptask.h"
#include "ultra64/ultratypes.h"
#include "sequence.h"
#include "stdint.h"
#include "z64math.h"
struct GfxPrint;
union Acmd;
typedef void (*AudioCustomUpdateFunction)(void);
@ -936,8 +942,8 @@ typedef struct AudioContext {
/* 0x28A0 */ s32 curAudioFrameDmaCount;
/* 0x28A4 */ s32 rspTaskIndex;
/* 0x28A8 */ s32 curAiBufIndex;
/* 0x28AC */ Acmd* abiCmdBufs[2]; // Pointer to audio heap where the audio binary interface command lists (for the rsp) are stored. Two lists that alternate every frame
/* 0x28B4 */ Acmd* curAbiCmdBuf; // Pointer to the currently active abiCmdBufs
/* 0x28AC */ union Acmd* abiCmdBufs[2]; // Pointer to audio heap where the audio binary interface command lists (for the rsp) are stored. Two lists that alternate every frame
/* 0x28B4 */ union Acmd* curAbiCmdBuf; // Pointer to the currently active abiCmdBufs
/* 0x28B8 */ AudioTask* curTask;
/* 0x28BC */ char unk_28BC[0x4];
/* 0x28C0 */ AudioTask rspTask[2];
@ -1026,7 +1032,7 @@ typedef struct AudioHeapInitSizes {
// TODO these prototypes should be sorted into the relevant audio header files
Acmd* AudioSynth_Update(Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen);
union Acmd* AudioSynth_Update(union Acmd* cmdStart, s32* cmdCnt, s16* aiStart, s32 aiBufLen);
void AudioHeap_DiscardFont(s32 fontId);
void AudioHeap_ReleaseNotesForFont(s32 fontId);
void AudioHeap_DiscardSequence(s32 seqId);

View file

@ -4,7 +4,6 @@
#include "ultra64.h"
#include "z64cutscene.h"
#include "z64math.h"
#include "z64save.h"
struct CollisionContext;
struct View;

View file

@ -1,7 +1,7 @@
#ifndef Z64COLLISION_CHECK_H
#define Z64COLLISION_CHECK_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "z64math.h"
#define COLLISION_CHECK_AT_MAX 50

View file

@ -1,8 +1,8 @@
#ifndef Z64_CURVE_H
#define Z64_CURVE_H
#include "ultra64/gbi.h"
#include "ultra64/ultratypes.h"
#include "z64math.h"
struct PlayState;

View file

@ -1,7 +1,7 @@
#ifndef Z64CUTSCENE_H
#define Z64CUTSCENE_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "z64math.h"
struct PlayState;

View file

@ -1,9 +1,14 @@
#ifndef Z64_DMA_H
#define Z64_DMA_H
#include "ultra64.h"
#include "alignment.h"
#include "romfile.h"
#include "stddef.h"
#include "stdint.h"
#include "ultra64/message.h"
struct OSPiHandle;
struct OSIoMesg;
typedef struct DmaRequest {
/* 0x00 */ uintptr_t vromAddr; // VROM address (source)
@ -44,7 +49,7 @@ s32 DmaMgr_RequestSyncDebug(void* ram, uintptr_t vrom, size_t size, const char*
s32 DmaMgr_DmaRomToRam(uintptr_t rom, void* ram, size_t size);
void DmaMgr_DmaFromDriveRom(void* ram, uintptr_t rom, size_t size);
s32 DmaMgr_AudioDmaHandler(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction);
s32 DmaMgr_AudioDmaHandler(struct OSPiHandle* pihandle, struct OSIoMesg* mb, s32 direction);
// Initialization

View file

@ -1,7 +1,7 @@
#ifndef Z64FRAME_ADVANCE_H
#define Z64FRAME_ADVANCE_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
struct Input;
struct PlayState;

View file

@ -1,7 +1,7 @@
#ifndef Z64GAME_OVER_H
#define Z64GAME_OVER_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
struct PlayState;

View file

@ -1,9 +1,8 @@
#ifndef Z64INVENTORY_H
#define Z64INVENTORY_H
#include "ultra64.h"
#include "z64item.h"
#include "z64save.h"
#include "ultra64/ultratypes.h"
struct PlayState;

View file

@ -1,10 +1,7 @@
#ifndef Z64LIGHT_H
#define Z64LIGHT_H
#include "ultra64.h"
#include "ultra64/gbi.h"
#include "z64math.h"
#include "color.h"
struct GraphicsContext;
struct PlayState;
@ -63,7 +60,7 @@ typedef enum LightType {
/* 0x02 */ LIGHT_POINT_GLOW
} LightType;
typedef void (*LightsBindFunc)(Lights* lights, LightParams* params, Vec3f* vec);
typedef void (*LightsBindFunc)(Lights* lights, LightParams* params, struct Vec3f* vec);
void Lights_PointSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius, s32 type);
void Lights_PointNoGlowSetInfo(LightInfo* info, s16 x, s16 y, s16 z, u8 r, u8 g, u8 b, s16 radius);
@ -72,7 +69,7 @@ void Lights_PointSetColorAndRadius(LightInfo* info, u8 r, u8 g, u8 b, s16 radius
void Lights_DirectionalSetInfo(LightInfo* info, s8 x, s8 y, s8 z, u8 r, u8 g, u8 b);
void Lights_Reset(Lights* lights, u8 ambentR, u8 ambentG, u8 ambentB);
void Lights_Draw(Lights* lights, struct GraphicsContext* gfxCtx);
void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* vec);
void Lights_BindAll(Lights* lights, LightNode* listHead, struct Vec3f* vec);
void LightContext_Init(struct PlayState* play, LightContext* lightCtx);
void LightContext_SetAmbientColor(LightContext* lightCtx, u8 r, u8 g, u8 b);
void LightContext_SetFog(LightContext* lightCtx, u8 r, u8 g, u8 b, s16 fogNear, s16 zFar);

View file

@ -1,7 +1,7 @@
#ifndef Z64MAP_MARK_H
#define Z64MAP_MARK_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#define MAP_MARK_NONE -1
#define MAP_MARK_CHEST 0

View file

@ -1,7 +1,7 @@
#ifndef Z64MATH_H
#define Z64MATH_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "math.h"
#define SQ(x) ((x)*(x))

View file

@ -1,7 +1,8 @@
#ifndef Z64OBJECT_H
#define Z64OBJECT_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "ultra64/message.h"
#include "z64dma.h"
struct PlayState;

View file

@ -1,7 +1,7 @@
#ifndef Z64OCARINA_H
#define Z64OCARINA_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
typedef enum OcarinaSongId {
/* 0 */ OCARINA_SONG_MINUET,

View file

@ -2,7 +2,6 @@
#define Z64PLAYER_H
#include "z64actor.h"
#include "alignment.h"
#include "face_change.h"
struct Player;

View file

@ -1,8 +1,6 @@
#ifndef Z64QUEST_HINT_COMMANDS_H
#define Z64QUEST_HINT_COMMANDS_H
#include "ultra64.h"
/*
* Hint Command Types
*/

View file

@ -1,7 +1,7 @@
#ifndef Z64SAVE_H
#define Z64SAVE_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "versions.h"
#include "z64inventory.h"
#include "z64math.h"

View file

@ -2,11 +2,10 @@
#define Z64SCENE_H
#include "macros.h"
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "z64bgcheck.h"
#include "z64dma.h"
#include "z64environment.h"
#include "z64light.h"
#include "z64math.h"
#include "command_macros_base.h"

View file

@ -1,7 +1,7 @@
#ifndef Z64SFX_SOURCE_H
#define Z64SFX_SOURCE_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "z64math.h"
struct PlayState;

View file

@ -1,13 +1,13 @@
#ifndef Z64SKIN_MATRIX_H
#define Z64SKIN_MATRIX_H
#include "ultra64.h"
#include "z64math.h"
#include "ultra64/ultratypes.h"
struct Vec3f;
struct GraphicsContext;
void SkinMatrix_Vec3fMtxFMultXYZW(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDest);
void SkinMatrix_Vec3fMtxFMultXYZ(MtxF* mf, Vec3f* src, Vec3f* dest);
void SkinMatrix_Vec3fMtxFMultXYZW(MtxF* mf, struct Vec3f* src, struct Vec3f* xyzDest, f32* wDest);
void SkinMatrix_Vec3fMtxFMultXYZ(MtxF* mf, struct Vec3f* src, struct Vec3f* dest);
void SkinMatrix_MtxFMtxFMult(MtxF* mfA, MtxF* mfB, MtxF* dest);
void SkinMatrix_GetClear(MtxF** mfp);
void SkinMatrix_MtxFCopy(MtxF* src, MtxF* dest);

View file

@ -5,7 +5,7 @@
#include "ultra64/gbi.h"
#include "z64math.h"
#include "z64dma.h" // for RomFile
#include "romfile.h"
struct GameState;
struct GraphicsContext;

View file

@ -1,7 +1,8 @@
#ifndef Z64TRANSITION_INSTANCES_H
#define Z64TRANSITION_INSTANCES_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "ultra64/gbi.h"
#include "color.h"
typedef struct TransitionTileVtxData {

View file

@ -1,9 +1,11 @@
#ifndef Z64_VIS_H
#define Z64_VIS_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
#include "color.h"
union Gfx;
typedef enum FramebufferFilterType {
/* 0 */ FB_FILTER_NONE,
/* 1 */ FB_FILTER_CVG_RGB,
@ -47,7 +49,7 @@ typedef struct VisCvg {
void VisCvg_Init(VisCvg* this);
void VisCvg_Destroy(VisCvg* this);
void VisCvg_Draw(VisCvg* this, Gfx** gfxP);
void VisCvg_Draw(VisCvg* this, union Gfx** gfxP);
@ -58,12 +60,12 @@ void VisCvg_Draw(VisCvg* this, Gfx** gfxP);
typedef struct VisMono {
/* 0x00 */ Vis vis;
/* 0x10 */ u16* tlut;
/* 0x14 */ Gfx* dList;
/* 0x14 */ union Gfx* dList;
} VisMono; // size = 0x18
void VisMono_Init(VisMono* this);
void VisMono_Destroy(VisMono* this);
void VisMono_Draw(VisMono* this, Gfx** gfxP);
void VisMono_Draw(VisMono* this, union Gfx** gfxP);
@ -82,6 +84,6 @@ typedef struct VisZBuf {
void VisZBuf_Init(VisZBuf* this);
void VisZBuf_Destroy(VisZBuf* this);
void VisZBuf_Draw(VisZBuf* this, Gfx** gfxP);
void VisZBuf_Draw(VisZBuf* this, union Gfx** gfxP);
#endif

View file

@ -2,9 +2,11 @@
#define Z_LIB_H
#include "libc/stddef.h"
#include "padmgr.h"
#include "z64math.h"
#include "color.h"
struct Input;
struct Vec3f;
struct Vec3s;
struct Color_RGBA8;
void Lib_MemSet(u8* dest, size_t len, u8 val);
f32 Math_CosS(s16 angle);
@ -17,28 +19,28 @@ s32 Math_StepUntilS(s16* pValue, s16 limit, s16 step);
s32 Math_StepToAngleS(s16* pValue, s16 target, s16 step);
s32 Math_StepUntilF(f32* pValue, f32 limit, f32 step);
s32 Math_AsymStepToF(f32* pValue, f32 target, f32 incrStep, f32 decrStep);
void Lib_GetControlStickData(f32* outMagnitude, s16* outAngle, Input* input);
void Lib_GetControlStickData(f32* outMagnitude, s16* outAngle, struct Input* input);
s16 Rand_S16Offset(s16 base, s16 range);
void Math_Vec3f_Copy(Vec3f* dest, Vec3f* src);
void Math_Vec3s_ToVec3f(Vec3f* dest, Vec3s* src);
void Math_Vec3f_Sum(Vec3f* a, Vec3f* b, Vec3f* dest);
void Math_Vec3f_Diff(Vec3f* a, Vec3f* b, Vec3f* dest);
void Math_Vec3s_DiffToVec3f(Vec3f* dest, Vec3s* a, Vec3s* b);
void Math_Vec3f_Scale(Vec3f* vec, f32 scaleF);
f32 Math_Vec3f_DistXYZ(Vec3f* a, Vec3f* b);
f32 Math_Vec3f_DistXYZAndStoreDiff(Vec3f* a, Vec3f* b, Vec3f* dest);
f32 Math_Vec3f_DistXZ(Vec3f* a, Vec3f* b);
s16 Math_Vec3f_Yaw(Vec3f* origin, Vec3f* point);
s16 Math_Vec3f_Pitch(Vec3f* a, Vec3f* b);
void Math_Vec3f_Copy(struct Vec3f* dest, struct Vec3f* src);
void Math_Vec3s_ToVec3f(struct Vec3f* dest, struct Vec3s* src);
void Math_Vec3f_Sum(struct Vec3f* a, struct Vec3f* b, struct Vec3f* dest);
void Math_Vec3f_Diff(struct Vec3f* a, struct Vec3f* b, struct Vec3f* dest);
void Math_Vec3s_DiffToVec3f(struct Vec3f* dest, struct Vec3s* a, struct Vec3s* b);
void Math_Vec3f_Scale(struct Vec3f* vec, f32 scaleF);
f32 Math_Vec3f_DistXYZ(struct Vec3f* a, struct Vec3f* b);
f32 Math_Vec3f_DistXYZAndStoreDiff(struct Vec3f* a, struct Vec3f* b, struct Vec3f* dest);
f32 Math_Vec3f_DistXZ(struct Vec3f* a, struct Vec3f* b);
s16 Math_Vec3f_Yaw(struct Vec3f* origin, struct Vec3f* point);
s16 Math_Vec3f_Pitch(struct Vec3f* a, struct Vec3f* b);
f32 Math_SmoothStepToF(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep);
void Math_ApproachF(f32* pValue, f32 target, f32 fraction, f32 step);
void Math_ApproachZeroF(f32* pValue, f32 fraction, f32 step);
f32 Math_SmoothStepToDegF(f32* pValue, f32 target, f32 fraction, f32 step, f32 minStep);
s16 Math_SmoothStepToS(s16* pValue, s16 target, s16 scale, s16 step, s16 minStep);
void Math_ApproachS(s16* pValue, s16 target, s16 scale, s16 step);
void Color_RGBA8_Copy(Color_RGBA8* dst, Color_RGBA8* src);
void Color_RGBA8_Copy(struct Color_RGBA8* dst, struct Color_RGBA8* src);
void Sfx_PlaySfxCentered(u16 sfxId);
void Sfx_PlaySfxCentered2(u16 sfxId);
void Sfx_PlaySfxAtPos(Vec3f* projectedPos, u16 sfxId);
void Sfx_PlaySfxAtPos(struct Vec3f* projectedPos, u16 sfxId);
#endif

View file

@ -1,7 +1,7 @@
#ifndef ZELDA_ARENA_H
#define ZELDA_ARENA_H
#include "ultra64.h"
#include "ultra64/ultratypes.h"
void* ZeldaArena_Malloc(u32 size);
void* ZeldaArena_MallocR(u32 size);

View file

@ -1,6 +1,7 @@
#include "ultra64.h"
#include "global.h"
#include "versions.h"
#include "segment_symbols.h"
#define MK_ASYNC_MSG(retData, tableType, id, loadStatus) \
(((retData) << 24) | ((tableType) << 16) | ((id) << 8) | (loadStatus))

View file

@ -1,6 +1,7 @@
#include "global.h"
#include "boot.h"
#include "stack.h"
#include "segment_symbols.h"
#if PLATFORM_N64
#include "cic6105.h"
#endif

View file

@ -2,6 +2,8 @@
#include "stack.h"
#include "terminal.h"
#include "versions.h"
#include "segment_symbols.h"
#include "main.h"
#pragma increment_block_number "gc-eu:64 gc-eu-mq:64 gc-jp:64 gc-jp-ce:64 gc-jp-mq:64 gc-us:64 gc-us-mq:64 ntsc-1.2:64"

View file

@ -22,6 +22,7 @@
#include "fault.h"
#include "stack.h"
#include "terminal.h"
#include "segment_symbols.h"
#if PLATFORM_N64
#include "n64dd.h"
#endif

View file

@ -1,4 +1,5 @@
#include "global.h"
#include "segment_symbols.h"
s16 gLinkObjectIds[] = { OBJECT_LINK_BOY, OBJECT_LINK_CHILD };

View file

@ -41,6 +41,7 @@
*/
#include "global.h"
#include "fault.h"
#include "main.h"
#include "versions.h"
#define RSP_DONE_MSG 667

View file

@ -1,4 +1,6 @@
#include "sys_math.h"
#include "math.h"
#include "ultra64/gu.h"
f32 sFactorialTbl[] = { 1.0f, 1.0f, 2.0f, 6.0f, 24.0f, 120.0f, 720.0f,
5040.0f, 40320.0f, 362880.0f, 3628800.0f, 39916800.0f, 479001600.0f };

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "fault.h"
#include "segment_symbols.h"
// Linker symbol declarations (used in the table below)
#define DEFINE_ACTOR(name, _1, _2, _3) DECLARE_OVERLAY_SEGMENT(name)

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "versions.h"
#include "segment_symbols.h"
void Interface_Destroy(PlayState* play) {
Map_Destroy(play);

View file

@ -1,4 +1,5 @@
#include "global.h"
#include "segment_symbols.h"
// Linker symbol declarations (used in the table below)
#define DEFINE_EFFECT_SS(name, _1) DECLARE_OVERLAY_SEGMENT(name)

View file

@ -1,3 +1,4 @@
#include "main.h"
#include "global.h"
#include "terminal.h"

View file

@ -1,4 +1,5 @@
#include "global.h"
#include "segment_symbols.h"
// Linker symbol declarations (used in the table below)
#define DEFINE_GAMESTATE(typeName, enumName, name) DECLARE_OVERLAY_SEGMENT(name)

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "terminal.h"
#include "segment_symbols.h"
#define KALEIDO_OVERLAY(name, nameString) \
{ NULL, ROM_FILE(ovl_##name), _ovl_##name##SegmentStart, _ovl_##name##SegmentEnd, 0, nameString, }

View file

@ -1,6 +1,7 @@
#include "global.h"
#include "message_data_static.h"
#include "versions.h"
#include "segment_symbols.h"
/**
* Loads a texture from kanji for the requested `character` into the character texture buffer

View file

@ -5,6 +5,7 @@
#include "ultra64.h"
#include "terminal.h"
#include "versions.h"
#include "segment_symbols.h"
#include "z64frame_advance.h"

View file

@ -6,6 +6,9 @@
#include "sys_math.h"
#include "rand.h"
#include "sfx.h"
#include "color.h"
#include "padmgr.h"
#include "z64math.h"
/**
* memset: sets `len` bytes to `val` starting at address `dest`.

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "terminal.h"
#include "segment_symbols.h"
#include "assets/objects/gameplay_keep/gameplay_keep.h"
#include "assets/textures/parameter_static/parameter_static.h"
#if PLATFORM_N64

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "terminal.h"
#include "segment_symbols.h"
#include "assets/textures/parameter_static/parameter_static.h"
#if PLATFORM_N64
#include "n64dd.h"

View file

@ -2,6 +2,7 @@
#include "message_data_static.h"
#include "terminal.h"
#include "versions.h"
#include "segment_symbols.h"
#include "assets/textures/parameter_static/parameter_static.h"
#if PLATFORM_N64
#include "n64dd.h"

View file

@ -1,6 +1,8 @@
#include "global.h"
#include "terminal.h"
#include "versions.h"
#include "segment_symbols.h"
#include "main.h"
#include "assets/textures/parameter_static/parameter_static.h"
#include "assets/textures/do_action_static/do_action_static.h"
#include "assets/textures/icon_item_static/icon_item_static.h"

View file

@ -1,4 +1,5 @@
#include "global.h"
#include "main.h"
Gfx sSetupDL[SETUPDL_MAX][6] = {
{

View file

@ -1,4 +1,5 @@
#include "global.h"
#include "segment_symbols.h"
void Sample_HandleStateChange(SampleState* this) {
if (CHECK_BTN_ALL(this->state.input[0].press.button, BTN_START)) {

View file

@ -1,6 +1,7 @@
#include "global.h"
#include "terminal.h"
#include "versions.h"
#include "segment_symbols.h"
SceneCmdHandlerFunc sSceneCmdHandlers[SCENE_CMD_ID_MAX];
RomFile sNaviQuestHintFiles[];

View file

@ -1,6 +1,7 @@
#include "global.h"
#include "quake.h"
#include "versions.h"
#include "segment_symbols.h"
#include "z64frame_advance.h"
#if PLATFORM_N64
#include "n64dd.h"

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "terminal.h"
#include "segment_symbols.h"
#define ANIM_INTERP 1

View file

@ -1,5 +1,6 @@
#include "global.h"
#include "terminal.h"
#include "main.h"
vu32 sLogOnNextViewInit = true;

View file

@ -1,6 +1,7 @@
#include "global.h"
#include "ultra64/viint.h"
#include "versions.h"
#include "main.h"
void ViMode_LogPrint(OSViMode* osViMode) {
LOG_ADDRESS("osvimodep", osViMode, "../z_vimode.c", 87);

View file

@ -1,6 +1,7 @@
#include "global.h"
#include "terminal.h"
#include "z64environment.h"
#include "segment_symbols.h"
typedef struct SkyboxFaceParams {
/* 0x000 */ s32 xStart;

View file

@ -1,5 +1,8 @@
#include "z64math.h"
#include "macros.h"
#include "segment_symbols.h"
#include "ultra64/gu.h"
#include "stdbool.h"
#if !PLATFORM_N64
s32 gUseAtanContFrac;

View file

@ -27,8 +27,10 @@
#include "terminal.h"
#include "versions.h"
#include "z64audio.h"
#include "z64item.h"
#include "z64play.h"
#include "z64player.h"
#include "z64save.h"
#include "z64skin_matrix.h"
#include "z_lib.h"
#if PLATFORM_N64

View file

@ -1,6 +1,8 @@
#include "file_select.h"
#include "terminal.h"
#include "versions.h"
#include "segment_symbols.h"
#include "main.h"
#if OOT_PAL_N64
#include "assets/objects/object_mag/object_mag.h"
#endif

View file

@ -9,6 +9,7 @@
#include "terminal.h"
#include "alloca.h"
#include "z64.h"
#include "segment_symbols.h"
#if PLATFORM_N64
#include "n64dd.h"

View file

@ -7,6 +7,7 @@
#include "global.h"
#include "alloca.h"
#include "versions.h"
#include "segment_symbols.h"
#if PLATFORM_N64
#include "cic6105.h"

View file

@ -15,6 +15,7 @@
#include "assets/textures/icon_item_gameover_static/icon_item_gameover_static.h"
#include "terminal.h"
#include "versions.h"
#include "segment_symbols.h"
#pragma increment_block_number "ntsc-1.2:128 pal-1.0:128 pal-1.1:128"