Decompile z_camera data, and some camera WIP (#173)

* cleanup

* name camera action functions

* decompile a few small functions, name a few Camera struct members

* decompile camera data, decompile a few camera functions

* Split ASM for code_800BB0A0

* removing code_800BB0A0.s

* PR Requests, Camera WIP

* remove #define NON_MATCHING from db_camera
This commit is contained in:
krimtonz
2020-06-01 16:54:47 -05:00
committed by GitHub
parent 08aaba0d2c
commit 77137f5a04
76 changed files with 3967 additions and 2282 deletions
+15 -15
View File
@@ -481,7 +481,7 @@ void ActorOverlayTable_Cleanup(void);
// ? func_80038924(?);
// ? func_800389D4(?);
void func_80038A28(CollisionPoly*, f32, f32, f32, MtxF*);
// ? func_80038B7C(?);
f32 func_80038B7C(CollisionPoly*, Vec3f*);
// ? func_80038BE0(?);
// ? func_80038D48(?);
// ? func_80038E78(?);
@@ -585,7 +585,7 @@ void DynaPolyInfo_Alloc(UNK_PTR arg0, UNK_PTR arg1);
// ? func_80041A4C(?);
// ? func_80041B24(?);
// ? func_80041B80(?);
// ? func_80041C10(?);
struct_80041C10_ret* func_80041C10(CollisionContext* colCtx, s32, s32);
// ? func_80041C98(?);
// ? func_80041D4C(?);
// ? func_80041D94(?);
@@ -646,8 +646,8 @@ f32 func_800437F0(f32, f32);
// ? func_80044ADC(?);
// ? func_80044E68(?);
// ? func_800450A4(?);
// ? func_80045128(?);
// ? func_80045254(?);
// ? Camera_CopyModeValuesToPREG(?);
// ? Camera_CopyPREGToModeValues(?);
// ? func_80045350(?);
// ? func_8004545C(?);
// ? func_80045508(?);
@@ -664,9 +664,9 @@ f32 func_800437F0(f32, f32);
// ? func_80046CB4(?);
// ? func_80046E20(?);
// ? func_80047394(?);
// ? func_800473A0(?);
// ? func_80051B3C(?);
// ? func_80052E0C(?);
// ? Camera_Normal1(?);
// ? Camera_Unique2(?);
// ? Camera_Unique9(?);
// ? func_80054314(?);
// ? func_8005445C(?);
// ? func_80054478(?);
@@ -682,16 +682,16 @@ void Camera_ChangeStatus(Camera* camera, s16 status);
// ? func_800591EC(?);
void func_80059EC8(Camera* camera);
// ? func_8005A02C(?);
// ? func_8005A04C(?);
// ? Camera_ChangeMode(?);
// ? func_8005A444(?);
// ? func_8005A548(?);
// ? Camera_ChangeSetting(?);
s32 func_8005A77C(Camera* camera, s16 button);
// ? func_8005A7A8(?);
// ? func_8005A8C4(?);
s16 func_8005A970(Vec3s, Camera*);
Vec3s* func_8005A970(Vec3s*, Camera*);
s16 func_8005A9F4(Camera* camera);
void func_8005AA1C(Camera* camera, s32, s16, s32);
s32 func_8005AA90(Camera*, s32, Vec3f*);
s32 func_8005AA1C(Camera* camera, s32, s16, s32);
s32 Camera_SetParam(Camera*, s32, void*);
// ? func_8005AC48(?);
// ? func_8005AC60(?);
// ? func_8005AC6C(?);
@@ -1024,8 +1024,8 @@ f32 func_8007BF90(Vec3f*, Vec3f*);
// ? func_8007C0F8(?);
// ? func_8007C25C(?);
// ? func_8007C29C(?);
// ? func_8007C3F4(?);
// ? func_8007C490(?);
VecSph* func_8007C3F4(VecSph* arg0, Vec3f* arg1);
void func_8007C490(VecSph* arg0, Vec3f* a, Vec3f* b);
// ? func_8007C4E0(?);
// ? func_8007C680(?);
// ? func_8007C704(?);
@@ -2465,7 +2465,7 @@ u32 osDpGetStatus(void);
void osDpSetStatus(u32 status);
// ? func_801041E0(?);
// ? func_801043B8(?);
void guOrthoF(f32[4][4], f32, f32, f32, f32, f32, f32, f32);
void guOrthoF(f32[4][4], f32, f32, f32, f32, f32, f32, f32);
void guOrtho(Mtx*, f32, f32, f32, f32, f32, f32, f32);
f32 cosf(f32);
s16 coss(u16);
+9 -9
View File
@@ -186,14 +186,14 @@ extern s32 gMaxActorId; // original name: "MaxProfile"
//extern ? D_80119E54;
//extern ? D_80119E94;
//extern ? D_80119EAC;
//extern ? D_80119EE0;
//extern ? D_80119F4C;
//extern ? D_80119F50;
//extern ? D_80119F88;
//extern ? D_80119F8C;
//extern ? D_8011A2A4;
//extern ? D_8011D064;
//extern ? D_8011D390;
//extern ? sOREGInit;
//extern ? sOREGInitCnt;
//extern ? sPREGInit;
//extern ? sPREGInitCnt;
//extern ? sCameraSettingNames;
//extern ? sCameraModeNames;
//extern ? sCameraSettings;
//extern ? sInitRegs;
extern s32 D_8011D394;
//extern ? D_8011D398;
//extern ? D_8011D39C;
@@ -205,7 +205,7 @@ extern s32 D_8011D3AC;
//extern ? D_8011D3E8;
//extern ? D_8011D3F0;
//extern ? D_8011D3F4;
//extern ? D_8011D3F8;
//extern ? sCameraFunctionNames;
//extern ? D_8011D658;
//extern ? D_8011D678;
//extern ? D_8011D6A8;
+132 -26
View File
@@ -391,48 +391,122 @@ typedef struct {
} View; // size = 0x128
typedef struct {
/* 0x0000 */ s32 unk_00;
/* 0x0000 */ f32 unk_00;
/* 0x0004 */ f32 unk_04;
/* 0x0008 */ s16 unk_08;
} Special9; // size = 0xC
typedef struct {
/* 0x0000 */ Actor* door;
/* 0x0004 */ s16 unk_04;
/* 0x0006 */ s16 unk_06;
/* 0x0008 */ s16 unk_08;
/* 0x000A */ s16 unk_0A;
/* 0x000C */ char unk_0C[0x16];
/* 0x0022 */ s16 unk_22;
/* 0x0024 */ char unk_24[0x2C];
/* 0x000C */ Special9 spec9;
/* 0x0018 */ s16 unk_18;
} DoorCamera; // size = 0x1C
typedef struct {
f32 unk_00;
s16 unk_04;
} Special0;
typedef struct {
/* 0x0000 */ f32 unk_00;
/* 0x0004 */ s16 unk_04;
} Demo1_unk_04; // size = 0x14
typedef struct {
/* 0x0000 */ s16 unk_00;
/* 0x0002 */ s16 unk_02;
/* 0x0004 */ Demo1_unk_04 unk_04;
} Demo1; // size = 0x18
typedef struct {
char unk_00[0xC];
s32 unk_0C;
f32 unk_10;
s16 unk_14;
s16 unk_16;
s16 unk_18;
s16 unk_1A;
f32 unk_1C;
f32 unk_20;
s16 unk_24;
s16 unk_26;
s16 unk_28;
s16 unk_2A;
} Normal3_Unk20;
typedef struct {
f32 unk_00;
f32 unk_04; // distance
f32 unk_08;
f32 unk_0C;
f32 unk_10;
f32 unk_14; // fov
f32 unk_18;
s16 unk_1C; // theta
s16 unk_1E;
Normal3_Unk20 unk_20;
} Normal3;
typedef union {
char data[0x50];
s16 sh[2];
s32 w;
f32 f;
DoorCamera doorCam;
Special0 spec0;
Demo1 demo1;
Normal3 normal3;
} camera_unk_00;
typedef struct {
Vec3s unk_00;
Vec3s unk_06;
s16 unk_0C;
s16 unk_0E;
} struct_80041C10_ret;
typedef struct {
/* 0x0000 */ camera_unk_00 unk_00;
/* 0x0050 */ Vec3f at;
/* 0x005C */ Vec3f eye;
/* 0x0068 */ Vec3f unk_68;
/* 0x0074 */ Vec3f unk_74;
/* 0x0074 */ Vec3f eyeNext;
/* 0x0080 */ Vec3f unk_80;
/* 0x008C */ struct GlobalContext* globalCtx;
/* 0x0090 */ Player* player;
/* 0x0094 */ PosRot unk_94;
/* 0x00A8 */ Vec3f* unk_A8;
/* 0x00AC */ Vec3f unk_AC;
/* 0x00B8 */ char unk_B8[8];
/* 0x00C0 */ Vec3f unk_C0;
/* 0x00CC */ Vec3f unk_CC;
/* 0x0094 */ PosRot playerPosRot;
/* 0x00A8 */ Actor* target;
/* 0x00AC */ PosRot targetPosRot;
/* 0x00C0 */ Vec3f unk_C0; // has to do with how quickly the camera rotates link.
/* 0x00CC */ Vec3f unk_CC; // has to do with how quickly the camera zooms
/* 0x00D8 */ f32 unk_D8;
/* 0x00DC */ f32 unk_DC; // possibly a Vec3f
/* 0x00DC */ f32 dist; // possibly a Vec3f
/* 0x00E0 */ f32 unk_E0;
/* 0x00E4 */ Vec3f unk_E4;
/* 0x00F0 */ char unk_F0[0x0C];
/* 0x00FC */ f32 unk_FC;
/* 0x0100 */ f32 unk_100;
/* 0x00F0 */ Vec3f unk_F0;
/* 0x00FC */ f32 fov;
/* 0x0100 */ f32 unk_100; // update rate of distance from link?
/* 0x0104 */ f32 unk_104;
/* 0x0108 */ Vec3f unk_108;
/* 0x0114 */ char unk_114[0x10];
/* 0x0124 */ s32 unk_124;
/* 0x0128 */ s32 unk_128;
/* 0x012C */ s16 unk_12C;
/* 0x0114 */ char unk_114[0x4];
/* 0x0118 */ s32 unk_118;
/* 0x011C */ s32 unk_11C;
/* 0x0120 */ char unk_120[0x4];
/* 0x0124 */ CutsceneCameraPoint* atPoints;
/* 0x0128 */ CutsceneCameraPoint* eyePoints;
/* 0x012C */ s16 relativeToPlayer; // camera Cutscene points are relative to player's position
/* 0x012E */ s16 unk_12E;
/* 0x0130 */ s16 uid; // Unique identifier of the camera.
/* 0x0132 */ char unk_132[0x02];
/* 0x0134 */ Vec3s unk_134;
/* 0x013A */ Vec3s unk_13A;
/* 0x013A */ Vec3s unk_13A; // seems to be a copy of unk_134, but unused for anything different?
/* 0x0140 */ s16 status;
/* 0x0142 */ s16 unk_142; // related to door camera (see func_8005AD40)
/* 0x0144 */ s16 unk_144;
/* 0x0142 */ s16 setting; // referred to as set
/* 0x0144 */ s16 mode;
/* 0x0146 */ s16 unk_146; // unknown if used
/* 0x0148 */ s16 unk_148; // ID for door camera? (see func_8005AD40)
/* 0x014A */ s16 unk_14A; // unknown if used
@@ -440,12 +514,12 @@ typedef struct {
/* 0x014E */ s16 unk_14E;
/* 0x0150 */ s16 unk_150; // unknown if used
/* 0x0152 */ s16 unk_152;
/* 0x0154 */ u16 unk_154;
/* 0x0154 */ u16 unk_154; // appears to be some clone of setting?
/* 0x0156 */ s16 unk_156;
/* 0x0158 */ s16 unk_158; // unknown if used
/* 0x015E */ s16 unk_15A;
/* 0x015E */ s16 unk_15C; // unknown if used
/* 0x015E */ u16 unk_15E;
/* 0x015A */ s16 roll;
/* 0x015C */ s16 unk_15C; // unknown if used
/* 0x015E */ s16 unk_15E;
/* 0x0160 */ s16 unk_160;
/* 0x0162 */ s16 unk_162;
/* 0x0164 */ s16 unk_164;
@@ -454,6 +528,38 @@ typedef struct {
/* 0x016A */ s16 unk_16A; // unknown if used
} Camera; // size = 0x16C
typedef struct {
s32 unk_00;
char unk_04[0x30];
s32 unk_34;
s32 unk_38;
s32 unk_3C;
s32 unk_40;
s32 unk_44;
f32 unk_48;
s16 unk_4C;
f32 unk_50;
char unk_54[0x18];
f32 unk_6C;
f32 unk_70;
f32 unk_74;
s16 unk_78;
s16 unk_7A;
s16 unk_7C;
s16 unk_7E;
s16 unk_80;
s16 unk_82;
s16 unk_84;
s16 unk_86;
char unk_88[0x1038];
s16 unk_10C0;
s16 unk_10C2;
s16 unk_10C4;
s16 unk_10C6;
s16 unk_10C8;
s16 unk_10CA;
} DbgCamera; // size = 0x10CC;
typedef struct {
/* 0x00 */ u8 musicSeq;
/* 0x01 */ u8 nighttimeSFX;