Merge branch 'master' into skelanime

This commit is contained in:
KrimtonZ
2020-03-20 21:53:46 -05:00
138 changed files with 2047 additions and 6466 deletions
+7
View File
@@ -0,0 +1,7 @@
#ifndef _ALLOCA_H_
#define _ALLOCA_H_
void* alloca(unsigned int);
#define alloca __builtin_alloca
#endif
+19 -15
View File
@@ -637,6 +637,7 @@ f32 func_800437F0(f32, f32);
// ? func_8005A7A8(?);
// ? func_8005A8C4(?);
s16 func_8005A970(u32 gl790);
s16 func_8005A9F4(Camera* camera);
// ? func_8005AA90(?);
// ? func_8005AC48(?);
// ? func_8005AC60(?);
@@ -758,7 +759,7 @@ void func_80062D60(GlobalContext*, Vec3f*);
s32 func_80062ECC(f32, f32, f32, Vec3f*, Vec3f*, Vec3f*, Vec3f*, Vec3f*);
void SaveContext_Init(void);
// ? func_800636C0(?);
void func_8006375C(UNK_TYPE, UNK_TYPE, UNK_TYPE);
void func_8006375C(s32 arg0, s32 arg1, float* d_80855320);
// ? func_8006376C(?);
// ? func_80063828(?);
// ? func_8006390C(?);
@@ -788,6 +789,7 @@ void Audio_PlaySoundAtPosition(GlobalContext* globalCtx, Vec3f* pos2, s32 radius
// ? func_8006C3A0(?);
// ? func_8006C3D0(?);
void func_8006C438(GlobalContext* globalCtx, s16 arg1);
s32 func_8006C4A4(GlobalContext*, s32);
// ? func_8006C510(?);
// ? func_8006C5A8(?);
// ? func_8006CBAC(?);
@@ -844,7 +846,7 @@ void func_800775D8();
s32 func_800775E4();
void func_800775F0(u16);
// ? func_80077600(?);
void Lib_MemSet(void* dest, size_t size, u8 val);
void Lib_MemSet(u8* dest, size_t size, u8 val);
f32 Math_Coss(s16 angle);
f32 Math_Sins(s16 angle);
s32 Math_ApproxUpdateScaledS(s16* fp, s16 target, s16 step);
@@ -919,10 +921,10 @@ u8 ZeldaArena_IsInitalized();
void MapMark_Init(GlobalContext* globalCtx);
void MapMark_ClearPointers(GlobalContext* globalCtx);
void MapMark_DrawConditionally(GlobalContext* globalCtx);
// ? func_8007BE60(?);
// ? func_8007BED4(?);
// ? func_8007BF08(?);
// ? func_8007BF10(?);
void PreNmiBuff_Init(PreNmiBuff* this);
void PreNmiBuff_SetReset(PreNmiBuff* this);
u32 PreNmiBuff_IsResetting(PreNmiBuff* this);
void MsgEvent_SendNullTask();
f32 func_8007BF90(Vec3f*, Vec3f*);
// ? func_8007C028(?);
// ? func_8007C058(?);
@@ -1379,7 +1381,7 @@ void func_800C0704(GlobalContext*, s16, f32);
void func_800C0C88(GlobalContext *globalCtx);
// ? func_800C0A44(?);
// ? func_800C0A88(?);
// ? func_800C0AF4(?);
void func_800C0AF4(GlobalContext*, s8, s16);
void func_800C0B60(GlobalContext* globalCtx);
void func_800C0BB4(GlobalContext* globalCtx);
// ? func_800C0CB8(?);
@@ -1476,7 +1478,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);
// ? func_800C6C28(?);
Gfx* func_800C6C28(Gfx* a0, Gfx* dlist); //branch dlist
// ? func_800C6C3C(?);
ListAlloc* ListAlloc_Init(ListAlloc* this);
void* ListAlloc_Alloc(ListAlloc* this, u32 size);
@@ -1633,10 +1635,10 @@ void func_800D2264(MtxF* mf, Vec3s* vec, s32 flag);
void func_800D23FC(f32 f, Vec3f* vec, u8 mode);
MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line);
void func_800D2CEC(Mtx* mtx, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6);
// ? func_800D2DF0(?);
// ? func_800D2DFC(?);
// ? func_800D2E14(?);
// ? func_800D2E20(?);
// ? SysUcode_GetUCodeBoot(?);
// ? SysUcode_GetUcodeBootSize(?);
// ? SysUcode_GetUcode(?);
// ? SysUcode_GetUcodeData(?);
// ? func_800D2E30(?);
// ? func_800D3140(?);
// ? func_800D3140(?);
@@ -1682,7 +1684,7 @@ u32 Fault_ConvertAddress(FaultAddrConvClient*);
void Fault_Sleep(u32);
void Fault_PadCallback(Input*);
void Fault_UpdatePadImpl();
bool Fault_WaitForInputImpl();
u32 Fault_WaitForInputImpl();
void Fault_WaitForInput();
void Fault_DrawRec(s32, s32, s32, s32, u16);
void Fault_FillScreenBlack();
@@ -2136,7 +2138,7 @@ void GfxPrint_SetPosPx(GfxPrint*, s32, s32);
void GfxPrint_SetPos(GfxPrint*, s32, s32);
void GfxPrint_SetBasePosPx(GfxPrint*, s32, s32);
void GfxPrint_PrintCharImpl(GfxPrint*, u8);
void GfxPrint_PrintChar(GfxPrint*, char);
void GfxPrint_PrintChar(GfxPrint*, u8);
void GfxPrint_PrintStringWithSize(GfxPrint*, const void*, size_t, size_t);
GfxPrint* GfxPrint_Callback(GfxPrint*, const char*, size_t);
void GfxPrint_Ctor(GfxPrint*);
@@ -2386,5 +2388,7 @@ void func_801109B0(GlobalContext* globalCtx);
void func_80110F68(GlobalContext* globalCtx);
void func_80112098(GlobalContext* globalCtx);
void func_80800878(TitleContext*);
void Title_Init(TitleContext*);
void Opening_Init(OpeningContext* this);
#endif
+6 -1
View File
@@ -1,7 +1,12 @@
#ifndef _REGS_H_
#define _REGS_H_
#define BASE_REG(n, r) gGameInfo->data[n * 96 + r]
#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
#define BASE_REG(n, r) gGameInfo->data[n * REG_PER_GROUP + r]
#define REG(r) BASE_REG(0, r)
#define SREG(r) BASE_REG(1, r)
+14 -2
View File
@@ -3,6 +3,16 @@
#include <global.h>
#define OS_SC_NEEDS_RDP 0x0001
#define OS_SC_NEEDS_RSP 0x0002
#define OS_SC_DRAM_DLIST 0x0004
#define OS_SC_PARALLEL_TASK 0x0010
#define OS_SC_LAST_TASK 0x0020
#define OS_SC_SWAPBUFFER 0x0040
#define OS_SC_RCP_MASK 0x0003
#define OS_SC_TYPE_MASK 0x0007
typedef struct OSScTask
{
/* 0x00 */ struct OSScTask* next;
@@ -10,8 +20,8 @@ typedef struct OSScTask
/* 0x08 */ u32 flags;
/* 0x0C */ void* framebuffer;
/* 0x10 */ OSTask list;
/* 0x58 */ OSMesgQueue* msgQ;
/* 0x5C */ OSMesg msg;
/* 0x50 */ OSMesgQueue* msgQ;
/* 0x54 */ OSMesg msg;
} OSScTask;
typedef struct
@@ -39,4 +49,6 @@ typedef struct
/* 0x0220 */ char unk_254[0x04];
} SchedContext; // size = 0x258
extern SchedContext gSchedContext;
#endif
+1
View File
@@ -921,6 +921,7 @@ DECLARE_ROM_SEGMENT(g_pn_55)
DECLARE_ROM_SEGMENT(g_pn_56)
DECLARE_ROM_SEGMENT(g_pn_57)
DECLARE_ROM_SEGMENT(nintendo_rogo_static)
DECLARE_ROM_SEGMENT(title_static)
DECLARE_ROM_SEGMENT(parameter_static)
DECLARE_ROM_SEGMENT(vr_cloud2_static)
+5 -3
View File
@@ -76,9 +76,11 @@
*
**************************************************************************/
#define M_GFXTASK 1
#define M_AUDTASK 2
#define M_VIDTASK 3
#define M_NULTASK 0
#define M_GFXTASK 1
#define M_AUDTASK 2
#define M_VIDTASK 3
#define M_NJPEGTASK 4
#define M_HVQTASK 6
#define M_HVQMTASK 7
+4 -83
View File
@@ -259,8 +259,8 @@ extern s32 D_8011D3AC;
//extern ? D_8011E096;
//extern ? D_8011E098;
//extern ? D_8011E09A;
//extern ? D_8011E0B0;
//extern ? D_8011E0B4;
extern s16 D_8011E0B0;
extern Color_RGBA8 D_8011E0B4[];
//extern ? D_8011E0D4;
//extern ? D_8011F3A0;
//extern ? D_8011F3D4;
@@ -692,14 +692,12 @@ extern void* D_8012D1F0;
extern u32 gScreenWidth;
extern u32 gScreenHeight;
extern u32 gSystemHeapSize;
extern s32 D_8012D280;
extern u32 D_8012D284;
extern volatile u32 D_8012D290;
//extern ? D_8012D2A0;
extern Mtx gMtxClear;
extern MtxF gMtxFClear;
//extern ? D_8012DBB0;
//extern ? D_8012DBC0;
extern u32 D_8012DBC0;
extern volatile u32 gIrqMgrResetStatus;
extern u32 D_8012DBA0;
extern u32 D_8012DBA4;
@@ -1357,11 +1355,6 @@ extern f32 D_80136D44;
//extern ? D_8013AC7C;
//extern ? D_8013ACA0;
//extern ? D_8013ACB8;
//extern ? D_8013AD40;
//extern ? D_8013AD50;
//extern ? D_8013AD54;
//extern ? D_8013AD60;
//extern ? D_8013AD70;
//extern ? D_8013B830;
//extern ? D_8013B844;
//extern ? D_8013B858;
@@ -2661,77 +2654,6 @@ extern char D_80141030[];
//extern ? D_8014575C;
//extern ? D_80145780;
//extern ? D_80145794;
extern char D_801457B0[];
extern char D_801457F0[];
extern char D_8014582C[];
extern char D_80145860[];
extern char D_80145894[];
extern char D_8014589C[];
extern char D_801458B0[];
extern char D_801458CC[];
extern char D_801458D0[];
extern char D_801458D8[];
extern char D_801458EC[];
extern char D_80145914[];
extern char D_80145918[];
extern char D_80145920[];
extern char D_80145934[];
extern char D_80145944[];
extern char D_80145948[];
extern char D_80145950[];
extern char D_80145964[];
extern char D_8014598C[];
extern char D_80145990[];
extern char D_80145998[];
extern char D_801459AC[];
extern char D_801459CC[];
extern char D_801459D0[];
extern char D_801459D8[];
extern char D_801459EC[];
extern char D_80145A24[];
extern char D_80145A28[];
extern char D_80145A30[];
extern char D_80145A44[];
extern char D_80145A60[];
extern char D_80145A64[];
extern char D_80145A70[];
extern char D_80145A80[];
extern char D_80145A88[];
extern char D_80145A9C[];
extern char D_80145ABC[];
extern char D_80145AC0[];
extern char D_80145AC8[];
extern char D_80145ADC[];
extern char D_80145AEC[];
//extern ? D_80145AF0;
//extern ? D_80145AF8;
//extern ? D_80145B0C;
//extern ? D_80145B1C;
//extern ? D_80145B20;
//extern ? D_80145B2C;
//extern ? D_80145B48;
//extern ? D_80145B50;
//extern ? D_80145B64;
//extern ? D_80145B80;
//extern ? D_80145B84;
//extern ? D_80145B8C;
//extern ? D_80145BA0;
//extern ? D_80145BB0;
//extern ? D_80145BB4;
//extern ? D_80145BC0;
//extern ? D_80145BD8;
//extern ? D_80145BE4;
//extern ? D_80145BF0;
//extern ? D_80145C10;
extern char D_80145C40[];
extern char D_80145C58[];
extern char D_80145C78[];
extern char D_80145CA0[];
extern char D_80145CA4[];
extern char D_80145CB0[];
extern char D_80145CD4[];
extern char D_80145CF8[];
extern char D_80145D18[];
//extern ? D_80145D40;
//extern ? D_80145D54;
//extern ? D_80145D60;
@@ -3651,13 +3573,12 @@ extern Color_RGBA8 D_801614B0;
//extern ? D_801665E0;
//extern ? D_801665F0;
//extern ? D_80166648;
extern u8* gAppNmiBufferPtr;
extern PreNmiBuff* gAppNmiBufferPtr;
//extern ? gSchedContext;
//extern u8 gPadMgr[];
extern u8 D_80166B68;
//extern ? D_80166D28;
extern u32 gSegments[];
extern u32 D_8016A4F0;
//extern ? D_8016A500;
//extern ? D_8016A504;
//extern ? D_8016A508;
+42 -35
View File
@@ -33,8 +33,12 @@
// Data normally accessed through REG macros (see regs.h)
typedef struct
{
/* 0x00 */ char unk_00[0x14];
/* 0x14 */ s16 data[0xAE0];
/* 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
} GameInfo; // size = 0x15D4
typedef struct
@@ -808,6 +812,11 @@ typedef struct
/* 0x04 */ u32 vromEnd;
} RomFile; // size = 0x8
typedef struct
{
/* 0x00 */ void* read_buff;
} Sram; // size = 0x4
typedef struct GameAllocEntry
{
/* 0x00 */ struct GameAllocEntry* next;
@@ -840,10 +849,17 @@ typedef struct GameState
typedef struct
{
/* 0x0000 */ GameState state;
/* 0x00A4 */ char unk_A4[0x12C];
/* 0x01D0 */ UNK_TYPE unk_1D0;
/* 0x01D4 */ char unk_1D4[0xD];
/* 0x01E1 */ u8 unk_1E1;
/* 0x00A4 */ void* staticSegment;
/* 0x00A8 */ View view;
/* 0x01D0 */ Sram sram;
/* 0x01D4 */ u16 unk_1D4; // not used in mq dbg (some sort of timer that doesn't seem to affect anything)
/* 0x01D6 */ s16 coverAlpha;
/* 0x01D8 */ s16 addAlpha; // not used in mq dbg
/* 0x01DA */ u16 visibleDuration; // not used in mq dbg
/* 0x01DC */ s16 ult;
/* 0x01DE */ s16 uls;
/* 0x01E0 */ char unk_1E0;
/* 0x01E1 */ u8 exit;
/* 0x01E2 */ char unk_1E2[6];
} TitleContext; // size = 0x1E8
@@ -1047,20 +1063,17 @@ typedef struct SkelAnime
/* 0x14 */ f32 unk_14;
/* 0x18 */ f32 animCurrentFrame;
/* 0x1C */ f32 animPlaybackSpeed;
/* 0x20 */ Vec3s* actorDrawTbl;
/* 0x24 */ Vec3s* unk_24;
/* 0x28 */ f32 unk_28;
/* 0x2C */ f32 unk_2C;
/* 0x30 */ s32 (*mtxUpdate)();
/* 0x34 */ s8 unk_34;
/* 0x35 */ u8 unk_35;
/* 0x36 */ s16 unk_36;
/* 0x38 */ s16 unk_38;
/* 0x3A */ s16 unk_3A;
/* 0x3C */ s16 unk_3C;
/* 0x3E */ s16 unk_3E;
/* 0x40 */ s16 unk_40;
/* 0x42 */ s16 unk_42;
/* 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
@@ -1385,21 +1398,7 @@ typedef struct OverlayRelocationSection {
/* 0x0C */ u32 bssSize;
/* 0x10 */ u32 nRelocations;
/* 0x14 */ u32 relocations[1];
} OverlayRelocationSection; /* size >= 0x18 */
#define VEC3_ADD( V3A0, V3A1 ) \
{ \
V3A0.x += V3A1.x; \
V3A0.y += V3A1.y; \
V3A0.z += V3A1.z; \
}
#define VEC3_SUB( V3DST, V3A0, V3A1 ) \
{ \
V3DST.x = V3A0.x - V3A1.x; \
V3DST.y = V3A0.y - V3A1.y; \
V3DST.z = V3A0.z - V3A1.z; \
}
} OverlayRelocationSection; // size >= 0x18
typedef struct
{
@@ -1422,4 +1421,12 @@ typedef struct ListAlloc
/* 0x04 */ struct ListAlloc* next;
} ListAlloc; //size = 0x8
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)
#endif
+11 -8
View File
@@ -13,6 +13,11 @@ struct GlobalContext;
// From z64light.h
struct LightMapper;
typedef struct
{
f32 x, y;
} Vec2f;
typedef struct
{
f32 x, y, z;
@@ -25,13 +30,8 @@ typedef struct
typedef struct
{
f32 x, y;
} Vec2f;
typedef struct
{
u32 x, y;
} Vec2i;
s32 x, y, z;
} Vec3i;
typedef struct
{
@@ -329,6 +329,7 @@ typedef struct
/* 0x15A */ u16 unk_15A;
/* 0x15C */ u32 unk_15C;
/* 0x160 */ u8 unk_160;
/* 0x162 */ s16 unk_162;
} DynaPolyActor; // size = 0x164
typedef struct
@@ -394,7 +395,9 @@ typedef struct
/* 0x0846 */ u8 unk_846;
/* 0x0847 */ char unk_847[0x004];
/* 0x084B */ s8 unk_84B[UNK_SIZE];
/* 0x084C */ char unk_84C[0x054];
/* 0x084C */ char unk_84C[0x003];
/* 0x084F */ s8 unk_84F;
/* 0x0850 */ char unk_850[0x050];
/* 0x08A0 */ u8 unk_8A0;
/* 0x08A1 */ u8 unk_8A1;
/* 0x08A2 */ u16 unk_8A2;
+3 -3
View File
@@ -83,9 +83,9 @@ typedef struct
/* 0x02 */ u16 startFrame;
/* 0x04 */ u16 endFrame;
/* 0x06 */ Vec3s rot;
/* 0x0C */ Vec3f startPos;
/* 0x18 */ Vec3f endPos;
/* 0x24 */ Vec3f normal;
/* 0x0C */ Vec3i startPos;
/* 0x18 */ Vec3i endPos;
/* 0x24 */ Vec3i normal;
} CsCmdActorAction; // size = 0x30
typedef enum