From 5dea0fd78580efa172d3dddbab43323cbc019826 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Sat, 4 Apr 2020 18:17:56 +0100 Subject: Decompile most of z_view --- include/functions.h | 51 ++++++++++++++++++++++++++++++--------------------- include/z64.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 76 insertions(+), 26 deletions(-) (limited to 'include') diff --git a/include/functions.h b/include/functions.h index 0681e243f..ccd8bece9 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1259,27 +1259,36 @@ u32 func_800AA148(); void func_800AA15C(); void func_800AA16C(); void func_800AA178(u32); -// ? func_800AA190(?); +void func_800AA190(UNK_VIEW_STRUCT* arg0, Viewport* viewport); +View* func_800AA1F8(GraphicsContext* gfxCtx); +void func_800AA250(View* view); void func_800AA278(View*, GraphicsContext*); -// ? func_800AA358(?); -// ? func_800AA43C(?); -void func_800AA460(View*, f32, f32, f32); -// ? func_800AA4FC(?); -// ? func_800AA550(?); -void func_800AA76C(View*, f32, f32, f32); -void func_800AA78C(View*, f32, f32, f32); -void func_800AA7AC(View*, f32); -// ? func_800AA7B8(?); -// ? func_800AA814(?); -// ? func_800AA890(?); -// ? func_800AAA50(?); -// ? func_800AAA9C(?); -// ? func_800AB0A8(?); -// ? func_800AB2C4(?); -// ? func_800AB560(?); -// ? func_800AB944(?); +void func_800AA358(View* view, Vec3f* vec1, Vec3f* vec2, Vec3f* vec3); +void func_800AA3F0(View* view, Vec3f* vec1, Vec3f* vec2, Vec3f* vec3); +void func_800AA43C(View* view, f32 arg1); +void func_800AA454(View* view, f32* arg1); +void func_800AA460(View* view, f32 fieldOfView, f32 fogDistance, f32 zDepth); +void func_800AA48C(View* view, f32* fieldOfView, f32* fogDistance, f32* zDepth); +void func_800AA4A8(View* view, f32 fieldOfView, f32 fogDistance, f32 zDepth); +void func_800AA4E0(View* view, f32* fieldOfView, f32* fogDistance, f32* zDepth); +void func_800AA4FC(View* view, Viewport* viewport); +void func_800AA52C(View* view, Viewport* viewport); +void func_800AA550(View* view); +void func_800AA76C(View* view, f32 arg1, f32 arg2, f32 arg3); +void func_800AA78C(View* view, f32 arg1, f32 arg2, f32 arg3); +void func_800AA7AC(View* view, f32 arg1); +void func_800AA7B8(View* view); +void func_800AA814(View* view); +void func_800AA840(View* view, Vec3f vec1, Vec3f vec2, f32 arg3); +s32 func_800AA890(View* view, Mtx* mtx); +void func_800AAA50(View* view, s32 arg1); +s32 func_800AAA9C(View* view); +s32 func_800AB0A8(View* view); +s32 func_800AB2C4(View* view); +s32 func_800AB560(View* view); +s32 func_800AB944(View* view); // ? func_800AB9EC(?); -void func_800ABE74(f32, f32, f32); +s32 func_800ABE74(f32 eyeX, f32 eyeY, f32 eyeZ); // ? func_800AC030(?); // ? func_800AC2F4(?); // ? func_800AC89C(?); @@ -2339,7 +2348,7 @@ s16 sins(u16); // ? func_80101AA4(?); // ? func_80101B40(?); // ? func_80101B90(?); -// ? func_80101E34(?); +void func_80101E34(MtxF*, f32, f32, f32, f32, f32, f32, f32, f32, f32); // ? func_80101EB0(?); // ? func_801021E4(?); // ? osStopTimer(?); @@ -2373,7 +2382,7 @@ void osDpSetStatus(u32 status); // ? func_801041E0(?); // ? func_801043B8(?); // ? func_80104450(?); -// ? func_801045A4(?); +void func_801045A4(Mtx*, f32, f32, f32, f32, f32, f32, f32); f32 cosf(f32); s16 coss(u16); void osViSetEvent(OSMesgQueue* mq, OSMesg m, u32 retraceCount); diff --git a/include/z64.h b/include/z64.h index 130367772..72955e63f 100644 --- a/include/z64.h +++ b/include/z64.h @@ -285,12 +285,53 @@ typedef struct { /* 0x16 */ char unk_16[0x02]; } Input; // size = 0x18 -typedef struct { - /* 0x0000 */ char unk_00[0x28]; +typedef struct +{ + /* 0x0000 */ s16 unk_0; + /* 0x0002 */ s16 unk_2; + /* 0x0004 */ u16 unk_4; + /* 0x0004 */ u16 unk_6; + /* 0x0008 */ s16 unk_8; + /* 0x000A */ s16 unk_A; + /* 0x000C */ u16 unk_C; + /* 0x000E */ u16 unk_E; +} UNK_VIEW_STRUCT; // size = 0x10, probably a viewport in disguise + +typedef struct +{ + /* 0x0000 */ s32 topY; //uly (upper left y) + /* 0x0004 */ s32 bottomY; //lry (lower right y) + /* 0x0008 */ s32 leftX; //ulx (upper left x) + /* 0x000C */ s32 rightX; //lrx (lower right x) +} Viewport; // size = 0x10 + +typedef struct +{ + /* 0x0000 */ s32 viewStart; //string literal "VIEW" / 0x56494557 + /* 0x0004 */ GraphicsContext* gfxCtx; + /* 0x0008 */ Viewport viewport; + /* 0x0018 */ f32 fieldOfView; //fovy + /* 0x001C */ f32 fogDistance; //near + /* 0x0020 */ f32 zDepth; //far + /* 0x0024 */ f32 unk_24; //scale /* 0x0028 */ Vec3f eye; - /* 0x0034 */ char unk_34[0xEC]; - /* 0x0120 */ u32 unk_120; - /* 0x0124 */ char unk_124[4]; + /* 0x0034 */ Vec3f unk_34; + /* 0x0040 */ Vec3f unk_40; + /* 0x004C */ char unk_4C[0x04]; + /* 0x0050 */ Viewport unk_50; + /* 0x0060 */ Mtx unk_60; + /* 0x00A0 */ MtxF unk_A0; + /* 0x00E0 */ Mtx* unk_E0; + /* 0x00E4 */ MtxF* unk_E4; + /* 0x00E8 */ Vec3f unk_E8; + /* 0x00F4 */ Vec3f unk_F4; + /* 0x0100 */ f32 unk_100; + /* 0x0104 */ Vec3f unk_104; + /* 0x0110 */ Vec3f unk_110; + /* 0x011C */ u16 unk_11C; //normal + /* 0x011E */ u16 unk_11E; + /* 0x0120 */ s32 unk_120; + /* 0x0124 */ s32 unk_124; } View; // size = 0x128 typedef struct { -- cgit v1.2.3 From 668d35b77f9dc923e1be27f0f03bf3f476729838 Mon Sep 17 00:00:00 2001 From: Thar0 <17233964+Thar0@users.noreply.github.com> Date: Sun, 5 Apr 2020 02:50:46 +0100 Subject: Cleanups, Use VT macros --- include/functions.h | 2 +- include/z64.h | 31 ++++++++++++++----------------- 2 files changed, 15 insertions(+), 18 deletions(-) (limited to 'include') diff --git a/include/functions.h b/include/functions.h index c1a6ec32d..4f909af8b 100644 --- a/include/functions.h +++ b/include/functions.h @@ -1263,7 +1263,7 @@ u32 func_800AA148(); void func_800AA15C(); void func_800AA16C(); void func_800AA178(u32); -void func_800AA190(UNK_VIEW_STRUCT* arg0, Viewport* viewport); +void func_800AA190(UnkViewStruct* arg0, Viewport* viewport); View* func_800AA1F8(GraphicsContext* gfxCtx); void func_800AA250(View* view); void func_800AA278(View*, GraphicsContext*); diff --git a/include/z64.h b/include/z64.h index 9c129805e..6cc0485a9 100644 --- a/include/z64.h +++ b/include/z64.h @@ -286,8 +286,7 @@ typedef struct { /* 0x16 */ char unk_16[0x02]; } Input; // size = 0x18 -typedef struct -{ +typedef struct { /* 0x0000 */ s16 unk_0; /* 0x0002 */ s16 unk_2; /* 0x0004 */ u16 unk_4; @@ -296,25 +295,23 @@ typedef struct /* 0x000A */ s16 unk_A; /* 0x000C */ u16 unk_C; /* 0x000E */ u16 unk_E; -} UNK_VIEW_STRUCT; // size = 0x10, probably a viewport in disguise +} UnkViewStruct; // size = 0x10, probably a viewport in disguise -typedef struct -{ - /* 0x0000 */ s32 topY; //uly (upper left y) - /* 0x0004 */ s32 bottomY; //lry (lower right y) - /* 0x0008 */ s32 leftX; //ulx (upper left x) - /* 0x000C */ s32 rightX; //lrx (lower right x) +typedef struct { + /* 0x0000 */ s32 topY; // uly (upper left y) + /* 0x0004 */ s32 bottomY; // lry (lower right y) + /* 0x0008 */ s32 leftX; // ulx (upper left x) + /* 0x000C */ s32 rightX; // lrx (lower right x) } Viewport; // size = 0x10 -typedef struct -{ - /* 0x0000 */ s32 viewStart; //string literal "VIEW" / 0x56494557 +typedef struct { + /* 0x0000 */ s32 magic; // string literal "VIEW" / 0x56494557 /* 0x0004 */ GraphicsContext* gfxCtx; /* 0x0008 */ Viewport viewport; - /* 0x0018 */ f32 fieldOfView; //fovy - /* 0x001C */ f32 fogDistance; //near - /* 0x0020 */ f32 zDepth; //far - /* 0x0024 */ f32 unk_24; //scale + /* 0x0018 */ f32 fieldOfView; // fovy + /* 0x001C */ f32 fogDistance; // near + /* 0x0020 */ f32 zDepth; // far + /* 0x0024 */ f32 unk_24; // scale /* 0x0028 */ Vec3f eye; /* 0x0034 */ Vec3f unk_34; /* 0x0040 */ Vec3f unk_40; @@ -329,7 +326,7 @@ typedef struct /* 0x0100 */ f32 unk_100; /* 0x0104 */ Vec3f unk_104; /* 0x0110 */ Vec3f unk_110; - /* 0x011C */ u16 unk_11C; //normal + /* 0x011C */ u16 unk_11C; // normal /* 0x011E */ u16 unk_11E; /* 0x0120 */ s32 unk_120; /* 0x0124 */ s32 unk_124; -- cgit v1.2.3