1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 22:44:30 +00:00

Merge branch 'master' into skelanime

This commit is contained in:
KrimtonZ 2020-03-22 20:35:10 -05:00
commit d136468ace
1304 changed files with 15506 additions and 25453 deletions

View file

@ -1,18 +1,15 @@
#ifndef _COLOR_H_
#define _COLOR_H_
typedef struct
{
typedef struct {
u8 r, g, b;
} Color_RGB8;
typedef struct
{
typedef struct {
u8 r, g, b, a;
} Color_RGBA8;
typedef struct
{
typedef struct {
f32 r, g, b, a;
} Color_RGBAf;

34
include/fp.h Normal file
View file

@ -0,0 +1,34 @@
#ifndef _FP_H_
#define _FP_H_
#include <ultra64.h>
extern f32 qNaN0x3FFFFF;
extern f32 qNaN0x10000;
extern f32 sNaN0x3FFFFF;
f32 floorf(f32 x);
f64 floor(f64 x);
s32 lfloorf(f32 x);
s32 lfloor(f64 x);
f32 ceilf(f32 x);
f64 ceil(f64 x);
s32 lceilf(f32 x);
s32 lceil(f64 x);
f32 truncf(f32 x);
f64 trunc(f64 x);
s32 ltruncf(f32 x);
s32 ltrunc(f64 x);
f32 nearbyintf(f32 x);
f64 nearbyint(f64 x);
s32 lnearbyintf(f32 x);
s32 lnearbyint(f64 x);
f32 roundf(f32 x);
f64 round(f64 x);
s32 lroundf(f32 x);
s32 lround(f64 x);
#endif

View file

@ -26,7 +26,8 @@ void DmaMgr_ThreadEntry(void* arg0);
s32 DmaMgr_SendRequestImpl(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk, OSMesgQueue* queue, OSMesg msg);
s32 DmaMgr_SendRequest0(u32 ram, u32 vrom, u32 size);
void DmaMgr_Start();
s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg, const char* file, s32 line);
s32 DmaMgr_SendRequest2(DmaRequest* req, u32 ram, u32 vrom, u32 size, u32 unk5, OSMesgQueue* queue, OSMesg msg,
const char* file, s32 line);
s32 DmaMgr_SendRequest1(void* ram0, u32 vrom, u32 size, const char* file, s32 line);
void* Yaz0_FirstDMA();
void* Yaz0_NextDMA(void* curSrcPos);
@ -42,26 +43,29 @@ void isPrintfInit();
void osSyncPrintfUnused(const char* fmt, ...);
void osSyncPrintf(const char* fmt, ...);
void rmonPrintf(const char* fmt, ...);
u32 is_proutSyncPrintf(void* arg0, const char *str, s32 count);
u32 is_proutSyncPrintf(void* arg0, const char* str, s32 count);
void func_80002384(const char* exp, const char* file, u32 line);
OSPiHandle* osDriveRomInit();
void Yaz0_Old_DecompressImpl(Yaz0Header* hdr, u8* dst);
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace, const char* name);
void StackCheck_Init(StackEntry* entry, void* stackTop, void* stackBottom, u32 initValue, s32 minSpace,
const char* name);
void StackCheck_Cleanup(StackEntry* entry);
StackStatus StackCheck_GetState(StackEntry* entry);
u32 StackCheck_CheckAll();
u32 StackCheck_Check(StackEntry* entry);
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name, float var2, const char* var3Name, float var3);
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2, const char* var3Name, s32 var3);
float LogUtils_CheckFloatRange(const char* exp, s32 arg1, const char* var1Name, float var1, const char* var2Name,
float var2, const char* var3Name, float var3);
s32 LogUtils_CheckIntRange(const char* exp, s32 arg1, const char* var1Name, s32 var1, const char* var2Name, s32 var2,
const char* var3Name, s32 var3);
void LogUtils_LogHexDump(void* ptr, s32 size0);
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char *name, const char *file, s32 line);
void LogUtils_LogPointer(s32 value, u32 max, void* ptr, const char* name, const char* file, s32 line);
void LogUtils_CheckBoundary(const char* name, s32 value, s32 unk, const char* file, s32 line);
void LogUtils_CheckNullPointer(const char* exp, void* ptr, const char* file, s32 line);
void LogUtils_CheckValidPointer(const char* exp, void* ptr0, const char* file, s32 line);
void LogUtils_LogThreadId(const char* name, s32 line);
void LogUtils_HungupThread(const char* name, s32 line);
void LogUtils_ResetHungup();
char* proutSprintf(char* dst, const char *fmt, size_t size);
char* proutSprintf(char* dst, const char* fmt, size_t size);
s32 vsprintf(char* dst, const char* fmt, va_list args);
s32 sprintf(char* dst, const char* fmt, ...);
void __osPiCreateAccessQueue(void);
@ -88,55 +92,55 @@ void __osExceptionPreamble();
// ? __osException(?);
void __osEnqueueAndYield(OSThread**);
void __osEnqueueThread(OSThread**, OSThread*);
OSThread *__osPopThread(OSThread**);
OSThread* __osPopThread(OSThread**);
// ? __osNop(?);
void __osDispatchThread();
void __osCleanupThread(void);
void __osDequeueThread(OSThread **queue, OSThread *thread);
void osDestroyThread(OSThread *thread);
void bzero(void *__s, u32 __n);
void __osDequeueThread(OSThread** queue, OSThread* thread);
void osDestroyThread(OSThread* thread);
void bzero(void* __s, u32 __n);
void osCreateThread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri);
void __osSetSR(u32);
u32 __osGetSR();
void osWritebackDCache(void *vaddr, s32 nbytes);
void osWritebackDCache(void* vaddr, s32 nbytes);
void* osViGetNextFramebuffer();
void osCreatePiManager(OSPri pri, OSMesgQueue *cmdQ, OSMesg *cmdBuf, s32 cmdMsgCnt);
void osCreatePiManager(OSPri pri, OSMesgQueue* cmdQ, OSMesg* cmdBuf, s32 cmdMsgCnt);
void __osDevMgrMain(void* arg);
s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void *dram_addr, size_t size);
s32 __osPiRawStartDma(s32 dir, u32 cart_addr, void* dram_addr, size_t size);
u32 osVirtualToPhysical(void* vaddr);
void osViBlack(u8 active);
s32 __osSiRawReadIo(void *a0, u32 *a1);
s32 __osSiRawReadIo(void* a0, u32* a1);
OSId osGetThreadId(OSThread* thread);
OSIntMask osSetIntMask(OSIntMask);
void osViSetMode(OSViMode *mode);
u32 __osProbeTLB(void *);
void osViSetMode(OSViMode* mode);
u32 __osProbeTLB(void*);
u32 osGetMemSize(void);
void osSetEventMesg(OSEvent e, OSMesgQueue *mq, OSMesg msg);
s32 _Printf(char *(*pfn)(char *, const char *, size_t), char *arg, const char *fmt, va_list ap);
void osSetEventMesg(OSEvent e, OSMesgQueue* mq, OSMesg msg);
s32 _Printf(char* (*pfn)(char*, const char*, size_t), char* arg, const char* fmt, va_list ap);
void osUnmapTLBAll(void);
s32 osEPiStartDma(OSPiHandle* handle, OSIoMesg* mb, s32 direction);
const u8 *strchr(const u8 *str, s32 ch);
size_t strlen(const u8 *str);
void *memcpy(void *dst, const void *src, size_t size);
const u8* strchr(const u8* str, s32 ch);
size_t strlen(const u8* str);
void* memcpy(void* dst, const void* src, size_t size);
void osInvalICache(void* vaddr, s32 nbytes);
void osCreateMesgQueue(OSMesgQueue* mq, OSMesg* msg, s32 count);
void osInvalDCache(void* vaddr, s32 nbytes);
u32 __osSiDeviceBusy();
void osSetThreadPri(OSThread* thread, OSPri pri);
OSPri osGetThreadPri(OSThread* thread);
s32 __osEPiRawReadIo(OSPiHandle *handle, u32 devAddr, u32 *data);
void osViSwapBuffer(void *vaddr);
s32 __osEPiRawStartDma(OSPiHandle *handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size);
u32 bcmp(void *__sl,void *__s2,u32 __n);
s32 __osEPiRawReadIo(OSPiHandle* handle, u32 devAddr, u32* data);
void osViSwapBuffer(void* vaddr);
s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, u32 cartAddr, void* dramAddr, size_t size);
u32 bcmp(void* __sl, void* __s2, u32 __n);
OSTime osGetTime(void);
void __osTimerServicesInit();
void __osTimerInterrupt();
void __osSetTimerIntr(OSTime tim);
OSTime __osInsertTimer(OSTimer *a0);
OSTime __osInsertTimer(OSTimer* a0);
u32 osGetCount(void);
void __osSetGlobalIntMask(u32 mask);
void __osSetCompare(u32);
void* bcopy(void *__src,void *__dest,u32 __n);
void* bcopy(void* __src, void* __dest, u32 __n);
void __osResetGlobalIntMask(u32 mask);
s32 __osDisableInt(void);
void __osRestoreInt(s32);
@ -151,9 +155,9 @@ u32 __osGetFpcCsr();
s32 osEPiWriteIo(OSPiHandle* handle, u32 devAddr, u32 data);
void osMapTLBRdb(void);
u32 __osGetCause();
s32 __osEPiRawWriteIo(OSPiHandle *handle, u32 devAddr, u32 data);
s32 __osEPiRawWriteIo(OSPiHandle* handle, u32 devAddr, u32 data);
void osCreateViManager(OSPri pri);
void viMgrMain(void *vargs);
void viMgrMain(void* vargs);
OSViContext* __osViGetCurrentContext();
void osStartThread(OSThread* thread);
void osViSetYScale(float scale);
@ -223,8 +227,8 @@ void func_80028B74(GlobalContext*, Vec3f*, UNK_PTR, UNK_PTR, Color_RGB8*, Color_
// ? func_80028FD8(?);
// ? func_80029060(?);
void Effect_SpawnFragment(GlobalContext* globalCtx, Vec3f* burstDepthY, Vec3f* burstDepthX, Vec3f* burstOrigin,
s16 gravityInfluence, s16 u0, s16 rotSpeed, s16 burstVel, u8 u1, s16 scale, u8 u2,
s16 jitter, s32 duration, s16 u3, s16 objNumber, u32 dList);
s16 gravityInfluence, s16 u0, s16 rotSpeed, s16 burstVel, u8 u1, s16 scale, u8 u2, s16 jitter,
s32 duration, s16 u3, s16 objNumber, u32 dList);
// ? func_800292DC(?);
// ? func_80029320(?);
// ? func_80029444(?);
@ -238,7 +242,8 @@ void Effect_SpawnFragment(GlobalContext* globalCtx, Vec3f* burstDepthY, Vec3f* b
// ? func_8002A32C(?);
// ? func_8002A3C4(?);
void func_8002A65C(GlobalContext* globalCtx, Actor* actor, Vec3f* pos, u32 arg3, u32 arg4);
void func_8002A6B8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* arg2, Vec3f* arg3, u32 arg4, s32 arg5, u32 arg6, u32 arg7, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13, u32 arg14, u32 arg15);
void func_8002A6B8(GlobalContext* globalCtx, Vec3f* pos, Vec3f* arg2, Vec3f* arg3, u32 arg4, s32 arg5, u32 arg6,
u32 arg7, u32 arg8, u32 arg9, u32 arg10, u32 arg11, u32 arg12, u32 arg13, u32 arg14, u32 arg15);
// ? func_8002A894(?);
// ? func_8002A95C(?);
// ? func_8002A9F4(?);
@ -268,10 +273,10 @@ void Flags_SetTempClear(GlobalContext* globalCtx, s32 flag);
void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag);
s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag);
void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag);
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture,
s16 arg3, s16 arg4, u8 arg5, u8 arg6);
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture,
s32 arg3, s32 arg4, s32 arg5, s32 arg6, s32 arg7);
void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s16 arg3, s16 arg4,
u8 arg5, u8 arg6);
void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, u32 texture, s32 arg3, s32 arg4,
s32 arg5, s32 arg6, s32 arg7);
s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx);
void Actor_Kill(Actor* actor);
void Actor_SetHeight(Actor* actor, f32 offset);
@ -357,18 +362,18 @@ void func_800304DC(GlobalContext* globalCtx, ActorContext* actorCtx, ActorEntry*
void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx);
s32 func_800314D4(GlobalContext* globalCtx, Actor* actorB, Vec3f* arg2, f32 arg3);
void func_80031B14(GlobalContext* globalCtx, ActorContext* actorCtx);
Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId,
f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params);
Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId,
f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params);
Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId, f32 posX, f32 posY, f32 posZ,
s16 rotX, s16 rotY, s16 rotZ, s16 params);
Actor* Actor_SpawnAttached(ActorContext* actorCtx, Actor* attachedTo, GlobalContext* globalCtx, s16 actorId, f32 posX,
f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, s16 params);
void Actor_SpawnTransitionActors(GlobalContext* globalCtx, ActorContext* actorCtx);
Actor* Actor_SpawnEntry(ActorContext* actorCtx, ActorEntry* actorEntry, GlobalContext* globalCtx);
Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, GlobalContext* globalCtx);
Actor* func_80032AF0(GlobalContext* globalCtx, ActorContext* actorCtx, Actor** actorPtr, Player* player);
Actor* Actor_Find(ActorContext* actorCtx, s32 actorId, s32 actorType);
void func_80032C7C(GlobalContext* globalCtx, Actor* actor);
void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3,
s32 arg4, f32 arg5, s16 arg6, s16 arg7, u8 arg8);
void func_80033260(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3, s32 arg4, f32 arg5, s16 arg6,
s16 arg7, u8 arg8);
void func_80033480(GlobalContext* globalCtx, Vec3f* arg1, f32 arg2, s32 arg3, s16 arg4, s16 arg5, u8 arg6);
Actor* func_80033640(GlobalContext* globalCtx, Collider* collider);
Actor* func_80033684(GlobalContext* globalCtx, Actor* explosiveActor);
@ -389,9 +394,14 @@ void func_8003424C(GlobalContext* globalCtx, Vec3f* arg1);
void func_8003426C(Actor* actor, s16 arg1, s16 arg2, s16 arg3, s16 arg4);
Hilite* func_800342EC(Vec3f* object, GlobalContext* globalCtx);
Hilite* func_8003435C(Vec3f* object, GlobalContext* globalCtx);
s32 func_800343CC(GlobalContext* globalCtx, Actor* actor, s16* arg2, f32 arg3, u16 (*unkFunc1)(GlobalContext*, Actor*),
s16 (*unkFunc2)(GlobalContext*, Actor*));
s16 func_800347E8(s16 arg0);
void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor, s16 alpha);
void func_80034BA0(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor,
s16 alpha);
void func_80034CC4(GlobalContext* globalCtx, SkelAnime* skelAnime, void* unkFunc1, void* unkFunc2, Actor* actor,
s16 alpha);
void func_80034EC0(SkelAnime* skelAnime, struct_80034EC0_Entry* arg1, s32 arg2);
void Actor_Noop(Actor* actor, GlobalContext* globalCtx);
void Draw_DListOpa(GlobalContext* globalCtx, u32 dlist);
void Draw_DListXlu(GlobalContext* globalCtx, u32 dlist);
@ -647,7 +657,7 @@ s16 func_8005A9F4(Camera* camera);
// ? func_8005AFB4(?);
// ? func_8005B044(?);
// ? func_8005B1A4(?);
s32 CollisionBtlTbl_Get(s32 index);
s32 CollisionBtlTbl_Get(s32 index);
// ? func_8005B280(?);
// ? func_8005B2AC(?);
// ? func_8005B65C(?);
@ -686,7 +696,8 @@ s32 func_8005C328(GlobalContext* globalCtx, ColliderDimensions* dest, ColliderDi
s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision);
s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision);
s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* arg2);
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src);
s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor,
ColliderCylinderInit* src);
s32 func_8005C508(GlobalContext* globalCtx, ColliderCylinderMain* collision);
s32 func_8005C540(GlobalContext* globalCtx, ColliderCylinderMain* collision);
s32 func_8005C578(GlobalContext* globalCtx, ColliderCylinderMain* collision);
@ -719,9 +730,12 @@ void func_8005D400(UNK_TYPE, UNK_TYPE);
// ? func_8005D40C(?);
// ? func_8005D4DC(?);
// ? func_8005D62C(?);
s32 Actor_CollisionCheck_SetAT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision);
s32 Actor_CollisionCheck_SetAC(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision);
s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups, ColliderCylinderMain* collision);
s32 Actor_CollisionCheck_SetAT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups,
ColliderCylinderMain* collision);
s32 Actor_CollisionCheck_SetAC(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups,
ColliderCylinderMain* collision);
s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60* simpleBodyGroups,
ColliderCylinderMain* collision);
// ? func_8005DF2C(?);
// ? func_8005DF50(?);
// ? func_8005DF74(?);
@ -742,8 +756,8 @@ s32 Actor_CollisionCheck_SetOT(GlobalContext* globalCtx, SubGlobalContext11E60*
// ? func_80061C98(?);
// ? func_80061E48(?);
// ? func_80061E8C(?);
void func_80061ED4(SubActorStruct98 *sub98, ActorDamageChart *damageChart, SubActor98Init *subActor98Init);
// ? func_80061EFC(?);
void func_80061ED4(SubActorStruct98* sub98, ActorDamageChart* damageChart, SubActor98Init* subActor98Init);
void func_80061EFC(SubActorStruct98* sub98, ActorDamageChart* damageChart, SubActor98Init* subActor98Init);
// ? func_80061F64(?);
// ? func_800622E4(?);
// ? func_80062530(?);
@ -766,9 +780,9 @@ void func_8006375C(s32 arg0, s32 arg1, float* d_80855320);
// ? func_80063C04(?);
// ? func_80063D7C(?);
void DebugDisplay_Init(void);
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ,
f32 scaleX, f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha,
s16 type, GraphicsContext* gfxCtx);
DebugDispObject* DebugDisplay_AddObject(f32 posX, f32 posY, f32 posZ, s16 rotX, s16 rotY, s16 rotZ, f32 scaleX,
f32 scaleY, f32 scaleZ, u8 red, u8 green, u8 blue, u8 alpha, s16 type,
GraphicsContext* gfxCtx);
void DebugDisplay_DrawObjects(GlobalContext* globalCtx);
void func_8006450C(GlobalContext* globalCtx, CutsceneContext* csCtx);
void func_80064534(GlobalContext* globalCtx, CutsceneContext* csCtx);
@ -786,6 +800,7 @@ void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos2, s32 radius
// ? func_8006BE88(?);
// ? func_8006BF1C(?);
// ? func_8006C0FC(?);
u16 func_8006C360(GlobalContext*, u32);
// ? func_8006C3A0(?);
// ? func_8006C3D0(?);
void func_8006C438(GlobalContext* globalCtx, s16 arg1);
@ -881,9 +896,12 @@ void Health_InitData(GlobalContext* globalCtx);
void Health_UpdateData(GlobalContext* globalCtx);
void Interface_DrawHealth(GlobalContext* globalCtx);
void Health_HandleCriticalAlarm(GlobalContext* globalCtx);
void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius, u32 type);
void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius);
void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue, s16 radius);
void Lights_InitPositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
s16 radius, u32 type);
void Lights_InitType0PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
s16 radius);
void Lights_InitType2PositionalLight(LightInfoPositional* info, s16 posX, s16 posY, s16 posZ, u8 red, u8 green, u8 blue,
s16 radius);
void Lights_SetPositionalLightColorAndRadius(LightInfoPositional* info, u8 red, u8 green, u8 blue, s16 radius);
void Lights_InitDirectional(LightInfoDirectional* info, s8 dirX, s8 dirY, s8 dirZ, u8 red, u8 green, u8 blue);
void Lights_MapperInit(LightMapper* mapper, u8 red, u8 green, u8 blue);
@ -987,6 +1005,7 @@ s32 func_80087708(GlobalContext* globalCtx, s16 arg1, s16 arg2);
void func_80088B34(s16 arg0);
void Interface_Draw(GlobalContext* globalCtx);
void Interface_Update(GlobalContext* globalCtx);
f32 func_8008E520(Actor* actor, Path* path, s16, s16*);
// ? func_8008E6A0(?);
// ? func_8008E6AC(?);
// ? func_8008E750(?);
@ -1062,7 +1081,7 @@ void func_80093D18(GraphicsContext* gfxCtx);
void func_80093D84(GraphicsContext* gfxCtx);
// ? func_80093F34(?);
// ? func_80093F58(?);
void func_80094044(GraphicsContext *gfxCtx);
void func_80094044(GraphicsContext* gfxCtx);
// ? func_800940B0(?);
// ? func_800942F0(?);
// ? func_8009435C(?);
@ -1078,8 +1097,10 @@ Gfx* func_800946E4(Gfx* a0);
// ? func_80094DB8(?);
Gfx* func_80094E78(GraphicsContext* gfxCtx, u32 x, u32 y);
Gfx* Draw_TexScroll(GraphicsContext* gfxCtx, u32 x, u32 y, s32 width, s32 height);
Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2);
Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha);
Gfx* Draw_TwoTexScroll(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2, u32 x2,
u32 y2, s32 width2, s32 height2);
Gfx* Draw_TwoTexScrollEnvColor(GraphicsContext* gfxCtx, s32 tile1, u32 x1, u32 y1, s32 width1, s32 height1, s32 tile2,
u32 x2, u32 y2, s32 width2, s32 height2, s32 red, s32 green, s32 blue, s32 alpha);
// ? func_80095248(?);
void func_80095AA0(GlobalContext* globalCtx, Room* room, UNK_TYPE arg2, UNK_TYPE arg3);
// ? func_8009638C(?);
@ -1089,12 +1110,13 @@ s32 func_8009728C(GlobalContext* globalCtx, RoomContext* roomCtx, s32 roomNum);
s32 func_800973FC(GlobalContext* globalCtx, RoomContext* roomCtx);
void Room_Draw(GlobalContext* globalCtx, Room* room, u32 flags);
void func_80097534(GlobalContext* globalCtx, RoomContext* roomCtx);
// ? func_800975D0(?);
// ? func_80097604(?);
// ? func_80097820(?);
// ? func_80097848(?);
// ? func_80097850(?);
// ? func_80097904(?);
void Sample_Calc(SampleContext* this);
void Sample_Draw(SampleContext* this);
void Sample_Update(SampleContext* this);
void Sample_Destroy(SampleContext* this);
void Sample_SetupView(SampleContext* this);
void Sample_LoadTitleStatic(SampleContext* this);
void Sample_Init(SampleContext* this);
void Inventory_ChangeEquipment(s16 equipment, u16 value);
u8 Inventory_DeleteEquipment(GlobalContext* globalCtx, s16 equipment);
void Inventory_ChangeUpgrade(s16 upgrade, s16 value);
@ -1111,19 +1133,18 @@ void Scene_Draw(GlobalContext* globalCtx);
// ? func_800A0D94(?);
// ? func_800A106C(?);
// ? func_800A1344(?);
void SkelAnime_Draw(GlobalContext* globalCtx, u32* limbTable, Vec3s* actorDrawTable,
SkelAnime_LimbUpdateMatrix updateMtxFunc, SkelAnime_LimbAppendDlist appendDlistFunc,
Actor* actor);
void SkelAnime_Draw(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0,
void* internal1);
// ? func_800A180C(?);
void func_800A1AC8(GlobalContext* globalCtx, u32* limbTable, Vec3s* actorDrawTable,
u32 dListCount, SkelAnime_LimbUpdateMatrix updateMtxFunc,
SkelAnime_LimbAppendDlist appendDlistFunc, Actor* actor);
void func_800A1AC8(GlobalContext* globalCtx, u32 limbIndex, u32 actorDrawTbl, u32 dListCount, void* posUpdateFunc,
void* drawFunc, Actor* actor);
// ? func_800A1D8C(?);
// ? func_800A1FC8(?);
s32 SkelAnime_GetFrameCount(u32 animation);
// ? func_800A2044(?);
// ? func_800A24A0(?);
Gfx* func_800A273C(GlobalContext* globalCtx, u32* limbTable, Vec3s* actorDrawTable, s32 arg3, SkelAnime_LimbUpdateMatrix2 arg4, SkelAnime_LimbAppendDlist2 arg5, Actor* arg6, Gfx *arg7);
Gfx* func_800A273C(GlobalContext* globalCtx, u32 limbIndex, u32 adt, u8 limbDListCnt, void* internal0, void* internal1,
Actor* actor, Gfx* gfx);
// ? func_800A2E70(?);
// ? func_800A32EC(?);
// ? func_800A3334(?);
@ -1138,8 +1159,15 @@ Gfx* func_800A273C(GlobalContext* globalCtx, u32* limbTable, Vec3s* actorDrawTab
// ? func_800A3F08(?);
// ? func_800A3D70(?);
// ? func_800A4478(?);
<<<<<<< HEAD
void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skelAnimeInitSeg, u32 animation, Vec3s* actorDrawTable, s32 arg5, s32 limbCount);
void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skelAnimeInitSeg, u32 animation, Vec3s* actorDrawTable, s32 arg5, s32 limbCount);
=======
void SkelAnime_Init(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1,
u8 unk2);
void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skeleton, u32 animation, u16* unk0, u16* unk1,
u8 unk2);
>>>>>>> master
// ? func_800A4A20(?);
// ? func_800A4AD8(?);
// ? func_800A4D9C(?);
@ -1149,10 +1177,18 @@ void func_800A46F8(GlobalContext* globalCtx, SkelAnime* skelAnime, u32 skelAnime
s32 SkelAnime_FrameUpdateMatrix(SkelAnime* skelAnime);
// ? func_800A4C58(?);
// ? func_800A4FE4(?);
<<<<<<< HEAD
void SkelAnime_ChangeAnimation(SkelAnime* skelAnime, u32 animation, f32 playbackSpeed, f32 unk0, f32 frameCount, u8 unk1, f32 transitionRate);
void func_800A51E8(SkelAnime *skelAnime, u32 animation);
void func_800A5240(SkelAnime *skelAnime, u32 animation, f32 unk0);
void func_800A529C(SkelAnime *skelAnime, u32 animation, f32 unk0);
=======
void SkelAnime_ChangeAnimation(SkelAnime* skelAnime, u32 animation, f32 playbackSpeed, f32 unk0, f32 frameCount,
u8 unk1, f32 transitionRate);
void func_800A51E8(SkelAnime* skelAnime, u32 animation);
void func_800A5240(SkelAnime* skelAnime, u32 animation, f32 unk0);
void func_800A529C(SkelAnime* skelAnime, u32 animation, f32 unk0, Actor* actor);
>>>>>>> master
// ? func_800A52F8(?);
// ? func_800A54FC(?);
s32 func_800A56C8(SkelAnime* skelAnime, f32 arg1);
@ -1347,7 +1383,7 @@ void KaleidoScopeCall_LoadPlayer();
void KaleidoScopeCall_Init(GlobalContext* globalCtx);
void KaleidoScopeCall_Destroy(GlobalContext* globalCtx);
void KaleidoScopeCall_Update(GlobalContext* globalCtx);
void KaleidoScopeCall_Draw(GlobalContext *globalCtx);
void KaleidoScopeCall_Draw(GlobalContext* globalCtx);
// ? func_800BC450(?);
// ? func_800BC490(?);
s32 func_800BC56C(GlobalContext*, s16);
@ -1378,7 +1414,7 @@ void func_800C0704(GlobalContext*, s16, f32);
// ? func_800C078C(?);
// ? func_800C0808(?);
// ? func_800C0874(?);
void func_800C0C88(GlobalContext *globalCtx);
void func_800C0C88(GlobalContext* globalCtx);
// ? func_800C0A44(?);
// ? func_800C0A88(?);
void func_800C0AF4(GlobalContext*, s8, s16);
@ -1478,7 +1514,7 @@ void* Graph_Alloc(GraphicsContext* gfxCtx, size_t size);
void func_800C6AC4(Gfx** a0, GraphicsContext* gfxCtx, char* file, s32 line);
void func_800C6B54(Gfx** a0, GraphicsContext* gfxCtx, char* file, s32 line);
Gfx* func_800C6C20(Gfx* a0);
Gfx* func_800C6C28(Gfx* a0, Gfx* dlist); //branch dlist
Gfx* func_800C6C28(Gfx* a0, Gfx* dlist); // branch dlist
// ? func_800C6C3C(?);
ListAlloc* ListAlloc_Init(ListAlloc* this);
void* ListAlloc_Alloc(ListAlloc* this, u32 size);
@ -1498,7 +1534,7 @@ void Main(void*);
// ? func_800C7C14(?);
// ? func_800C7DD0(?);
void func_800C7E08(Input*, u32);
//void PadMgr_Init(PadMgr* padmgr, OSMesg mesg, UNK_TYPE arg2, OSId id, OSPri priority, void* stack);
// void PadMgr_Init(PadMgr* padmgr, OSMesg mesg, UNK_TYPE arg2, OSId id, OSPri priority, void* stack);
// ? func_800C82A0(?);
// ? func_800C84E4(?);
// ? func_800C8534(?);
@ -1648,7 +1684,7 @@ void IrqMgr_AddClient(IrqMgr* this, IrqMgrClient* c, OSMesgQueue* msgQ);
void IrqMgr_RemoveClient(IrqMgr* this, IrqMgrClient* c);
void IrqMgr_SendMesgForClient(IrqMgr* this, OSMesg msg);
void IrqMgr_JamMesgForClient(IrqMgr* this, OSMesg msg);
void IrqMgr_HandlePreNMI(IrqMgr *this);
void IrqMgr_HandlePreNMI(IrqMgr* this);
void IrqMgr_CheckStack();
void IrqMgr_HandlePRENMI450(IrqMgr* this);
void IrqMgr_HandlePRENMI480(IrqMgr* this);
@ -1730,7 +1766,7 @@ void FaultDrawer_VPrintf(const char*, char*);
void FaultDrawer_Printf(const char*, ...);
void FaultDrawer_DrawText(s32, s32, const char*, ...);
void FaultDrawer_SetDrawerFB(void*, u16, u16);
void FaultDrawer_SetInputCallback(void(*)());
void FaultDrawer_SetInputCallback(void (*)());
void FaultDrawer_SetDefault();
// ? func_800D7CD0(?);
// ? func_800D7D04(?);
@ -2149,14 +2185,14 @@ void GfxPrint_VPrintf(GfxPrint*, const char*, va_list);
void GfxPrint_Printf(GfxPrint*, const char*, ...);
void func_800FBCE0();
void func_800FBFD8();
void *Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd);
void* Overlay_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd);
// ? func_800FC258(?);
void Overlay_DoRelocation(void *allocatedVRamAddress, OverlayRelocationSection *overlayInfo, void *vRamAddress);
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void *vRamStart, void *vRamEnd, void *allocatedVRamAddress);
void Overlay_DoRelocation(void* allocatedVRamAddress, OverlayRelocationSection* overlayInfo, void* vRamAddress);
s32 Overlay_Load(u32 vRomStart, u32 vRomEnd, void* vRamStart, void* vRamEnd, void* allocatedVRamAddress);
// ? func_800FC800(?);
// ? func_800FC83C(?);
// ? func_800FCAB4(?);
void SystemHeap_Init(void *start, u32 size);
void SystemHeap_Init(void* start, u32 size);
// ? func_800FCC00(?);
// ? func_800FCC08(?);
// ? func_800FCC10(?);
@ -2164,19 +2200,19 @@ void SystemHeap_Init(void *start, u32 size);
// ? func_800FCC24(?);
// ? func_800FCC6C(?);
// ? func_800FCD40(?);
// ? func_800FCE80(?);
// ? func_800FCF34(?);
// ? func_800FCF54(?);
// ? func_800FCFA0(?);
// ? func_800FD0C4(?);
// ? func_800FD210(?);
f32 func_800FD250(f32 f12, f32 f14);
// ? func_800FD338(?);
// ? func_800FD390(?);
// ? func_800FD3C8(?);
// ? func_800FD400(?);
// ? func_800FD438(?);
// ? func_800FD470(?);
f32 Math_tanf(f32 x);
f32 Math_nearbyintf(f32 x);
f32 Math_atanf_taylor_q(f32 x);
f32 Math_atanf_taylor(f32 x);
f32 Math_atanf_cfrac(f32 x);
f32 Math_atanf(f32 x);
f32 Math_atan2f(f32 y, f32 x);
f32 Math_asinf(f32 x);
f32 Math_acosf(f32 x);
f32 ceilf(f32 x);
f32 truncf(f32 x);
f32 roundf(f32 x);
f32 nearbyintf(f32 x);
void SystemArena_CheckPointer(void* ptr, u32 size, const char* name, const char* action);
void* SystemArena_Malloc(u32 size);
void* SystemArena_MallocDebug(u32 size, const char* file, s32 line);
@ -2219,10 +2255,10 @@ u8 __osMallocIsInitalized(Arena* arena);
void __osMalloc_FreeBlockTest(Arena* arena, ArenaNode* node);
void* __osMalloc_NoLockDebug(Arena* arena, u32 size, const char* file, s32 line);
void* __osMallocDebug(Arena* arena, u32 size, const char* file, s32 line);
void* __osMallocRDebug(Arena *arena, u32 size, const char *file, s32 line);
void* __osMalloc_NoLock(Arena *arena, u32 size);
void* __osMallocRDebug(Arena* arena, u32 size, const char* file, s32 line);
void* __osMalloc_NoLock(Arena* arena, u32 size);
void* __osMalloc(Arena* arena, u32 size);
void* __osMallocR(Arena *arena, u32 size);
void* __osMallocR(Arena* arena, u32 size);
void __osFree_NoLock(Arena* arena, void* ptr);
void __osFree(Arena* arena, void* ptr);
void __osFree_NoLockDebug(Arena* arena, void* ptr, const char* file, s32 line);
@ -2295,11 +2331,12 @@ s16 sins(u16);
// ? func_80103210(?);
// ? func_8010328C(?);
// ? func_801032B0(?);
void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, s32, s32);
void func_80103A70(UNK_PTR, Gfx*, Hilite*, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32, f32,
s32, s32);
// ? func_80103B30(?);
// ? func_80103B60(?);
// ? func_80103BB0(?);
// ? func_80103D58(?);
void func_80103D58(Mtx*, f32, f32, f32, f32, f32, f32, f32);
// ? func_80103DC0(?);
// ? func_80103E20(?);
// ? func_80103FA4(?);
@ -2353,7 +2390,7 @@ f32 absf(f32);
// ? func_801069B0(?);
u8 func_80106BC8(GlobalContext* globalCtx);
// ? func_80106C88(?);
// ? func_80106CCC(?);
void func_80106CCC(GlobalContext*);
// ? func_80106D40(?);
// ? func_80106F1C(?);
// ? func_80107244(?);
@ -2367,7 +2404,7 @@ u8 func_80106BC8(GlobalContext* globalCtx);
// ? func_80109968(?);
// ? func_80109B3C(?);
// ? func_8010B0C0(?);
// ? func_8010B680(?);
void func_8010B680(GlobalContext*, u16, s32);
void func_8010B720(GlobalContext* globalCtx, u16 textId);
// ? func_8010B820(?);
// ? func_8010BD58(?);

View file

@ -1,8 +1,7 @@
#ifndef _ICHAIN_H_
#define _ICHAIN_H_
typedef struct
{
typedef struct {
u32 cont: 1;
u32 type: 4;
u32 offset: 11;
@ -11,8 +10,7 @@ typedef struct
#define OFFSETOF(structure, member) ((size_t)&(((structure*)0)->member))
typedef enum
{
typedef enum {
/* 0x0 */ ICHAINTYPE_U8, // sets byte
/* 0x1 */ ICHAINTYPE_S8,
/* 0x2 */ ICHAINTYPE_U16, // sets short

View file

@ -13,6 +13,7 @@
#define SQ(x) ((x)*(x))
#define ABS(x) ((x) >= 0 ? (x) : -(x))
#define DECR(x) ((x) == 0 ? 0 : ((x) -= 1))
#define CLAMP(x,min,max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
#define PLAYER ((Player*)globalCtx->actorCtx.actorList[ACTORTYPE_PLAYER].first)
@ -34,4 +35,8 @@
#define CAPACITY(upg, value) gUpgradeCapacities[upg][value]
#define CUR_CAPACITY(upg) CAPACITY(upg, CUR_UPG_VALUE(upg))
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
(curState)->init = newInit; \
(curState)->size = sizeof(newStruct);
#endif

View file

@ -2,6 +2,7 @@
#define _MATH_H_
#define M_PI 3.14159265358979323846f
#define M_SQRT2 1.41421356237309504880f
#define FLT_MAX 340282346638528859811704183484516925440.0f
float sinf(float);

View file

@ -6,8 +6,7 @@
#include <ultra64/controller.h>
typedef struct
{
typedef struct {
/* 0x0000 */ OSContStatus pad_status[4];
/* 0x0010 */ OSMesg msgbuf1[1];
/* 0x0014 */ OSMesg msgbuf2[1];
@ -24,10 +23,10 @@ typedef struct
/* 0x02A8 */ u8 unk_2A8;
/* 0x02A9 */ u8 unk_2A9;
/* 0x02AA */ u8 unk_2AA[4];
/* 0x02AA */ u8 unk_2AE[4]; //Looks like 1 if vibration pack, 2 if (maybe controller pack)?
/* 0x02AA */ u8 unk_2AE[4]; // Looks like 1 if vibration pack, 2 if (maybe controller pack)?
/* 0x02B2 */ u8 unk_2B2[4];
/* 0x02B6 */ u8 unk_2B6[4];
/* 0x02BA */ char unk_2BA[0x02]; //probably padding
/* 0x02BA */ char unk_2BA[0x02]; // probably padding
/* 0x02BC */ unk_controller_t unk_controller[4];
/* 0x045C */ u8 unk_45C;
/* 0x045D */ u8 unk_45D;
@ -37,5 +36,5 @@ typedef struct
/* 0x0464 */ s32 unk_464;
} PadMgr; // size = 0x468
#endif //_PADMGR_H_
#endif

View file

@ -1,7 +1,7 @@
#ifndef _REGS_H_
#define _REGS_H_
#define REG_GROUPS 29 //number of REG groups, i.e. REG, SREG, OREG, etc.
#define REG_GROUPS 29 // number of REG groups, i.e. REG, SREG, OREG, etc.
#define REG_PAGES 6
#define REG_PER_PAGE 16
#define REG_PER_GROUP REG_PAGES * REG_PER_PAGE

View file

@ -13,8 +13,7 @@
#define OS_SC_RCP_MASK 0x0003
#define OS_SC_TYPE_MASK 0x0007
typedef struct OSScTask
{
typedef struct OSScTask {
/* 0x00 */ struct OSScTask* next;
/* 0x04 */ u32 state;
/* 0x08 */ u32 flags;
@ -24,14 +23,12 @@ typedef struct OSScTask
/* 0x54 */ OSMesg msg;
} OSScTask;
typedef struct
{
typedef struct {
/* 0x00 */ char unk_00[0x12];
/* 0x12 */ s8 unk_12;
} struct_800C8BC4;
typedef struct
{
typedef struct {
/* 0x0000 */ OSMesgQueue interruptQ;
/* 0x0018 */ OSMesg intBuf[8];
/* 0x0038 */ OSMesgQueue cmdQ;

View file

@ -3,20 +3,20 @@
#include <z64.h>
#define DECLARE_SEGMENT(name) \
#define DECLARE_SEGMENT(name) \
extern u8 _##name##SegmentStart[]; \
extern u8 _##name##SegmentEnd[];
#define DECLARE_ROM_SEGMENT(name) \
#define DECLARE_ROM_SEGMENT(name) \
extern u8 _##name##SegmentRomStart[]; \
extern u8 _##name##SegmentRomEnd[];
#define DECLARE_BSS_SEGMENT(name) \
#define DECLARE_BSS_SEGMENT(name) \
extern u8 _##name##SegmentBssStart[]; \
extern u8 _##name##SegmentBssEnd[];
#define DECLARE_OVERLAY_SEGMENT(name) \
DECLARE_SEGMENT(ovl_##name) \
DECLARE_SEGMENT(ovl_##name) \
DECLARE_ROM_SEGMENT(ovl_##name)
DECLARE_SEGMENT(boot)
@ -1091,5 +1091,4 @@ DECLARE_ROM_SEGMENT(testroom_room_2)
DECLARE_ROM_SEGMENT(testroom_room_3)
DECLARE_ROM_SEGMENT(testroom_room_4)
#endif

View file

@ -1,13 +1,13 @@
#ifndef _STDBOOL
#define _STDBOOL
#define __bool_true_false_are_defined 1
#define __bool_true_false_are_defined 1
#ifndef __cplusplus
#define bool u32
#define false 0
#define true 1
#define bool u32
#define false 0
#define true 1
#endif /* __cplusplus */

View file

@ -1,7 +1,7 @@
#ifndef _STDDEF_H_
#define _STDDEF_H_
#define NULL ((void *)0)
#define NULL ((void*)0)
typedef unsigned long size_t;

View file

@ -1,14 +1,12 @@
#ifndef _STDLIB_H_
#define _STDLIB_H_
typedef struct lldiv_t
{
typedef struct lldiv_t {
long long quot;
long long rem;
} lldiv_t;
typedef struct ldiv_t
{
typedef struct ldiv_t {
long quot;
long rem;
} ldiv_t;

View file

@ -1,8 +1,10 @@
#ifndef _STRING_H_
#define _STRING_H_
#include <ultra64/types.h>
void* memcpy(void*, const void*, size_t);
size_t strlen(const u8 *str);
const u8 *strchr(const u8 *str, s32 ch);
size_t strlen(const u8* str);
const u8* strchr(const u8* str, s32 ch);
#endif

View file

@ -24,15 +24,13 @@ typedef double f64;
typedef long int Mtx_t[4][4];
typedef union
{
typedef union {
Mtx_t m;
long long int forc_structure_alignment;
} Mtx;
typedef float MtxF_t[4][4];
typedef union
{
typedef union {
MtxF_t mf;
struct
{

View file

@ -565,10 +565,6 @@ extern Scene gSceneTable[110];
extern u8 gLetterTLUT[4][32]; // original name: "moji_tlut"
extern u8 gFontFF[]; // original name: "font_ff"
//extern ? D_8012ABF0;
//extern ? D_8012AC00;
//extern ? D_8012AC28;
//extern ? D_8012AC40;
//extern ? D_8012AC58;
//extern ? D_8012AC90;
//extern ? D_8012ACA0;
//extern ? D_8012AD20;
@ -3145,7 +3141,6 @@ extern char D_80146238[];
//extern ? D_8014AA38;
//extern ? D_8014AA5C;
//extern ? D_8014AA80;
//extern ? D_8014AAC0;
//extern ? D_8014B210;
//extern ? D_8014B280;
//extern ? D_8014B2E0;
@ -3473,7 +3468,7 @@ extern GlobalContext* D_80157DA0;
extern SaveContext gSaveContext; // 0x8015E660
extern u32 D_8015FA88;
extern u32 D_8015FA8C;
extern GameInfo* gGameInfo;
extern GameInfo* gGameInfo; // 0x8015FA90
//extern ? D_8015FA98;
//extern ? D_8015FA9B;
//extern ? D_8015FC18;
@ -3852,7 +3847,6 @@ extern u32 D_8016B5F5;
//extern ? D_80174DBC;
//extern ? D_80174DC0;
//extern ? D_801755D0;
//extern ? D_80175600;
extern u32 __osMalloc_FreeBlockTest_Enable;
//extern ? D_80175640;
//extern ? D_80175660;

View file

@ -21,11 +21,11 @@
#define VT_ESC "\x1b"
#define VT_CSI "["
#define VT_CUP(x, y) VT_ESC VT_CSI #y ";" #x "H"
#define VT_CUP(x, y) VT_ESC VT_CSI y ";" x "H"
#define VT_ED(n) VT_ESC VT_CSI #n "J"
#define VT_SGR(n) VT_ESC VT_CSI n "m"
//Add more macros if necessary
// Add more macros if necessary
#define VT_COL(back, fore) VT_SGR(VT_COLOR(BACKGROUND, back) ";" VT_COLOR(FOREGROUND, fore))
#define VT_FGCOL(color) VT_SGR(VT_COLOR(FOREGROUND, color))
#define VT_BGCOL(color) VT_SGR(VT_COLOR(BACKGROUND, color))

View file

@ -33,25 +33,22 @@
// Game Info aka. Static Context (dbg ram start: 80210A10)
// Data normally accessed through REG macros (see regs.h)
typedef struct
{
/* 0x00 */ s32 regPage; //1 is first page
/* 0x04 */ s32 regGroup; //"register" group (R, RS, RO, RP etc.)
/* 0x08 */ s32 regCur; //selected register within page
typedef struct {
/* 0x00 */ s32 regPage; // 1 is first page
/* 0x04 */ s32 regGroup; // "register" group (R, RS, RO, RP etc.)
/* 0x08 */ s32 regCur; // selected register within page
/* 0x0C */ s32 dpadLast;
/* 0x10 */ s32 repeat;
/* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; //0xAE0
/* 0x14 */ s16 data[REG_GROUPS * REG_PER_GROUP]; // 0xAE0 bytes
} GameInfo; // size = 0x15D4
typedef struct
{
typedef struct {
/* 0x00 */ u8 button_items[4];
/* 0x04 */ u8 c_button_slots[3];
/* 0x08 */ u16 equipment;
} ItemEquips; // size = 0x0A
typedef struct
{
typedef struct {
/* 0x00 */ u32 chest;
/* 0x04 */ u32 swch;
/* 0x08 */ u32 clear;
@ -61,15 +58,13 @@ typedef struct
/* 0x18 */ u32 rooms_2;
} SaveSceneFlags; // size = 0x1C
typedef struct
{
typedef struct {
/* 0x00 */ s16 scene;
/* 0x02 */ Vec3s pos;
/* 0x08 */ s16 angle;
} HorseData; // size = 0x0A
typedef struct
{
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ s16 yaw;
/* 0x0E */ s16 player_params;
@ -80,22 +75,19 @@ typedef struct
/* 0x18 */ u32 temp_collect_flags;
} RespawnData; // size = 0x1C
typedef enum
{
typedef enum {
/* 0x00 */ RESPAWN_MODE_DOWN, /* Normal Void Outs */
/* 0x01 */ RESPAWN_MODE_RETURN, /* Grotto Returnpoints */
/* 0x02 */ RESPAWN_MODE_TOP /* Farore's Wind */
} RespawnMode;
typedef enum
{
typedef enum {
/* 0x00 */ BTN_ENABLED,
/* 0xFF */ BTN_DISABLED = 0xFF
} ButtonStatus;
// Save Context (dbg ram start: 8015E660)
typedef struct
{
typedef struct {
/* 0x0000 */ s32 entrance_index;
/* 0x0004 */ s32 link_age; // 0: Adult; 1: Child
/* 0x0008 */ s32 cutscene_index;
@ -135,8 +127,7 @@ typedef struct
/* 0x00CF */ s8 defense_hearts;
/* 0x00D0 */ s16 gs_tokens;
/* 0x00D4 */ SaveSceneFlags scene_flags[124];
struct
{
struct {
/* 0x0E64 */ s32 pos_x;
/* 0x0E68 */ s32 pos_y;
/* 0x0E6C */ s32 pos_z;
@ -165,7 +156,9 @@ typedef struct
/* 0x1360 */ s32 scene_setup_index;
/* 0x1364 */ s32 respawn_flag; // "restart_flag"
/* 0x1368 */ RespawnData respawn[3]; // "restart_data"
/* 0x13BC */ char unk_13BC[0x000B];
/* 0x13BC */ char unk_13BC[0x0008];
/* 0x13C4 */ s16 dogParams;
/* 0x13C6 */ char unk_13C6[0x0001];
/* 0x13C7 */ u8 unk_13C7;
/* 0x13C8 */ u16 nayrus_love_timer;
/* 0x13CA */ char unk_13CA[0x0002];
@ -209,7 +202,7 @@ typedef struct
/* 0x1418 */ u8 fade_duration;
/* 0x1419 */ u8 unk_1419; // transition related
/* 0x141A */ u16 environment_time;
/* 0x141C */ u8 unk_141C;
/* 0x141C */ u8 dogIsLost;
/* 0x141D */ u8 transition_type;
/* 0x141E */ char unk_141E[0x0002];
/* 0x1420 */ s16 world_map_area;
@ -217,8 +210,7 @@ typedef struct
/* 0x1424 */ s16 health_accumulator;
} SaveContext; // size = 0x1428
typedef struct
{
typedef struct {
/* 0x00000 */ u16 headMagic; // 1234
/* 0x00008 */ Gfx polyOpaBuffer[0x17E0];
/* 0x0BF08 */ Gfx polyXluBuffer[0x800];
@ -228,24 +220,21 @@ typedef struct
/* 0x12408 */ u16 tailMagic; // 5678
} GfxPool; // size = 0x12410
typedef struct
{
typedef struct {
/* 0x0000 */ u32 size;
/* 0x0004 */ u8* bufp;
/* 0x0008 */ u8* head;
/* 0x000C */ u8* tail;
} TwoHeadArena; // size = 0x10
typedef struct
{
typedef struct {
/* 0x0000 */ u32 size;
/* 0x0004 */ Gfx* bufp;
/* 0x0008 */ Gfx* p;
/* 0x000C */ Gfx* d;
} TwoHeadGfxArena; // size = 0x10
typedef struct
{
typedef struct {
/* 0x0000 */ char unk_00[0x01B4];
/* 0x01B4 */ TwoHeadGfxArena work;
/* 0x01C4 */ char unk_1C4[0x00E4];
@ -254,12 +243,9 @@ typedef struct
/* 0x02C8 */ TwoHeadGfxArena polyXlu;
} GraphicsContext;
typedef struct
{
/* 0x00 */ union
{
struct
{
typedef struct {
/* 0x00 */ union {
struct {
u16 a : 1;
u16 b : 1;
u16 z : 1;
@ -282,8 +268,7 @@ typedef struct
/* 0x03 */ s8 y;
} RawInput; // size = 0x4
typedef struct
{
typedef struct {
/* 0x00 */ RawInput raw;
/* 0x04 */ u16 status;
/* 0x06 */ RawInput rawPrev;
@ -298,22 +283,21 @@ typedef struct
/* 0x16 */ char unk_16[0x02];
} Input; // size = 0x18
typedef struct
{
typedef struct {
/* 0x0000 */ char unk_00[0x28];
/* 0x0028 */ Vec3f eye;
/* 0x0034 */ char unk_34[0xF4];
/* 0x0034 */ char unk_34[0xEC];
/* 0x0120 */ u32 unk_120;
/* 0x0124 */ char unk_124[4];
} View; // size = 0x128
typedef struct
{
typedef struct {
f32 unk_00;
s16 unk_04;
s16 unk_06;
} struct_80045714; // used in z_camera.c and code_8007BF90
typedef struct
{
typedef struct {
/* 0x0000 */ s32 unk_00;
/* 0x0004 */ s16 unk_04;
/* 0x0006 */ s16 unk_06;
@ -370,49 +354,42 @@ typedef struct
/* 0x016A */ s16 unk_16A; // unknown if used
} Camera; // size = 0x16C
typedef struct
{
typedef struct {
/* 0x0000 */ Camera activeCameras[4];
/* 0x05B0 */ Camera* activeCameraPtrs[4];
/* 0x05C0 */ s16 unk_5C0;
/* 0x05C2 */ s16 unk_5C2;
} CameraContext; // size = 0x5C4
typedef struct
{
typedef struct {
/* 0x00 */ u8 musicSeq;
/* 0x01 */ u8 nighttimeSFX;
/* 0x02 */ char unk_02[0x2];
} SoundContext; // size = 0x4
typedef struct
{
typedef struct {
/* 0x00 */ char unk_00[0x50];
} StaticCollisionContext; // size = 0x50
typedef struct
{
typedef struct {
/* 0x0000 */ char unk_00[0x04];
/* 0x0004 */ ActorMesh actorMeshArr[50];
/* 0x138C */ u16 flags[50];
/* 0x13F0 */ char unk_13F0[0x24];
} DynaCollisionContext; // size = 0x1414
typedef struct
{
typedef struct {
/* 0x0000 */ StaticCollisionContext stat;
/* 0x0050 */ DynaCollisionContext dyna;
} CollisionContext; // size = 0x1464
typedef struct
{
typedef struct {
/* 0x00 */ Vec3f pos;
/* 0x0C */ f32 unk_0C; // radius?
/* 0x10 */ Color_RGB8 color;
} TargetContextEntry; // size = 0x14
typedef struct
{
typedef struct {
/* 0x00 */ Vec3f naviRefPos; // possibly wrong
/* 0x0C */ Vec3f targetCenterPos;
/* 0x18 */ Color_RGBAf naviInner;
@ -432,8 +409,7 @@ typedef struct
/* 0x94 */ Actor* unk_94;
} TargetContext; // size = 0x98
typedef struct
{
typedef struct {
/* 0x00 */ u32 texture;
/* 0x04 */ s16 unk_4;
/* 0x06 */ s16 unk_6;
@ -445,14 +421,12 @@ typedef struct
/* 0x0E */ s16 unk_E;
} TitleCardContext; // size = 0x10
typedef struct
{
typedef struct {
/* 0x00 */ u32 length; // number of actors loaded of this type
/* 0x04 */ Actor* first; // pointer to first actor of this type
} ActorListEntry; // size = 0x08
typedef struct
{
typedef struct {
/* 0x0000 */ u8 unk_00;
/* 0x0001 */ char unk_01[0x01];
/* 0x0002 */ u8 unk_02;
@ -462,8 +436,7 @@ typedef struct
/* 0x0009 */ char unk_09[0x03];
/* 0x000C */ ActorListEntry actorList[12];
/* 0x006C */ TargetContext targetCtx;
struct
{
struct {
/* 0x0104 */ u32 swch;
/* 0x0108 */ u32 tempSwch;
/* 0x010C */ u32 unk0;
@ -479,19 +452,16 @@ typedef struct
/* 0x013C */ void* absoluteSpace; // Space used to allocate actor overlays of alloc type 1
} ActorContext; // size = 0x140
typedef struct
{
typedef struct {
/* 0x00 */ char unk_00[0x4];
/* 0x04 */ void* segment;
/* 0x08 */ u8 state;
/* 0x0C */ f32 unk_0C;
/* 0x10 */ u16 frames;
/* 0x12 */ u16 unk_12;
union
{
union {
/* 0x14 */ s32 unk_14_all;
struct
{
struct {
s16 unk_14;
s16 unk_16;
};
@ -505,8 +475,7 @@ typedef struct
/* 0x28 */ CsCmdActorAction* actorActions[10];
} CutsceneContext; // size = 0x50
typedef struct
{
typedef struct {
/* 0x0000 */ View view;
/* 0x0128 */ char unk_128[0xE188];
/* 0xE2B0 */ void* textboxSegment; // "fukidashiSegment"
@ -532,8 +501,18 @@ typedef struct
/* 0xE40E */ char unk_E40E[0x0A];
} MessageContext; // size = 0xE418
typedef struct
{
typedef struct {
/* 0x00 */ u32 vromAddr; // VROM address (source)
/* 0x04 */ void* dramAddr; // DRAM address (destination)
/* 0x08 */ u32 size; // File Transfer size
/* 0x0C */ char* filename; // Filename for debugging
/* 0x10 */ s32 line; // Line for debugging
/* 0x14 */ s32 unk_14;
/* 0x18 */ OSMesgQueue* notifyQueue; // Message queue for the notification message
/* 0x1C */ OSMesg notifyMsg; // Completion notification message
} DmaRequest; // size = 0x20
typedef struct {
/* 0x0000 */ View view;
/* 0x0128 */ Vtx* vtx_128;
/* 0x012C */ Vtx* vtx_12C;
@ -588,8 +567,7 @@ typedef struct
/* 0x025E */ char unk_25E[0x002];
/* 0x0260 */ u8 unk_260;
/* 0x0261 */ u8 unk_261;
struct
{
struct {
/* 0x0262 */ u8 hGauge; // "h_gage"; unknown?
/* 0x0263 */ u8 bButton; // "b_button"
/* 0x0264 */ u8 aButton; // "a_button"
@ -605,8 +583,7 @@ typedef struct
} restrictions;
} InterfaceContext; // size = 0x270
typedef struct
{
typedef struct {
/* 0x0000 */ View view;
/* 0x0128 */ void* unk_128;
/* 0x012C */ char unk_12C[0x03C];
@ -631,8 +608,7 @@ typedef struct
/* 0x025A */ char unk_25A[0x066];
} PauseContext; // size = 0x2C0
typedef struct
{
typedef struct {
/* 0x00 */ s16 id;
/* 0x04 */ void* segment;
/* 0x08 */ DmaRequest dmaRequest;
@ -640,8 +616,7 @@ typedef struct
/* 0x40 */ OSMesg loadMsg;
} ObjectStatus; // size = 0x44
typedef struct
{
typedef struct {
/* 0x0000 */ void* spaceStart;
/* 0x0004 */ void* spaceEnd; // original name: "endSegment"
/* 0x0008 */ u8 num; // number of objects in bank
@ -651,30 +626,26 @@ typedef struct
/* 0x000C */ ObjectStatus status[OBJECT_EXCHANGE_BANK_MAX];
} ObjectContext; // size = 0x514
typedef struct
{
typedef struct {
/* 0x00 */ Gfx* opa;
/* 0x04 */ Gfx* xlu;
} PolygonDlist; // size = 0x8
typedef struct
{
typedef struct {
/* 0x00 */ u8 type;
/* 0x01 */ u8 num; // number of dlist entries
/* 0x04 */ void* start;
/* 0x08 */ void* end;
} Polygon; // size = 0xC
typedef struct
{
typedef struct {
/* 0x00 */ u8 type;
/* 0x01 */ u8 num; // number of dlist entries
/* 0x04 */ void* start;
/* 0x08 */ void* end;
} PolygonType0; // size = 0xC
typedef struct
{
typedef struct {
/* 0x00 */ u16 unk_00;
/* 0x02 */ u8 id;
/* 0x04 */ u32 source;
@ -688,15 +659,12 @@ typedef struct
/* 0x18 */ u16 tlutCount;
} BgImage; // size = 0x1C
typedef struct
{
typedef struct {
/* 0x00 */ u8 type;
/* 0x01 */ u8 format; // 1 = single, 2 = multi
/* 0x04 */ void* dlist;
union
{
struct
{
union {
struct {
/* 0x08 */ u32 source;
/* 0x0C */ u32 unk_0C;
/* 0x10 */ u32 tlut;
@ -707,40 +675,35 @@ typedef struct
/* 0x1A */ u16 mode0;
/* 0x1C */ u16 tlutCount;
} single;
struct
{
struct {
/* 0x08 */ u8 count;
/* 0x0C */ BgImage* list;
} multi;
};
} PolygonType1;
typedef struct
{
typedef struct {
/* 0x00 */ Vec3s pos;
/* 0x06 */ s16 unk_06;
/* 0x08 */ Gfx* opa;
/* 0x0C */ Gfx* xlu;
} PolygonDlist2; // size = 0x8
typedef struct
{
typedef struct {
/* 0x00 */ u8 type;
/* 0x01 */ u8 num; // number of dlist entries
/* 0x04 */ void* start;
/* 0x08 */ void* end;
} PolygonType2; // size = 0xC
typedef union
{
typedef union {
Polygon polygon;
PolygonType0 polygon0;
PolygonType1 polygon1;
PolygonType2 polygon2;
} Mesh; // "Ground Shape"
typedef struct
{
typedef struct {
/* 0x00 */ s8 num;
/* 0x01 */ u8 unk_01;
/* 0x02 */ u8 unk_02;
@ -752,8 +715,7 @@ typedef struct
/* 0x10 */ char unk_10[0x4];
} Room; // size = 0x14
typedef struct
{
typedef struct {
/* 0x00 */ Room curRoom;
/* 0x14 */ Room prevRoom;
/* 0x28 */ void* bufPtrs[2];
@ -765,21 +727,18 @@ typedef struct
/* 0x70 */ OSMesg loadMsg;
} RoomContext; // size = 0x74
typedef struct
{
typedef struct {
/* 0x00 */ char unk_00[0x028C];
} SubGlobalContext11E60; // size = 0x28C
typedef struct
{
typedef struct {
/* 0x00 */ s16 id;
/* 0x02 */ Vec3s pos;
/* 0x08 */ Vec3s rot;
/* 0x0E */ s16 params;
} ActorEntry; // size = 0x10
typedef struct
{
typedef struct {
/* 0x00 */ s8 frontRoom; // Room to switch to when triggered from the front of the object
/* 0x01 */ s8 frontEffects; // How the camera reacts during the front transition
/* 0x02 */ s8 backRoom; // Room to switch to when triggered from the back of the object
@ -790,39 +749,33 @@ typedef struct
/* 0x0E */ s16 params;
} TransitionActorEntry; // size = 0x10
typedef struct
{
typedef struct {
/* 0x00 */ u8 spawn;
/* 0x01 */ u8 room;
} EntranceEntry;
typedef struct
{
typedef struct {
/* 0x00 */ u32 vromStart;
/* 0x04 */ u32 vromEnd;
} RomFile; // size = 0x8
typedef struct
{
typedef struct {
/* 0x00 */ void* read_buff;
} Sram; // size = 0x4
typedef struct GameAllocEntry
{
typedef struct GameAllocEntry {
/* 0x00 */ struct GameAllocEntry* next;
/* 0x04 */ struct GameAllocEntry* prev;
/* 0x08 */ u32 size;
/* 0x0C */ u32 unk_0C;
} GameAllocEntry; //size = 0x10
} GameAllocEntry; // size = 0x10
typedef struct
{
typedef struct {
/* 0x00 */ GameAllocEntry base;
/* 0x10 */ GameAllocEntry* head;
} GameAlloc; // size = 0x14
typedef struct GameState
{
typedef struct GameState {
/* 0x00 */ GraphicsContext* gfxCtx;
/* 0x04 */ void (*main)(struct GameState*);
/* 0x08 */ void (*destroy)(struct GameState*); // "cleanup"
@ -836,8 +789,7 @@ typedef struct GameState
/* 0xA0 */ u32 unk_A0;
} GameState; // size = 0xA4
typedef struct
{
typedef struct {
/* 0x0000 */ GameState state;
/* 0x00A4 */ void* staticSegment;
/* 0x00A8 */ View view;
@ -853,9 +805,15 @@ typedef struct
/* 0x01E2 */ char unk_1E2[6];
} TitleContext; // size = 0x1E8
// Global Context (dbg ram start: 80212020)
typedef struct GlobalContext
typedef struct
{
/* 0x0000 */ GameState state;
/* 0x00A4 */ void* staticSegment;
/* 0x00A8 */ View view;
} SampleContext;
// Global Context (dbg ram start: 80212020)
typedef struct GlobalContext {
/* 0x00000 */ GameState state;
/* 0x000A4 */ s16 sceneNum;
/* 0x000A6 */ u8 sceneConfig;
@ -954,7 +912,7 @@ typedef struct GlobalContext
/* 0x11DFC */ UNK_PTR unk_11DFC;
/* 0x11E00 */ EntranceEntry* setupEntranceList;
/* 0x11E04 */ UNK_PTR setupExitList;
/* 0x11E08 */ UNK_PTR setupPathList;
/* 0x11E08 */ Path* setupPathList;
/* 0x11E0C */ UNK_PTR naviMsgSegment;
/* 0x11E10 */ char unk_11E10[0x4];
/* 0x11E14 */ u8 skyboxId;
@ -977,22 +935,19 @@ typedef struct GlobalContext
/* 0x12430 */ char unk_12430[0xE8];
} GlobalContext; // size = 0x12518
typedef struct
{
typedef struct {
/* 0x0000 */ GameState state;
/* 0x00A4 */ char unk_A4[4];
/* 0x00A8 */ View view;
} OpeningContext; // size = 0x1D0
typedef enum
{
typedef enum {
DPM_UNK = 0,
DPM_PLAYER = 1,
DPM_ENEMY = 2
} DynaPolyMoveFlag;
typedef struct LoadedParticleEntry
{
typedef struct LoadedParticleEntry {
/* 0x0000 */ Vec3f position;
/* 0x000C */ Vec3f velocity;
/* 0x0018 */ Vec3f acceleration;
@ -1010,14 +965,47 @@ typedef struct LoadedParticleEntry
/* 0x005F */ u8 type;
} LoadedParticleEntry; // size = 0x60
typedef struct
{
// Some animation related structure
typedef struct {
/* 0x00 */ u32 animation;
/* 0x04 */ f32 playbackSpeed;
/* 0x08 */ f32 unk_08;
/* 0x0C */ f32 frameCount;
/* 0x10 */ u8 unk_10;
/* 0x14 */ f32 transitionRate;
} struct_80034EC0_Entry; // size = 0x18
typedef struct {
/* 0x00 */ u8 limbCount;
/* 0x01 */ char unk_01[0x01];
/* 0x02 */ u8 dListCount;
/* 0x03 */ char unk_03[0x01]; /* Probably Padding */
/* 0x04 */ u32 limbIndex;
/* 0x08 */ u32* animCurrent;
/* 0x0C */ char unk_0C[0x04];
/* 0x10 */ f32 animFrameCount;
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 animCurrentFrame;
/* 0x1C */ f32 animPlaybackSpeed;
/* 0x20 */ u32 actorDrawTbl;
/* 0x24 */ u32 unk_24;
/* 0x28 */ u32 unk_28;
/* 0x2C */ u32 unk_2C;
/* 0x30 */ void* funcUnk30; /* Some function pointer */
/* 0x34 */ s32 unk_34;
/* 0x38 */ s32 unk_38;
/* 0x3C */ u16 unk_3C;
/* 0x3E */ u16 unk_3E;
/* 0x40 */ u16 unk_40;
/* 0x42 */ u16 unk_42;
} SkelAnime; // size = 0x44
typedef struct {
/* 0x00 */ u32 unk_00;
/* 0x04 */ u32(*init)(GlobalContext*, u32, LoadedParticleEntry*, void*);
} ParticleOverlayInfo;
typedef struct
{
typedef struct {
/* 0x00 */ u32 vromStart;
/* 0x04 */ u32 vromEnd;
/* 0x0C */ void* vramStart;
@ -1027,15 +1015,13 @@ typedef struct
/* 0x18 */ u32 unk_18; // Always 0x01000000?
} ParticleOverlay;
typedef struct
{
typedef struct {
/* 0x00 */ LoadedParticleEntry* data_table; // Name from debug assert
/* 0x04 */ s32 searchIndex;
/* 0x08 */ s32 size;
} EffectTableInfo;
typedef struct
{
typedef struct {
/* 0x00 */ s8 scene;
/* 0x01 */ s8 spawn;
/* 0x02 */ u16 continueBgm : 1;
@ -1044,8 +1030,7 @@ typedef struct
/* 0x02 */ u16 fadeOutTransition : 7;
} EntranceInfo; // size = 0x4
typedef struct
{
typedef struct {
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ u32 vromStart; // if applicable
/* 0x08 */ u32 vromEnd; // if applicable
@ -1060,21 +1045,18 @@ typedef struct
/* 0x2C */ u32 instanceSize;
} GameStateOverlay; // size = 0x30
typedef struct PreNMIContext
{
typedef struct PreNMIContext {
/* 0x00 */ GameState state;
/* 0xA4 */ u32 timer;
/* 0xA8 */ UNK_TYPE unk_A8;
} PreNMIContext; // size = 0xAC
typedef struct
{
typedef struct {
/* 0x00 */ s8 chestFlag; // chest icon is only displayed if this flag is not set for the current room
/* 0x01 */ u8 x, y; // coordinates to place the icon (top-left corner), relative to the minimap texture
} MapMarkPoint; // size = 0x3
typedef struct
{
typedef struct {
/* 0x00 */ s8 markType; // 0 for the chest icon, 1 for the boss skull icon, -1 for none
/* 0x01 */ u8 count; // number of icons to display
/* 0x02 */ MapMarkPoint points[12];
@ -1082,8 +1064,7 @@ typedef struct
typedef MapMarkData MapMarksData[3]; // size = 0x72
typedef struct DebugDispObject
{
typedef struct DebugDispObject {
/* 0x00 */ Vec3f pos;
/* 0x0C */ Vec3s rot;
/* 0x14 */ Vec3f scale;
@ -1092,8 +1073,7 @@ typedef struct DebugDispObject
/* 0x28 */ struct DebugDispObject* next;
} DebugDispObject; // size = 0x2C
typedef struct
{
typedef struct {
/* 0x00 */ Vec3s colAbsMin;
/* 0x06 */ Vec3s colAbsMax;
/* 0x0C */ s16 nbVertices;
@ -1106,30 +1086,26 @@ typedef struct
/* 0x28 */ void* waterBoxes;
} CollisionHeader;
typedef enum
{
typedef enum {
MTXMODE_NEW, // generates a new matrix
MTXMODE_APPLY // applies transformation to the current matrix
} MatrixMode;
typedef struct FaultClient
{
typedef struct FaultClient {
struct FaultClient* next;
u32 callback;
u32 param1;
u32 param2;
} FaultClient;
typedef struct FaultAddrConvClient
{
typedef struct FaultAddrConvClient {
struct FaultAddrConvClient* next;
u32 callback;
u32 param;
} FaultAddrConvClient;
typedef struct
{
typedef struct {
u32 (*callback)(u32, u32);
u32 param0;
u32 param1;
@ -1138,8 +1114,7 @@ typedef struct
OSMesg msg;
} FaultClientContext;
typedef struct FaultThreadStruct
{
typedef struct FaultThreadStruct {
OSThread thread;
u8 unk_1B0[0x600];
OSMesgQueue queue;
@ -1160,8 +1135,7 @@ typedef struct FaultThreadStruct
u8 unk_84C[4];
} FaultThreadStruct;
typedef struct
{
typedef struct {
u16* fb;
u16 w;
u16 h;
@ -1179,13 +1153,12 @@ typedef struct
s8 charWPad;
s8 charHPad;
u16 printColors[10];
u8 escCode; //bool
u8 escCode; // bool
u8 osSyncPrintfEnabled;
void(*inputCallback)();
} FaultDrawer;
typedef struct GfxPrint
{
typedef struct GfxPrint {
/* 0x00 */ struct GfxPrint*(*callback)(struct GfxPrint*, const char*, size_t);
/* 0x04 */ Gfx* dlist;
/* 0x08 */ u16 posX;
@ -1196,8 +1169,7 @@ typedef struct GfxPrint
/* 0x10 */ Color_RGBA8 color;
} GfxPrint;
typedef enum
{
typedef enum {
GFXPRINT_FLAG1 = 1,
GFXPRINT_USE_RGBA16 = 2,
GFXPRINT_FLAG4 = 4,
@ -1206,8 +1178,7 @@ typedef enum
GFXPRINT_OPEN = 0x80
} GfxPrintFlag;
typedef struct StackEntry
{
typedef struct StackEntry {
/* 0x00 */ struct StackEntry* next;
/* 0x04 */ struct StackEntry* prev;
/* 0x08 */ u32 head;
@ -1217,16 +1188,14 @@ typedef struct StackEntry
/* 0x18 */ const char* name;
} StackEntry;
typedef enum
{
typedef enum {
STACK_STATUS_OK = 0,
STACK_STATUS_WARNING = 1,
STACK_STATUS_OVERFLOW = 2
} StackStatus;
typedef struct
{
/* 0x00 */ u32 magic; //IS64
typedef struct {
/* 0x00 */ u32 magic; // IS64
/* 0x04 */ u32 get;
/* 0x08 */ u8 unk_08[0x14-0x08];
/* 0x14 */ u32 put;
@ -1234,14 +1203,18 @@ typedef struct
/* 0x20 */ u8 data[0x10000-0x20];
} ISVDbg;
typedef struct
{
typedef struct {
/* 0x00 */ u32 vromStart;
/* 0x04 */ u32 vromEnd;
/* 0x08 */ u32 romStart;
/* 0x0C */ u32 romEnd;
} DmaEntry;
typedef struct {
char name[0x18];
u32 mediaFormat;
union
{
struct
{
union {
struct {
u16 cartId;
u8 countryCode;
u8 version;
@ -1250,18 +1223,17 @@ typedef struct
};
} LocaleCartInfo;
typedef struct
{
char magic[4]; //Yaz0
typedef struct {
char magic[4]; // Yaz0
u32 decSize;
u32 compInfoOffset; //only used in yaz0_old.c
u32 uncompDataOffset; //only used in yaz0_old.c
u32 compInfoOffset; // only used in yaz0_old.c
u32 uncompDataOffset; // only used in yaz0_old.c
u32 data[1];
} Yaz0Header;
#define OS_SC_RETRACE_MSG 1
#define OS_SC_DONE_MSG 2
#define OS_SC_NMI_MSG 3 //name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c
#define OS_SC_NMI_MSG 3 // name is made up, 3 is OS_SC_RDP_DONE_MSG in the original sched.c
#define OS_SC_PRE_NMI_MSG 4
typedef struct {
@ -1269,16 +1241,14 @@ typedef struct {
char misc[30];
} OSScMsg;
typedef struct IrqMgrClient
{
typedef struct IrqMgrClient {
struct IrqMgrClient* prev;
OSMesgQueue* queue;
} IrqMgrClient;
typedef struct
{
/* 0x000 */ OSScMsg retraceMsg; //this apparently got moved from OSSched
/* 0x020 */ OSScMsg prenmiMsg; //this apparently got moved from OSSched
typedef struct {
/* 0x000 */ OSScMsg retraceMsg; // this apparently got moved from OSSched
/* 0x020 */ OSScMsg prenmiMsg; // this apparently got moved from OSSched
/* 0x040 */ OSScMsg nmiMsg;
/* 0x060 */ OSMesgQueue queue;
/* 0x078 */ OSMesg msgBuf[8];
@ -1288,22 +1258,20 @@ typedef struct
/* 0x250 */ OSTime resetTime;
/* 0x258 */ OSTimer timer;
/* 0x278 */ OSTime retraceTime;
} IrqMgr; //size = 0x280
} IrqMgr; // size = 0x280
struct ArenaNode;
typedef struct Arena
{
typedef struct Arena {
/* 0x00 */ struct ArenaNode* head;
/* 0x04 */ void* start;
/* 0x08 */ OSMesgQueue lock;
/* 0x20 */ u8 unk_20;
/* 0x21 */ u8 isInit;
/* 0x22 */ u8 flag;
} Arena; //size = 0x24
} Arena; // size = 0x24
typedef struct ArenaNode
{
typedef struct ArenaNode {
/* 0x00 */ s16 magic;
/* 0x02 */ s16 isFree;
/* 0x04 */ u32 size;
@ -1314,8 +1282,8 @@ typedef struct ArenaNode
/* 0x18 */ OSId threadId;
/* 0x1C */ Arena* arena;
/* 0x20 */ OSTime time;
/* 0x28 */ u8 unk_28[0x30-0x28]; //probably padding
} ArenaNode; //size = 0x30
/* 0x28 */ u8 unk_28[0x30-0x28]; // probably padding
} ArenaNode; // size = 0x30
typedef struct OverlayRelocationSection {
/* 0x00 */ u32 textSize;
@ -1326,33 +1294,30 @@ typedef struct OverlayRelocationSection {
/* 0x14 */ u32 relocations[1];
} OverlayRelocationSection; // size >= 0x18
typedef struct
{
typedef struct {
/* 0x00 */ void* loadedRamAddr;
/* 0x04 */ u32 vromStart;
/* 0x08 */ u32 vromEnd;
/* 0x0C */ u8* vramStart;
/* 0x10 */ u8* vramEnd;
/* 0x14 */ u32 off; //loadedRamAddr - vram
/* 0x14 */ u32 off; // loadedRamAddr - vram
/* 0x18 */ const char* name;
} KaleidoManagerOvl; //size = 0x1C
} KaleidoManagerOvl; // size = 0x1C
#define KALEIDO_OVL_KALEIDO_SCOPE 0
#define KALEIDO_OVL_PLAYER_ACTOR 1
#define KALEIDO_OVL_COUNT 2
typedef struct ListAlloc
{
typedef struct ListAlloc {
/* 0x00 */ struct ListAlloc* prev;
/* 0x04 */ struct ListAlloc* next;
} ListAlloc; //size = 0x8
} ListAlloc; // size = 0x8
typedef struct
{
typedef struct {
/* 0x00 */ u32 resetting;
/* 0x04 */ u32 resetCount;
/* 0x08 */ OSTime duration;
/* 0x10 */ OSTime resetTime;
} PreNmiBuff; //size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused)
} PreNmiBuff; // size = 0x18 (actually osAppNmiBuffer is 0x40 bytes large but the rest is unused)
#endif

View file

@ -13,34 +13,28 @@ struct GlobalContext;
// From z64light.h
struct LightMapper;
typedef struct
{
typedef struct {
f32 x, y;
} Vec2f;
typedef struct
{
typedef struct {
f32 x, y, z;
} Vec3f;
typedef struct
{
typedef struct {
s16 x, y, z;
} Vec3s;
typedef struct
{
typedef struct {
s32 x, y, z;
} Vec3i;
typedef struct
{
typedef struct {
Vec3f pos;
Vec3s rot;
} PosRot; // size = 0x14
typedef struct
{
typedef struct {
/* 0x00 */ char unk_00[0x8];
/* 0x08 */ Vec3s norm; // Normal vector
/* 0x0E */ s16 dist; // Plane distance from origin
@ -48,8 +42,7 @@ typedef struct
typedef void (*ActorFunc)(struct Actor*, struct GlobalContext*);
typedef struct
{
typedef struct {
/* 0x00 */ s16 id;
/* 0x02 */ u8 type; // Classifies actor and determines when actor will execute
/* 0x03 */ u8 room; // Room instance was spawned in. If value set to FF in rom, instance does not despawn when swapping rooms
@ -62,15 +55,13 @@ typedef struct
/* 0x1C */ ActorFunc draw; // Draw function
} ActorInit; // size = 0x20
typedef enum
{
typedef enum {
ALLOCTYPE_NORMAL,
ALLOCTYPE_ABSOLUTE,
ALLOCTYPE_PERMANENT
} AllocType;
typedef struct
{
typedef struct {
/* 0x00 */ u32 vromStart;
/* 0x04 */ u32 vromEnd;
/* 0x08 */ void* vramStart;
@ -82,25 +73,21 @@ typedef struct
/* 0x1E */ s8 nbLoaded; // original name: "clients"
} ActorOverlay; // size = 0x20
typedef struct
{
struct
{
typedef struct {
struct {
char damage : 4;
char effect : 4;
} attack[32];
} ActorDamageChart;
typedef struct
{
typedef struct {
/* 0x00 */ u8 health;
/* 0x02 */ s16 unk_02;
/* 0x04 */ s16 unk_04;
/* 0x06 */ u8 mass;
} SubActor98Init;
typedef struct
{
typedef struct {
/* 0x00 */ ActorDamageChart* damageChart; // For actors which contain a damage chart (example: Stalfos)...
/* 0x04 */ Vec3f displacement; // Amount to correct velocity (0x5C) by when colliding into a body
/* 0x10 */ s16 unk_10;
@ -114,8 +101,7 @@ typedef struct
/* 0x1B */ u8 unk_1B;
} SubActorStruct98; // size = 0x1C
typedef struct
{
typedef struct {
/* 0x00 */ Vec3s rot; // Current actor shape rotation
/* 0x06 */ u8 unk_06;
/* 0x08 */ f32 unk_08; // Model y axis offset. Represents model space units. collision mesh related
@ -125,8 +111,7 @@ typedef struct
/* 0x15 */ u8 unk_15;
} ActorShape; // size = 0x18
typedef struct Actor
{
typedef struct Actor {
/* 0x000 */ s16 id; // Actor Id
/* 0x002 */ u8 type; // Actor Type. Refer to the corresponding enum for values
/* 0x003 */ s8 room; // Room number the actor is part of. FF denotes that the actor won't despawn on a room change
@ -198,16 +183,14 @@ typedef struct Actor
/* From here on, the structure and size varies for each actor */
} Actor; // size = 0x14C
typedef enum
{
typedef enum {
COLTYPE_CYLINDER = 1,
COLTYPE_CYLINDER_GROUP = 0,
COLTYPE_QUAD = 3,
COLTYPE_TRIANGLE_GROUP = 2
} ColliderType;
typedef struct
{
typedef struct {
/* 0x00 */ Actor* actor;
/* 0x04 */ Actor* at;
/* 0x08 */ Actor* ac;
@ -220,15 +203,13 @@ typedef struct
/* 0x15 */ u8 type; /* Cylinder Collection, Cylinder, Triangle Collection, Quad */
} Collider; // size = 0x18
typedef struct
{
typedef struct {
/* 0x00 */ s32 flags; /* Toucher Attack Identifier Flags */
/* 0x04 */ u8 unk_04;
/* 0x05 */ u8 damage; /* Damage or Stun Timer */
} ColliderTouch; // size = 0x08
typedef struct
{
typedef struct {
/* 0x00 */ s32 flags; /* Collision Exclusion Mask */
/* 0x04 */ u8 effect; /* Damage Effect (Knockback, Fire, etc.) */
/* 0x05 */ u8 unk_05;
@ -237,8 +218,7 @@ typedef struct
/* 0x0A */ s16 unk_0A;
} ColliderBump; // size = 0x0C
typedef struct ColliderBody
{
typedef struct ColliderBody {
/* 0x00 */ ColliderTouch toucher;
/* 0x08 */ ColliderBump bumper;
/* 0x14 */ u8 flags;
@ -251,14 +231,12 @@ typedef struct ColliderBody
/* 0x24 */ struct ColliderBody* colliding;
} ColliderBody; // size = 0x28
typedef struct ColliderBodyEntry
{
typedef struct ColliderBodyEntry {
/* 0x00 */ ColliderBody c;
/* 0x28 */ char unk_28[0x18];
} ColliderBodyEntry; // size = 0x40
typedef struct
{
typedef struct {
/* 0x00 */ u8 bodyFlags;
/* 0x01 */ u8 unk_09[0x3]; /* 000000 */
/* 0x04 */ s32 toucherMask; /* Attack Toucher Exclusion Mask */
@ -273,8 +251,7 @@ typedef struct
/* 0x17 */ u8 unk_1F; /* 00 */
} ColliderBodyInfoInner; // size = 0x1A
typedef struct
{
typedef struct {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 colliderFlags; /* Collider Flags */
/* 0x02 */ u8 collideFlags; /* Collide Flags */
@ -284,30 +261,26 @@ typedef struct
/* 0x06 */ u8 unk_06[0x2]; /* 0000 */
} ColliderBodyInfo; // size = 0x08
typedef struct
{
typedef struct {
/* 0x00 */ s16 radius; /* Cylinder Radius */
/* 0x02 */ s16 height; /* Cylinder Height */
/* 0x04 */ s16 yShift; /* Shift Cylinder on Y Axis */
/* 0x06 */ Vec3s position; /* {X, Y, Z} position of Cylinder */
} ColliderDimensions; // size = 0xC
typedef struct
{
typedef struct {
/* 0x00 */ Collider base;
/* 0x18 */ ColliderBody body;
/* 0x40 */ ColliderDimensions dim;
} ColliderCylinderMain; // size = 0x4C
typedef struct
{
typedef struct {
/* 0x00 */ ColliderBodyInfo body;
/* 0x06 */ ColliderBodyInfoInner inner;
/* 0x20 */ ColliderDimensions dim;
} ColliderCylinderInit; // size = 0x2C
typedef struct
{
typedef struct {
/* 0x00 */ Actor* actor;
/* 0x04 */ char unk_04[0x10];
/* 0x14 */ Vec3f scale1;
@ -319,8 +292,7 @@ typedef struct
/* 0x54 */ char unk_54[0x10];
} ActorMesh; // size = 0x64
typedef struct
{
typedef struct {
/* 0x000 */ Actor actor;
/* 0x14C */ u32 dynaPolyId;
/* 0x150 */ f32 unk_150;
@ -332,8 +304,7 @@ typedef struct
/* 0x162 */ s16 unk_162;
} DynaPolyActor; // size = 0x164
typedef struct
{
typedef struct {
/* 0x0000 */ Actor actor;
/* 0x014C */ s8 currentTunic;
/* 0x014D */ s8 currentSword;
@ -408,10 +379,9 @@ typedef struct
/* 0x0A60 */ char unk_A60[0x18];
/* 0x0A78 */ s8 unk_A78;
/* 0x0A79 */ char unk_A79[0x1B];
} Player; //size = 0xA94
} Player; // size = 0xA94
typedef enum
{
typedef enum {
/* 0x00 */ ACTORTYPE_SWITCH,
/* 0x01 */ ACTORTYPE_BG,
/* 0x02 */ ACTORTYPE_PLAYER,
@ -426,8 +396,7 @@ typedef enum
/* 0x0B */ ACTORTYPE_CHEST
} ActorType;
typedef enum
{
typedef enum {
/* 0x0000 */ ACTOR_PLAYER,
/* 0x0001 */ ACTOR_UNSET_1,
/* 0x0002 */ ACTOR_EN_TEST,

View file

@ -1,16 +1,14 @@
#ifndef _Z64CUTSCENE_H_
#define _Z64CUTSCENE_H_
typedef struct
{
typedef struct {
/* 0x00 */ u16 entrance; // entrance index upon which the cutscene should trigger
/* 0x02 */ u8 ageRestriction; // 0 for adult only, 1 for child only, 2 for both ages
/* 0x03 */ u8 flag; // event_chk_inf flag bound to the entrance cutscene
/* 0x04 */ u32 segAddr; // segment offset location of the cutscene
} EntranceCutscene; // size = 0x8
typedef struct
{
typedef struct {
/* 0x00 */ s8 continueFlag;
/* 0x01 */ s8 cameraRoll;
/* 0x02 */ s16 nextPointFrame;
@ -18,38 +16,33 @@ typedef struct
/* 0x08 */ Vec3s pos;
} CutsceneCameraPoint; // size = 0x10
typedef struct
{
typedef struct {
/* 0x00 */ u16 base;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdBase;
typedef struct
{
typedef struct {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 setting;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdEnvLighting;
typedef struct
{
typedef struct {
/* 0x00 */ u8 unk_00;
/* 0x01 */ u8 sequence;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdMusicChange;
typedef struct
{
typedef struct {
/* 0x00 */ u16 type;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
} CsCmdMusicFade;
typedef struct
{
typedef struct {
/* 0x00 */ u16 unk_00;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
@ -58,8 +51,7 @@ typedef struct
/* 0x08 */ u8 unk_08;
} CsCmdUnknown9;
typedef struct
{
typedef struct {
/* 0x00 */ u16 unk_00;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
@ -67,8 +59,7 @@ typedef struct
/* 0x07 */ u8 minute;
} CsCmdDayTime;
typedef struct
{
typedef struct {
/* 0x00 */ u16 base;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
@ -77,8 +68,7 @@ typedef struct
/* 0x0A */ u16 textId2;
} CsCmdTextbox; // size = 0xC
typedef struct
{
typedef struct {
/* 0x00 */ u16 action;
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
@ -88,8 +78,7 @@ typedef struct
/* 0x24 */ Vec3i normal;
} CsCmdActorAction; // size = 0x30
typedef enum
{
typedef enum {
CS_STATE_IDLE,
CS_STATE_SKIPPABLE_INIT,
CS_STATE_SKIPPABLE_EXEC,
@ -97,8 +86,7 @@ typedef enum
CS_STATE_UNSKIPPABLE_EXEC
} CutsceneState;
typedef enum
{
typedef enum {
CS_CMD_00 = 0x0000,
CS_CMD_CAMERA_POS = 0x0001,
CS_CMD_CAMERA_FOCUS = 0x0002,

View file

@ -2,18 +2,17 @@
#define _Z64EFFECT_H_
#include <color.h>
/* gz has trail related structs but they seem to be different in dbg*/
typedef struct
{
// gz has trail related structs but they seem to be different in dbg
typedef struct {
/* 0x0000 */ char unk_00[0x184];
/* 0x0184 */ Color_RGBA8 p1Start;
/* 0x0188 */ Color_RGBA8 p2Start;
/* 0x018C */ Color_RGBA8 p1End;
/* 0x0190 */ Color_RGBA8 p2End;
/* 0x0194 */ u32 unk_194; //these are proably bytes
/* 0x0194 */ u32 unk_194; // these are proably bytes
/* 0x0198 */ u32 unk_198;
/* 0x019C */ u32 unk_19C;
/* 0x01A0 */
} TrailEffect; //size = unk
} TrailEffect; // size = unk
#endif

View file

@ -1,16 +1,14 @@
#ifndef _Z64ITEM_H_
#define _Z64ITEM_H_
typedef enum
{
typedef enum {
/* 0x00 */ EQUIP_SWORD,
/* 0x01 */ EQUIP_SHIELD,
/* 0x02 */ EQUIP_TUNIC,
/* 0x03 */ EQUIP_BOOTS
} EquipmentType;
typedef enum
{
typedef enum {
/* 0x00 */ UPG_QUIVER,
/* 0x01 */ UPG_BOMB_BAG,
/* 0x02 */ UPG_STRENGTH,
@ -21,8 +19,7 @@ typedef enum
/* 0x07 */ UPG_NUTS
} UpgradeType;
typedef enum
{
typedef enum {
/* 0x00 */ SLOT_STICK,
/* 0x01 */ SLOT_NUT,
/* 0x02 */ SLOT_BOMB,
@ -50,8 +47,7 @@ typedef enum
/* 0xFF */ SLOT_NONE = 0xFF
} InventorySlot;
typedef enum
{
typedef enum {
/* 0x00 */ ITEM_STICK,
/* 0x01 */ ITEM_NUT,
/* 0x02 */ ITEM_BOMB,
@ -212,8 +208,7 @@ typedef enum
} ItemID;
// Get Item result may vary depending on context (chest/shop/scrub/drop)
typedef enum
{
typedef enum {
/* 0x00 */ GI_INVALID, // Link picks up chest and it sends him flying upwards
/* 0x01 */ GI_BOMBS_5,
/* 0x02 */ GI_NUTS_5,
@ -258,8 +253,8 @@ typedef enum
/* 0x29 */ GI_SHIELD_DEKU, // or blue rupee if you have the shield
/* 0x2A */ GI_SHIELD_HYLIAN, // or blue rupee if you have the shield
/* 0x2B */ GI_SHIELD_MIRROR,
/* 0x2C */ GI_TUNIC_GORON, // or blue rupee if you have the tunic
/* 0x2D */ GI_TUNIC_ZORA, // or blue rupee if you have the tunic
/* 0x2C */ GI_TUNIC_GORON, // or blue rupee if you have the tunic
/* 0x2D */ GI_TUNIC_ZORA, // or blue rupee if you have the tunic
/* 0x2E */ GI_BOOTS_IRON,
/* 0x2F */ GI_BOOTS_HOVER,
/* 0x30 */ GI_QUIVER_40,

View file

@ -4,15 +4,13 @@
#include <ultra64.h>
#include <ultra64/gbi.h>
typedef struct z_Light_t
{
typedef struct z_Light_t {
/* 0x0 */ struct LightInfo* info;
/* 0x4 */ struct z_Light_t* prev;
/* 0x8 */ struct z_Light_t* next;
} z_Light;
typedef struct
{
typedef struct {
/* 0x0 */ z_Light* lightsHead;
/* 0x4 */ u8 ambientRed;
/* 0x5 */ u8 ambientGreen;
@ -24,21 +22,18 @@ typedef struct
/* 0xC */ s16 unk_0C;
} LightingContext;
typedef struct
{
typedef struct {
/* 0x000 */ int numOccupied;
/* 0x004 */ int nextFree;
/* 0x008 */ z_Light lights[32];
} LightsList;
typedef struct
{
typedef struct {
/* 0x0 */ u8 type;
/* 0x2 */ u16 params[6];
} LightInfo;
typedef struct
{
typedef struct {
/* 0x0 */ s8 dirX;
/* 0x1 */ s8 dirY;
/* 0x2 */ s8 dirZ;
@ -48,8 +43,7 @@ typedef struct
/* 0x6 */ u16 pad[3];
} LightInfoDirectionalParams;
typedef struct
{
typedef struct {
/* 0x0 */ s16 posX;
/* 0x2 */ s16 posY;
/* 0x4 */ s16 posZ;
@ -60,8 +54,7 @@ typedef struct
/* 0xA */ s16 radius;
} LightInfoPositionalParams;
typedef struct
{
typedef struct {
/* 0x00 */ u8 numLights;
/* 0x01 */ u8 enablePosLights;
/* 0x02 */ UNK_TYPE1 pad2[6];
@ -69,14 +62,12 @@ typedef struct
/* 0x10 */ Light lights[7];
} LightMapper;
typedef struct
{
typedef struct {
/* 0x0 */ u8 type;
/* 0x2 */ LightInfoDirectionalParams params;
} LightInfoDirectional;
typedef struct
{
typedef struct {
/* 0x0 */ u8 type;
/* 0x2 */ LightInfoPositionalParams params;
} LightInfoPositional;

View file

@ -3,8 +3,7 @@
#define OBJECT_EXCHANGE_BANK_MAX 19
typedef enum
{
typedef enum {
/* 0x0000 */ OBJECT_UNSET_0,
/* 0x0001 */ OBJECT_GAMEPLAY_KEEP,
/* 0x0002 */ OBJECT_GAMEPLAY_FIELD_KEEP,

View file

@ -1,8 +1,7 @@
#ifndef _Z64SCENE_H_
#define _Z64SCENE_H_
typedef struct
{
typedef struct {
/* 0x00 */ u32 sceneVromStart;
/* 0x04 */ u32 sceneVromEnd;
/* 0x08 */ u32 titleVromStart;
@ -13,50 +12,43 @@ typedef struct
/* 0x13 */ u8 unk_13;
} Scene; // size = 0x14
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 data2;
} SCmdBase;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdSpawnList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 num;
/* 0x04 */ u32 segment;
} SCmdActorList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdCsCameraList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdColHeader;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 num;
/* 0x04 */ u32 segment;
} SCmdRoomList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x02 */ char pad[2];
@ -66,71 +58,61 @@ typedef struct
/* 0x07 */ u8 unk_07;
} SCmdWindSettings;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdEntranceList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 naviMsgNum;
/* 0x04 */ u32 keepObjectId;
} SCmdSpecialFiles;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 gpFlag1;
/* 0x04 */ u32 gpFlag2;
} SCmdRoomBehavior;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdMesh;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 num;
/* 0x04 */ u32 segment;
} SCmdObjectList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 num;
/* 0x04 */ u32 segment;
} SCmdLightList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdPathList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 num;
/* 0x04 */ u32 segment;
} SCmdTransiActorList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 num;
/* 0x04 */ u32 segment;
} SCmdLightSettingList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x02 */ char pad[2];
@ -139,8 +121,7 @@ typedef struct
/* 0x06 */ u8 unk_06;
} SCmdTimeSettings;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x02 */ char pad[2];
@ -149,8 +130,7 @@ typedef struct
/* 0x06 */ u8 unk_06;
} SCmdSkyboxSettings;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x02 */ char pad[2];
@ -158,22 +138,19 @@ typedef struct
/* 0x05 */ u8 unk_05;
} SCmdSkyboxDisables;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 data2;
} SCmdEndMarker;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdExitList;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 bgmId;
/* 0x02 */ char pad[4];
@ -181,42 +158,36 @@ typedef struct
/* 0x07 */ u8 musicSeq;
} SCmdSoundSettings;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x02 */ char pad[5];
/* 0x07 */ u8 echo;
} SCmdEchoSettings;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdCutsceneData;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 data1;
/* 0x04 */ u32 segment;
} SCmdAltHeaders;
typedef struct
{
typedef struct {
/* 0x00 */ u8 code;
/* 0x01 */ u8 cameraMovement;
/* 0x04 */ u32 area;
} SCmdMiscSettings;
typedef struct
{
typedef struct {
u8 headerType;
} MeshHeaderBase;
typedef struct
{
typedef struct {
MeshHeaderBase base;
u8 numEntries;
@ -224,174 +195,144 @@ typedef struct
u32 dListEnd;
} MeshHeader0;
typedef struct
{
typedef struct {
u32 opaqueDList;
u32 translucentDList;
u32 translucentDList;
} MeshEntry0;
typedef struct
{
typedef struct {
MeshHeaderBase base;
u8 format;
u32 entryRecord;
} MeshHeader1Base;
typedef struct
{
typedef struct {
MeshHeader1Base base;
u32 imagePtr; // 0x08
u32 unknown; // 0x0C
u32 unknown2; // 0x10
u16 bgWidth; // 0x14
u16 bgHeight; // 0x16
u8 imageFormat; // 0x18
u8 imageSize; // 0x19
u16 imagePal; // 0x1A
u16 imageFlip; // 0x1C
u32 unknown; // 0x0C
u32 unknown2; // 0x10
u16 bgWidth; // 0x14
u16 bgHeight; // 0x16
u8 imageFormat; // 0x18
u8 imageSize; // 0x19
u16 imagePal; // 0x1A
u16 imageFlip; // 0x1C
} MeshHeader1Single;
typedef struct
{
typedef struct {
MeshHeader1Base base;
u8 bgCnt;
u32 bgRecordPtr;
} MeshHeader1Multi;
typedef struct
{
typedef struct {
u16 unknown; // 0x00
s8 bgID; // 0x02
u32 imagePtr; // 0x04
u32 unknown2; // 0x08
u32 unknown3; // 0x0C
u16 bgWidth; // 0x10
u16 bgHeight; // 0x12
u8 imageFmt; // 0x14
u8 imageSize; // 0x15
u16 imagePal; // 0x16
u16 imageFlip; // 0x18
s8 bgID; // 0x02
u32 imagePtr; // 0x04
u32 unknown2; // 0x08
u32 unknown3; // 0x0C
u16 bgWidth; // 0x10
u16 bgHeight; // 0x12
u8 imageFmt; // 0x14
u8 imageSize; // 0x15
u16 imagePal; // 0x16
u16 imageFlip; // 0x18
} BackgroundRecord;
typedef struct
{
s16 playerXMax, playerZMax;
s16 playerXMin, playerZMin;
u32 opaqueDList;
u32 translucentDList;
typedef struct {
s16 playerXMax, playerZMax;
s16 playerXMin, playerZMin;
u32 opaqueDList;
u32 translucentDList;
} MeshEntry2;
typedef struct
{
typedef struct {
MeshHeaderBase base;
u8 numEntries;
u32 dListStart;
u32 dListEnd;
u32 dListStart;
u32 dListEnd;
} MeshHeader2;
typedef struct
{
typedef struct {
u8 ambientClrR, ambientClrG, ambientClrB;
u8 diffuseClrA_R, diffuseClrA_G, diffuseClrA_B;
u8 diffuseDirA_X, diffuseDirA_Y, diffuseDirA_Z;
u8 diffuseClrB_R, diffuseClrB_G, diffuseClrB_B;
u8 diffuseDirB_X, diffuseDirB_Y, diffuseDirB_Z;
u8 fogClrR, fogClrG, fogClrB;
u16 unk;
u16 drawDistance;
} LightSettings;
typedef struct
{
typedef struct {
s16 absMinX, absMinY, absMinZ;
s16 absMaxX, absMaxY, absMaxZ;
s16 numVerts;
s32 vtxSegmentOffset;
s16 numPolygons;
s32 polySegmentOffset;
s32 polyTypeDefSegmentOffset;
s32 camDataSegmentOffset;
s16 numWaterBoxes;
s32 waterBoxSegmentOffset;
s16 numVerts;
s32 vtxSegmentOffset;
s16 numPolygons;
s32 polySegmentOffset;
s32 polyTypeDefSegmentOffset;
s32 camDataSegmentOffset;
s16 numWaterBoxes;
s32 waterBoxSegmentOffset;
} ColHeader;
typedef struct
{
typedef struct {
s16 cameraSType; // 0x00
s16 numCameras; // 0x02
s32 camPosDataSeg; // 0x04
s16 numCameras; // 0x02
s32 camPosDataSeg; // 0x04
} CamData;
typedef struct
{
typedef struct {
u32 unknown;
u32 camPosDataSeg;
} CamPosDataEntry;
/*
typedef union
{
typedef union {
_CamData data;
long long int forceStructAlignment;
} CamData;
*/
typedef struct
{
typedef struct {
s16 posX, posY, posZ;
s16 rotX, rotY, rotZ;
s16 fov;
s16 jfifId;
s16 unk;
//s16 unk2;
//s32 unk;
s16 rotX, rotY, rotZ;
s16 fov;
s16 jfifId;
s16 unk;
} CamPosData;
/*
typedef union
{
typedef union {
_CamPosData data;
long long int forceStructAlignment;
} CamPosData;
*/
typedef struct
{
typedef struct {
s16 type;
s16 vtxA, vtxB, vtxC;
s16 a, b, c, d;
s16 vtxA, vtxB, vtxC;
s16 a, b, c, d;
} RoomPoly;
typedef struct
{
typedef struct {
s16 xMin;
s16 ySurface;
s16 zMin;
s16 xLength;
s16 zLength;
s32 properties;
s16 ySurface;
s16 zMin;
s16 xLength;
s16 zLength;
s32 properties;
} WaterBoxHeader;
typedef union
{
typedef struct {
/* 0x00 */ u8 count; // Total number of points in the path for the actor to follow
/* 0x04 */ Vec3s* path; // Segment Address of the start of the path list
} Path; // size = 0x8
typedef union {
SCmdBase base;
SCmdSpawnList spawnList;
SCmdActorList actorList;
@ -420,8 +361,7 @@ typedef union
SCmdAltHeaders altHeaders;
} SceneCmd; // size = 0x8
typedef enum
{
typedef enum {
/* 0x00 */ SCENE_YDAN,
/* 0x01 */ SCENE_DDAN,
/* 0x02 */ SCENE_BDAN,