diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2023-08-14 18:35:04 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-14 15:35:04 -0700 |
| commit | f19df74c6ee597f01c3d7def1fdef105d9bdef92 (patch) | |
| tree | 0e9eef519791ed6612c05295a4e077f7667da199 /include | |
| parent | bdb8ef6d5b33c24580d7861c4ccf8d937caac8fb (diff) | |
`m_actor.c` with 1 NON_MATCHING (#49)
* C file
* drafts
* Actor_info_ct and Actor_info_dt
* Actor_info_make_actor draft
* new_var = &argC;
* func_80057940_jp
* Actor_free_overlay_area, actor_free_check, Actor_get_overlay_area, func_80057940_jp, Actor_data_bank_regist_check
* Shape_Info_init
* Actor struct's size confirmed, Actor_malloc_actor_class and Actor_init_actor_class
* func_80056380_jp, Actor_info_part_new, restore_fgdata, Actor_info_delete
* Actor_info_draw_actor
* Actor_data_bank_dma_end_check, Actor_draw_actor_no_culling_check, Actor_draw_actor_no_culling_check2, Actor_cull_check, Actor_delete_check, Actor_info_make_child_actor, restore_fgdata_all, Actor_info_save_actor
* gSegments
* Actor_world_to_eye, Actor_position_speed_set, Actor_position_moveF and func_80057B70_jp
* Actor_player_look_direction_check
* Actor_position_move
* find m_kankyo file split
* Actor_ct
* fgName
* projection_pos_set, Actor_display_position_set
* Actor_info_call_actor
* func_80057A8C_jp
* import data and bss
* cleanups
* more cleanup
* format
* and even more cleanup
* hilite funcs
* Part_Break_init
* and more cleanup
* Actor_draw
* fake stuff
* Part_Break stuff from OoT
* a
* fix
* fix fake symbol
* fix
* fix
Diffstat (limited to 'include')
| -rw-r--r-- | include/6BA500.h | 54 | ||||
| -rw-r--r-- | include/6D2720.h | 2 | ||||
| -rw-r--r-- | include/6E9650.h | 17 | ||||
| -rw-r--r-- | include/6F5550.h | 2 | ||||
| -rw-r--r-- | include/code_variables.h | 16 | ||||
| -rw-r--r-- | include/fault.h | 2 | ||||
| -rw-r--r-- | include/game.h | 4 | ||||
| -rw-r--r-- | include/gfx.h | 4 | ||||
| -rw-r--r-- | include/libc/math.h | 6 | ||||
| -rw-r--r-- | include/loadfragment.h | 3 | ||||
| -rw-r--r-- | include/m_actor.h | 315 | ||||
| -rw-r--r-- | include/m_collision_bg.h | 3 | ||||
| -rw-r--r-- | include/m_collision_obj.h (renamed from include/69A7E0.h) | 19 | ||||
| -rw-r--r-- | include/m_common_data.h | 71 | ||||
| -rw-r--r-- | include/m_event.h | 2 | ||||
| -rw-r--r-- | include/m_field_info.h | 12 | ||||
| -rw-r--r-- | include/m_kankyo.h | 77 | ||||
| -rw-r--r-- | include/m_lib.h | 11 | ||||
| -rw-r--r-- | include/m_lights.h | 23 | ||||
| -rw-r--r-- | include/m_npc.h | 11 | ||||
| -rw-r--r-- | include/m_play.h | 11 | ||||
| -rw-r--r-- | include/m_player_lib.h | 6 | ||||
| -rw-r--r-- | include/m_scene.h | 14 | ||||
| -rw-r--r-- | include/m_skin_matrix.h | 2 | ||||
| -rw-r--r-- | include/macros.h | 5 | ||||
| -rw-r--r-- | include/ovlmgr.h | 5 | ||||
| -rw-r--r-- | include/unknown_structs.h | 18 | ||||
| -rw-r--r-- | include/z64math.h | 7 | ||||
| -rw-r--r-- | include/z_std_dma.h | 2 |
29 files changed, 543 insertions, 181 deletions
diff --git a/include/6BA500.h b/include/6BA500.h index 88e1b17..e6c00ba 100644 --- a/include/6BA500.h +++ b/include/6BA500.h @@ -9,59 +9,5 @@ // void func_80096B4C_jp(); // void func_80096B64_jp(); // void func_80096BF0_jp(); -// void func_80096C90_jp(); -// void func_80096CA0_jp(); -// void func_80096CDC_jp(); -// void func_80096D60_jp(); -// void func_80096F5C_jp(); -// void func_80097048_jp(); -// void func_800970D4_jp(); -// void func_80097108_jp(); -// void func_800971B4_jp(); -// void func_80097510_jp(); -// void func_800976BC_jp(); -// void func_80097738_jp(); -// void func_800978EC_jp(); -// void func_80097AE8_jp(); -// void func_80097BB0_jp(); -// void func_80097C54_jp(); -// void func_80097D40_jp(); -// void func_80097F88_jp(); -// void func_80097FB4_jp(); -// void func_8009802C_jp(); -// void func_800980C0_jp(); -// void func_80098158_jp(); -// void func_800981B8_jp(); -// void func_8009836C_jp(); -// void func_800983F0_jp(); -// void func_800984CC_jp(); -// void func_80098558_jp(); -// void func_8009867C_jp(); -// void func_80098794_jp(); -// void func_8009895C_jp(); -// void func_80098980_jp(); -// void func_80098990_jp(); -// void func_80098A90_jp(); -// void func_80098B50_jp(); -// void func_80098CCC_jp(); -// void func_80098D88_jp(); -// void func_80098DE0_jp(); -// void func_80098EE4_jp(); -// void func_80098F68_jp(); -// void func_80098FF0_jp(); -// void func_800990A8_jp(); -// void func_8009915C_jp(); -// void func_800991EC_jp(); -// void func_800992C8_jp(); -// void func_80099378_jp(); -// void func_8009944C_jp(); -// void func_8009949C_jp(); -// void func_80099594_jp(); -// void func_800996CC_jp(); -// void mEnv_GetShadowPrimColor_Light(); -// void func_80099718_jp(); -// void func_80099728_jp(); -// void func_80099770_jp(); -// void func_800998AC_jp(); #endif diff --git a/include/6D2720.h b/include/6D2720.h index 7007c19..f271c77 100644 --- a/include/6D2720.h +++ b/include/6D2720.h @@ -8,7 +8,7 @@ // void func_800AEB9C_jp(); // void func_800AEBC8_jp(); // void func_800AEC74_jp(); -// void func_800AED08_jp(); +// void mNPS_schedule_manager(); // void func_800AED68_jp(); // void func_800AEDD0_jp(); // void func_800AEE38_jp(); diff --git a/include/6E9650.h b/include/6E9650.h index df21faa..86db5f5 100644 --- a/include/6E9650.h +++ b/include/6E9650.h @@ -3,6 +3,9 @@ #include "ultra64.h" +struct PlayState; +struct PlayState_unk_0110; + // void func_800C59B0_jp(); // void func_800C5A08_jp(); // void func_800C5A60_jp(); @@ -17,21 +20,21 @@ // void func_800C5EA0_jp(); // void func_800C5F0C_jp(); // void func_800C5F64_jp(); -// void mSc_bank_regist_check(); -// void func_800C6144_jp(); -// void mSc_regist_initial_exchange_bank(); +s32 mSc_bank_regist_check(struct PlayState_unk_0110* arg0, s16 arg1); +void func_800C6144_jp(struct PlayState_unk_0110* arg0, s16 arg1); +void mSc_regist_initial_exchange_bank(struct PlayState* play); // void func_800C62C4_jp(); // void func_800C639C_jp(); -// void func_800C65E4_jp(); -// void func_800C6678_jp(); +// void mSc_data_bank_ct(); +// void mSc_decide_exchange_bank(); // void func_800C6690_jp(); -// void func_800C68C8_jp(); +// void Scene_ct(); // void func_800C6960_jp(); // void func_800C69F4_jp(); // void func_800C6A28_jp(); // void func_800C6A5C_jp(); // void func_800C6A90_jp(); -// void func_800C6AC4_jp(); +// void Door_info_ct(); // void func_800C6AD0_jp(); // void func_800C6AE0_jp(); // void func_800C6B50_jp(); diff --git a/include/6F5550.h b/include/6F5550.h index 4572163..8ab3fd3 100644 --- a/include/6F5550.h +++ b/include/6F5550.h @@ -65,7 +65,7 @@ // void func_800D2334_jp(); // void func_800D2354_jp(); // void func_800D2360_jp(); -// void func_800D236C_jp(); +// void sAdo_RoomType(); // void func_800D2394_jp(); // void func_800D23B4_jp(); // void func_800D2438_jp(); diff --git a/include/code_variables.h b/include/code_variables.h index 7f866c7..246c9bd 100644 --- a/include/code_variables.h +++ b/include/code_variables.h @@ -3,6 +3,7 @@ #include "ultra64.h" #include "unknown_structs.h" +#include "z64math.h" @@ -14,7 +15,6 @@ // extern UNK_TYPE D_80100C60_jp; // extern UNK_TYPE D_80100C64_jp; // extern UNK_TYPE D_80100C68_jp; -// extern UNK_TYPE D_80100C70_jp; // extern UNK_TYPE D_801025C0_jp; // extern UNK_TYPE D_FLT_801025C8_jp; @@ -827,7 +827,7 @@ extern vs32 D_8010EFB0_jp; // TODO: Determine where this goes // extern UNK_TYPE D_8010F4C0_jp; // extern UNK_TYPE D_8010FCC0_jp; // extern UNK_TYPE D_8010FCD0_jp; -// extern UNK_TYPE MtxF_clear; +extern MtxF MtxF_clear; // extern UNK_TYPE D_8010FD50_jp; // extern UNK_TYPE D_8010FD54_jp; // extern UNK_TYPE D_8010FD58_jp; @@ -1724,7 +1724,6 @@ extern s32 zurumode_flag; // extern UNK_TYPE B_8011B830_jp; // extern UNK_TYPE B_8011B83C_jp; -// extern UNK_TYPE B_8011B850_jp; // extern UNK_TYPE B_8011B8B0_jp; // extern UNK_TYPE B_8011B8B4_jp; @@ -1828,8 +1827,6 @@ extern s32 zurumode_flag; // extern UNK_TYPE B_80126E74_jp; // extern UNK_TYPE B_80126E9C_jp; -// extern UNK_TYPE common_data; - // extern UNK_TYPE B_80137960_jp; // extern UNK_TYPE B_80137C40_jp; // extern UNK_TYPE B_80137C48_jp; @@ -2010,12 +2007,9 @@ extern s32 zurumode_flag; // extern UNK_TYPE B_80145880_jp; // extern UNK_TYPE B_80145898_jp; // extern UNK_TYPE B_8014589C_jp; -// extern UNK_TYPE B_801458A0_jp; -// extern UNK_TYPE B_801458B0_jp; -// extern UNK_TYPE B_801458B8_jp; -// extern UNK_TYPE B_801458E0_jp; -// extern UNK_TYPE B_801458EC_jp; -// extern UNK_TYPE B_801458F0_jp; + +extern uintptr_t gSegments[NUM_SEGMENTS]; + // extern UNK_TYPE B_80145D70_jp; // extern UNK_TYPE B_80145D80_jp; // extern UNK_TYPE B_80145DB8_jp; diff --git a/include/fault.h b/include/fault.h index b11f03c..b24f732 100644 --- a/include/fault.h +++ b/include/fault.h @@ -78,7 +78,7 @@ NORETURN void Fault_AddHungupAndCrashImpl(const char* exp1, const char* exp2); // void FaultDrawer_SetBackColor(); void FaultDrawer_SetFontColor(u16 color); void FaultDrawer_SetCharPad(s8 padW, s8 padH); -// void FaultDrawer_SetCursor(); +void FaultDrawer_SetCursor(s32 arg0, s32 arg1); // void FaultDrawer_FillScreen(); // void FaultDrawer_PrintCallback(); // void FaultDrawer_VPrintf(); diff --git a/include/game.h b/include/game.h index 4ffa403..46edae3 100644 --- a/include/game.h +++ b/include/game.h @@ -53,7 +53,9 @@ typedef struct GameState { /* 0x74 */ s32 unk_74; /* 0x78 */ TwoHeadArena heap; /* 0x88 */ GameAlloc alloc; - /* 0x9C */ UNK_TYPE1 unk_9C[0x3]; + /* 0x9C */ u8 unk_9C; + /* 0x9D */ u8 unk_9D; + /* 0x9E */ UNK_TYPE1 unk_9E[0x1]; /* 0x9F */ u8 running; /* 0xA0 */ s32 unk_A0; /* 0xA4 */ UNK_TYPE1 unk_A4[0x4]; diff --git a/include/gfx.h b/include/gfx.h index 3d693fe..bda4a82 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -20,7 +20,7 @@ typedef struct GraphicsContext { /* 0x2A0 */ TwoHeadGfxArena polyXlu; /* 0x2B0 */ TwoHeadGfxArena unk_2B0; /* 0x2C0 */ TwoHeadGfxArena unk_2C0; - /* 0x2D0 */ TwoHeadGfxArena unk_2D0; + /* 0x2D0 */ TwoHeadGfxArena light; /* 0x2E0 */ UNK_TYPE1 unk_2E0[0x4]; /* 0x2E4 */ s32 unk_2E4; /* 0x2E8 */ UNK_TYPE1 unk_2E8[0x4]; @@ -39,7 +39,7 @@ typedef struct GraphicsContext { #define POLY_XLU_DISP __gfxCtx->polyXlu.p #define UNK_2B0_DISP __gfxCtx->unk_2B0.p #define UNK_2C0_DISP __gfxCtx->unk_2C0.p -#define UNK_2D0_DISP __gfxCtx->unk_2D0.p +#define LIGHT_DISP __gfxCtx->light.p // __gfxCtx shouldn't be used directly. // Use the DISP macros defined above when writing to display buffers. diff --git a/include/libc/math.h b/include/libc/math.h index 3258a1c..0098d3a 100644 --- a/include/libc/math.h +++ b/include/libc/math.h @@ -1,7 +1,11 @@ #ifndef MATH_H
#define MATH_H
-#include "PR/ultratypes.h"
+#define M_SQRT2 1.41421356237309504880f
+#define M_SQRT1_2 0.70710678118654752440f /* 1/sqrt(2) */
+#define FLT_MAX 340282346638528859811704183484516925440.0f
+#define SHT_MAX 32767.0f
+#define SHT_MINV (1.0f / SHT_MAX)
float fabsf(float f);
#pragma intrinsic(fabsf)
diff --git a/include/loadfragment.h b/include/loadfragment.h index 37a747c..487f042 100644 --- a/include/loadfragment.h +++ b/include/loadfragment.h @@ -2,6 +2,7 @@ #define LOADFRAGMENT_H #include "ultra64.h" +#include "other_types.h" extern s32 gOverlayLogSeverity; @@ -33,6 +34,6 @@ typedef struct OverlayRelocationSection { /* 0x14 */ u32 relocations[1]; // size is nRelocations } OverlayRelocationSection; // size >= 0x18 -s32 Overlay_Load(void *vromStart, void *vromEnd, void *ovlStart, void *ovlEnd, void *vramStart, void *vramEnd, void *allocatedRamAddr, OverlayRelocationSection *ovlRelocs); +s32 Overlay_Load(RomOffset vromStart, RomOffset vromEnd, void *ovlStart, void *ovlEnd, void *vramStart, void *vramEnd, void *allocatedRamAddr, OverlayRelocationSection *ovlRelocs); #endif diff --git a/include/m_actor.h b/include/m_actor.h index 6f53ec2..2bcf1a6 100644 --- a/include/m_actor.h +++ b/include/m_actor.h @@ -2,63 +2,270 @@ #define M_ACTOR_H #include "ultra64.h" +#include "m_collision_obj.h" +#include "z64math.h" +#include "unk.h" + +struct Actor; +struct PlayState; +struct ActorEntry; +struct ActorOverlay; +struct struct_801161E8_jp; +struct Lights; +struct GraphicsContext; typedef enum AllocType { - /* 0 */ ALLOCTYPE_NORMAL + /* 0 */ ALLOCTYPE_NORMAL, + /* 1 */ ALLOCTYPE_ABSOLUTE, + /* 2 */ ALLOCTYPE_PERMANENT } AllocType; -// void func_80056380_jp(); -// void projection_pos_set(); -// void Actor_world_to_eye(); -// void Actor_position_move(); -// void Actor_position_speed_set(); -// void Actor_position_moveF(); -// void Actor_player_look_direction_check(); -// void Actor_display_position_set(); -// void Actor_data_bank_dma_end_check(); -// void Shape_Info_init(); -// void Actor_foot_shadow_pos_set(); -// void Actor_delete(); -// void Actor_ct(); -// void Actor_dt(); -// void Actor_draw(); -// void Actor_draw_actor_no_culling_check(); -// void Actor_draw_actor_no_culling_check2(); -// void Actor_cull_check(); -// void Actor_delete_check(); -// void Actor_info_ct(); -// void Actor_info_dt(); -// void Actor_info_call_actor(); -// void Actor_info_draw_actor(); -// void Actor_info_part_new(); -// void Actor_info_part_delete(); -// void Actor_free_overlay_area(); -// void actor_free_check(); -// void Actor_get_overlay_area(); -// void func_80057940_jp(); -// void func_80057A8C_jp(); -// void func_80057B70_jp(); -// void Actor_data_bank_regist_check(); -// void Actor_malloc_actor_class(); -// void Actor_init_actor_class(); -// void Actor_info_make_actor(); -// void Actor_info_make_child_actor(); -// void restore_fgdata(); -// void restore_fgdata_one(); -// void restore_fgdata_all(); -// void Actor_info_save_actor(); -// void Actor_info_delete(); -// void Actor_info_name_search_sub(); -// void Actor_info_name_search(); -// void Actor_info_fgName_search_sub(); -// void Actor_info_fgName_search(); -// void Part_Break_init(); -// void HiliteReflect_new(); -// void HiliteReflect_init(); -// void HiliteReflect_xlu_init(); -// void HiliteReflect_light_init(); -// void Setpos_HiliteReflect_init(); -// void Setpos_HiliteReflect_xlu_init(); -// void Setpos_HiliteReflect_light_init(); +typedef enum ActorPart { + /* 0 */ ACTOR_PART_0, + /* 1 */ ACTOR_PART_1, + /* 2 */ ACTOR_PART_PLAYER, + /* 3 */ ACTOR_PART_NPC, + /* 4 */ ACTOR_PART_4, + /* 5 */ ACTOR_PART_5, + /* 6 */ ACTOR_PART_6, + /* 7 */ ACTOR_PART_7, + /* 8 */ ACTOR_PART_MAX +} ActorPart; + +typedef enum ActorFootIndex { + /* 0 */ FOOT_LEFT, + /* 1 */ FOOT_RIGHT, + /* 2 */ FOOT_MAX +} ActorFootIndex; + +// TODO: figure out if those values make sense as an enum or if they should be changed to defines +typedef enum FgNameF000 { + /* 0x0 */ FGNAME_F000_0 = 0x0, + /* 0x5 */ FGNAME_F000_5 = 0x5, + /* 0x8 */ FGNAME_F000_8 = 0x8, + /* 0xD */ FGNAME_F000_D = 0xD, + /* 0xE */ FGNAME_F000_E +} FgNameF000; + +typedef void (*ActorFunc)(struct Actor* this, struct PlayState* play); + +// a.k.a. ActorInit +typedef struct ActorProfile { + /* 0x00 */ s16 name; + /* 0x02 */ u8 part; + /* 0x04 */ u32 flags; + /* 0x08 */ s16 unk_08; + /* 0x0A */ s16 objectId; + /* 0x0C */ size_t instanceSize; + /* 0x10 */ ActorFunc ct; + /* 0x14 */ ActorFunc dt; + /* 0x18 */ ActorFunc update; + /* 0x1C */ ActorFunc draw; + /* 0x20 */ ActorFunc save; +} ActorProfile; // size = 0x24 + +typedef struct PosRot { + /* 0x00 */ Vec3f pos; + /* 0x0C */ Vec3s rot; +} PosRot; // size = 0x14 + +typedef void (*Shape_Info_unk_0C)(struct Actor*, struct Lights*, struct PlayState*); + +typedef struct Shape_Info { + /* 0x00 */ Vec3s rot; + /* 0x08 */ f32 unk_08; + /* 0x0C */ Shape_Info_unk_0C unk_0C; + /* 0x10 */ f32 unk_10; + /* 0x14 */ f32 unk_14; + /* 0x18 */ f32 unk_18; + /* 0x1C */ f32 unk_1C; + /* 0x20 */ s32 unk_20; + /* 0x24 */ Vec3f* unk_24; // maybe PosRot* + /* 0x28 */ s32 unk_28; + /* 0x2C */ s8 unk_2C; + /* 0x2D */ s8 unk_2D; + /* 0x2E */ s8 unk_2E; + /* 0x2F */ UNK_TYPE1 unk_2F[0x1]; + /* 0x30 */ Vec3f feetPos[FOOT_MAX]; +} Shape_Info; // size = 0x48 + +typedef struct Actor { + /* 0x000 */ s16 name; // id + /* 0x002 */ u8 part; // category + /* 0x003 */ u8 unk_003; // If set to 1 then fgdata will be restored independently of the actor's part + /* 0x004 */ u16 unk_004; + /* 0x006 */ u16 fgName; + /* 0x008 */ s8 unk_008; + /* 0x008 */ s8 unk_009; + /* 0x008 */ s16 unk_00A; + /* 0x00C */ PosRot home; + /* 0x020 */ u32 flags; + /* 0x024 */ s16 params; + /* 0x026 */ s16 unk_026; // objBankIndex + /* 0x028 */ PosRot world; + /* 0x03C */ Vec3f prevPos; + /* 0x048 */ PosRot eye; // focus + /* 0x05C */ Vec3f scale; + /* 0x068 */ Vec3f velocity; + /* 0x074 */ f32 speed; + /* 0x078 */ f32 gravity; + /* 0x07C */ f32 terminalVelocity; + /* 0x080 */ UNK_TYPE1 unk_080[0x34]; + /* 0x0B4 */ UNK_TYPE1 unk_0B4[0x1]; + /* 0x0B5 */ u8 isDrawn; + /* 0x0B6 */ s16 yawTowardsPlayer; + /* 0x0B8 */ f32 xyzDistToPlayerSq; + /* 0x0BC */ f32 xzDistToPlayer; + /* 0x0C0 */ f32 playerHeightRel; + /* 0x0C4 */ CollisionCheck_Status colStatus; // made-up name + /* 0x0DC */ Shape_Info shape; + /* 0x124 */ Vec3f projectedPos; + /* 0x130 */ f32 projectedW; + /* 0x134 */ f32 uncullZoneScale; + /* 0x138 */ f32 uncullZoneDownward; + /* 0x13C */ f32 unk_13C; + /* 0x140 */ f32 unk_140; + /* 0x144 */ f32 unk_144; + /* 0x148 */ u8 unk_148; + /* 0x149 */ u8 unk_149; + /* 0x14A */ UNK_TYPE1 unk_14A[0x2]; + /* 0x14C */ struct Actor* parent; + /* 0x150 */ struct Actor* child; + /* 0x154 */ struct Actor* prev; + /* 0x158 */ struct Actor* next; + /* 0x15C */ ActorFunc ct; + /* 0x160 */ ActorFunc dt; + /* 0x164 */ ActorFunc update; + /* 0x168 */ ActorFunc draw; + /* 0x16C */ ActorFunc save; + /* 0x170 */ struct ActorOverlay* overlayEntry; +} Actor; // size = 0x174 + +// Guessed from OoT's BodyBreak +typedef struct Part_Break { + /* 0x00 */ MtxF* matrices; + /* 0x04 */ s16* objectIds; + /* 0x08 */ s16 count; + /* 0x0C */ Gfx** dLists; + /* 0x10 */ s32 val; + /* 0x14 */ s32 prevLimbIndex; +} Part_Break; // size = 0x18 + +typedef struct ActorListEntry { + /* 0x0 */ s32 unk_0; + /* 0x4 */ Actor* head; +} ActorListEntry; // size = 0x8 + +// a.k.a. ActorContext +typedef struct ActorInfo { + /* 0x00 */ s32 unk_00; + /* 0x00 */ ActorListEntry actorLists[ACTOR_PART_MAX]; +} ActorInfo; // size = 0x44 + +// +#define ACTOR_FLAG_1 (1 << 0) +// +#define ACTOR_FLAG_2 (1 << 1) +// +#define ACTOR_FLAG_4 (1 << 2) +// +#define ACTOR_FLAG_8 (1 << 3) +// +#define ACTOR_FLAG_10 (1 << 4) +// +#define ACTOR_FLAG_20 (1 << 5) +// +#define ACTOR_FLAG_40 (1 << 6) +// +#define ACTOR_FLAG_80 (1 << 7) +// +#define ACTOR_FLAG_100 (1 << 8) +// +#define ACTOR_FLAG_200 (1 << 9) +// +#define ACTOR_FLAG_400 (1 << 10) +// +#define ACTOR_FLAG_800 (1 << 11) +// +#define ACTOR_FLAG_1000 (1 << 12) +// +#define ACTOR_FLAG_2000 (1 << 13) +// +#define ACTOR_FLAG_4000 (1 << 14) +// +#define ACTOR_FLAG_8000 (1 << 15) +// +#define ACTOR_FLAG_10000 (1 << 16) +// +#define ACTOR_FLAG_20000 (1 << 17) +// +#define ACTOR_FLAG_40000 (1 << 18) +// +#define ACTOR_FLAG_80000 (1 << 19) +// +#define ACTOR_FLAG_100000 (1 << 20) +// +#define ACTOR_FLAG_200000 (1 << 21) +// +#define ACTOR_FLAG_400000 (1 << 22) +// +#define ACTOR_FLAG_800000 (1 << 23) +// +#define ACTOR_FLAG_1000000 (1 << 24) +// +#define ACTOR_FLAG_2000000 (1 << 25) +// +#define ACTOR_FLAG_4000000 (1 << 26) +// +#define ACTOR_FLAG_8000000 (1 << 27) +// +#define ACTOR_FLAG_10000000 (1 << 28) +// +#define ACTOR_FLAG_20000000 (1 << 29) +// +#define ACTOR_FLAG_40000000 (1 << 30) +// +#define ACTOR_FLAG_80000000 (1 << 31) + +#define ACTOR_FGNAME_GET_F000(fgName) (((fgName) & 0xF000) >> 12) + +void projection_pos_set(struct PlayState* play, Vec3f* worldPos, Vec3f* projectedPos, f32* invW); +void Actor_world_to_eye(Actor* actor, f32 arg1); +void Actor_position_move(Actor* actor); +void Actor_position_speed_set(Actor* actor); +void Actor_position_moveF(Actor* actor); +s32 Actor_player_look_direction_check(Actor* actor, s16 maxAngleDiff, struct PlayState* play); +void Actor_display_position_set(struct PlayState* play, Actor* actor, s16* x, s16* y); +void Shape_Info_init(Actor* actor, f32 arg1, Shape_Info_unk_0C arg2, f32 arg3, f32 arg4); +void Actor_foot_shadow_pos_set(Actor* actor, s32 limbIndex, s32 leftFootIndex, Vec3f* leftFootPos, s32 rightFootIndex, Vec3f* rightFootPos); +void Actor_delete(Actor* actor); +s32 Actor_draw_actor_no_culling_check(Actor* actor); +s32 Actor_draw_actor_no_culling_check2(Actor* actor, Vec3f* arg1, f32 arg2); +void Actor_cull_check(Actor* actor); +void Actor_delete_check(Actor* actor, struct PlayState* play); +void Actor_info_ct(struct PlayState* play2, ActorInfo* actorInfo, struct ActorEntry* actorEntry); +void Actor_info_dt(ActorInfo* actorInfo, struct PlayState* play); +void Actor_info_call_actor(struct PlayState* play, ActorInfo* actorInfo); +void Actor_info_draw_actor(struct PlayState* play, ActorInfo* actorInfo); +void Actor_free_overlay_area(struct ActorOverlay* overlayEntry); +void Actor_get_overlay_area(struct ActorOverlay* overlayEntry, const struct struct_801161E8_jp* arg1, size_t overlaySize); +void Actor_init_actor_class(Actor* actor, ActorProfile* profile, struct ActorOverlay* overlayEntry, struct PlayState* play, s32 arg4, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s8 argB, s8 argC, s16 argD, u16 fgName, s16 params); +Actor* Actor_info_make_actor(ActorInfo* actorInfo, struct PlayState* play, s16 actorId, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s8 arg9, s8 argA, s16 argB, u16 fgName, s16 params, s8 argE, s32 argF); +Actor* Actor_info_make_child_actor(ActorInfo* actorInfo, Actor* arg1, struct PlayState* play, s16 actorId, f32 x, f32 y, f32 z, s16 rotX, s16 rotY, s16 rotZ, s16 argA, u16 fgName, s16 params, s32 argD); +void restore_fgdata(Actor* actor, struct PlayState* play); +void restore_fgdata_one(Actor* actor, struct PlayState* play); +void restore_fgdata_all(struct PlayState* play); +void Actor_info_save_actor(struct PlayState* play); +Actor* Actor_info_delete(ActorInfo* actorInfo, Actor* actor, struct PlayState* play); +Actor* Actor_info_name_search(ActorInfo* actorInfo, s16 name, ActorPart part); +Actor* Actor_info_fgName_search(ActorInfo* actorInfo, u16 fgName, ActorPart part); +void Part_Break_init(Part_Break* partBreak, s32 count, UNK_TYPE arg2); +Gfx* HiliteReflect_new(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx, Gfx* gfx, Hilite** hilite); +Hilite* HiliteReflect_init(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx); +Hilite* HiliteReflect_xlu_init(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx); +Hilite* HiliteReflect_light_init(Vec3f* object, Vec3f* eye, Vec3f* lightDir, struct GraphicsContext* gfxCtx); +Hilite* Setpos_HiliteReflect_init(Vec3f* object, struct PlayState* play); +Hilite* Setpos_HiliteReflect_xlu_init(Vec3f* object, struct PlayState* play); +Hilite* Setpos_HiliteReflect_light_init(Vec3f* object, struct PlayState* play); #endif diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h index 79aed29..d7bdf4d 100644 --- a/include/m_collision_bg.h +++ b/include/m_collision_bg.h @@ -2,6 +2,7 @@ #define M_COLLISION_BG_H #include "ultra64.h" +#include "z64math.h" // void func_80067430_jp(); // void func_800674B0_jp(); @@ -169,7 +170,7 @@ // void func_80071884_jp(); // void func_80071A08_jp(); // void func_80071AB8_jp(); -// void mCoBG_GetBgY_OnlyCenter_FromWpos2(); +f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(Vec3f arg0, f32 arg1); // void func_80071C1C_jp(); // void func_80071DB4_jp(); // void func_800721C8_jp(); diff --git a/include/69A7E0.h b/include/m_collision_obj.h index f3041cf..e4335e2 100644 --- a/include/69A7E0.h +++ b/include/m_collision_obj.h @@ -1,7 +1,16 @@ -#ifndef C_69A7E0_H -#define C_69A7E0_H +#ifndef M_COLLISION_OBJ_H +#define M_COLLISION_OBJ_H #include "ultra64.h" +#include "z64math.h" +#include "unk.h" + + +typedef struct CollisionCheck_Status { + /* 0x00 */ Vec3f displacement; + /* 0x0C */ UNK_TYPE1 unk_0C[0xC]; +} CollisionCheck_Status; // size >= 0x18 + // void func_80076B40_jp(); // void func_80076BA4_jp(); @@ -62,9 +71,9 @@ // void func_8007872C_jp(); // void func_80078748_jp(); // void func_800787E8_jp(); -// void CollisionCheck_Status_ct(); -// void CollisionCheck_Status_Clear(); -// void func_80078948_jp(); +void CollisionCheck_Status_ct(CollisionCheck_Status* status); +void CollisionCheck_Status_Clear(CollisionCheck_Status* status); +// void CollisionCheck_Status_set3(); // void CollisionCheck_Uty_ActorWorldPosSetPipeC(); // void func_800789BC_jp(); diff --git a/include/m_common_data.h b/include/m_common_data.h index 1c74775..719f850 100644 --- a/include/m_common_data.h +++ b/include/m_common_data.h @@ -2,19 +2,78 @@ #define M_COMMON_DATA_H #include "ultra64.h" +#include "unk.h" + +struct Actor; +struct ActorOverlay; +struct struct_801161E8_jp; +struct PlayState_unk_0110; +struct CommonData_unk_1004C_unk_14_arg0; + + +typedef UNK_RET (*CommonData_unk_1004C_unk_04)(struct ActorOverlay*, const struct struct_801161E8_jp*, size_t, s32); +typedef UNK_RET (*CommonData_unk_1004C_unk_08)(void); + +// TODO: figure out if this is a generic memory allocation or if it is Actor specific +typedef UNK_PTR (*CommonData_unk_1004C_unk_0C)(size_t, const struct struct_801161E8_jp*, s32); + +typedef UNK_RET (*CommonData_unk_1004C_unk_10)(struct Actor*); +typedef UNK_RET (*CommonData_unk_1004C_unk_14)(struct CommonData_unk_1004C_unk_14_arg0*, u16); + +typedef UNK_RET (*CommonData_unk_1004C_unk_EC)(struct PlayState_unk_0110*, s16, s16); +typedef UNK_RET (*CommonData_unk_1004C_unk_F0)(struct PlayState_unk_0110*, struct Actor*); +typedef s32 (*CommonData_unk_1004C_unk_F4)(struct PlayState_unk_0110*, struct Actor*); + +typedef struct CommonData_unk_1004C { + /* 0x00 */ UNK_TYPE1 unk_00[0x4]; + /* 0x04 */ CommonData_unk_1004C_unk_04 unk_04; + /* 0x08 */ CommonData_unk_1004C_unk_08 unk_08; + /* 0x0C */ CommonData_unk_1004C_unk_0C unk_0C; + /* 0x10 */ CommonData_unk_1004C_unk_10 unk_10; + /* 0x14 */ CommonData_unk_1004C_unk_14 unk_14; + /* 0x18 */ UNK_TYPE1 unk_18[0xD4]; + /* 0xEC */ CommonData_unk_1004C_unk_EC unk_EC; + /* 0xF0 */ CommonData_unk_1004C_unk_F0 unk_F0; + /* 0xF4 */ CommonData_unk_1004C_unk_F4 unk_F4; +} CommonData_unk_1004C; // size >= 0xF8 + +typedef UNK_RET (*CommonData_unk_10098_unk_4)(struct ActorOverlay*, size_t); +typedef UNK_RET (*CommonData_unk_10098_unk_8)(void); + +// TODO: figure out if this is a generic memory allocation or if it is Actor specific +typedef UNK_PTR (*CommonData_unk_10098_unk_0C)(void); + +typedef UNK_RET (*CommonData_unk_10098_unk_10)(struct Actor*); + +typedef struct CommonData_unk_10098 { + /* 0x00 */ UNK_TYPE1 unk_00[0x4]; + /* 0x04 */ CommonData_unk_10098_unk_4 unk_4; + /* 0x08 */ CommonData_unk_10098_unk_8 unk_08; + /* 0x0C */ CommonData_unk_10098_unk_0C unk_0C; + /* 0x10 */ CommonData_unk_10098_unk_10 unk_10; +} CommonData_unk_10098; // size >= 0x10 + typedef struct CommonData { - /* 0x00000 */ u8 unk_00000[0x10000]; + /* 0x00000 */ UNK_TYPE1 unk_00000[0x10000]; /* 0x10000 */ u8 unk_10000; // named "game_started" in AC GCN decomp - /* 0x10001 */ u8 unk_10001[0x3]; + /* 0x10001 */ UNK_TYPE1 unk_10001[0x3]; /* 0x10004 */ s32 unk_10004; // named "last_scene_no" in AC GCN decomp - /* 0x10008 */ u8 unk_10008[0x143]; + /* 0x10008 */ UNK_TYPE1 unk_10008[0x44]; + /* 0x1004C */ CommonData_unk_1004C *unk_1004C; + /* 0x10050 */ UNK_TYPE1 unk_10050[0x48]; + /* 0x10098 */ CommonData_unk_10098 *unk_10098; + /* 0x1009C */ UNK_TYPE1 unk_1009C[0xAC]; + /* 0x10148 */ UNK_TYPE1 unk_10148[0x3]; /* 0x1014B */ u8 unk_1014B; // named "wipeType" in AC GCN decomp - /* 0x1014C */ u8 unk_1014C[0x66A]; + /* 0x1014C */ UNK_TYPE1 unk_1014C[0x2]; + /* 0x1014E */ s16 unk_1014E; + /* 0x10150 */ UNK_TYPE1 unk_10150[0x664]; + /* 0x107B4 */ UNK_TYPE1 unk_107B4[0x2]; /* 0x107B6 */ s16 unk_107B6; // named "demo_profile" in AC GCN decomp (though it's an array of two s16s in that game) - /* 0x107B8 */ u8 unk_107B8[0x2F8]; + /* 0x107B8 */ UNK_TYPE1 unk_107B8[0x2F8]; /* 0x10AB0 */ u8 unk_10AB0; // named "pad_connected" in AC GCN decomp - /* 0x10AB1 */ u8 unk_10AB1[0x7]; + /* 0x10AB1 */ UNK_TYPE1 unk_10AB1[0x7]; } CommonData; // size = 0x10AB8 void common_data_reinit(void); diff --git a/include/m_event.h b/include/m_event.h index 03a59a1..78de237 100644 --- a/include/m_event.h +++ b/include/m_event.h @@ -31,7 +31,7 @@ // void func_8007D59C_jp(); // void func_8007D5D4_jp(); // void func_8007D650_jp(); -// void mEv_CheckFirstJob(); +s32 mEv_CheckFirstJob(void); // void func_8007D734_jp(); // void func_8007D784_jp(); // void func_8007D7BC_jp(); diff --git a/include/m_field_info.h b/include/m_field_info.h index a007926..bae4419 100644 --- a/include/m_field_info.h +++ b/include/m_field_info.h @@ -2,8 +2,10 @@ #define M_FIELD_INFO_H #include "ultra64.h" +#include "z64math.h" struct CommonData; +struct PlayState; // void func_80087C30_jp(); // void func_80087C40_jp(); @@ -92,7 +94,7 @@ struct CommonData; // void func_8008A74C_jp(); // void func_8008A81C_jp(); // void func_8008A960_jp(); -// void mFI_SetFG_common(); +UNK_TYPE mFI_SetFG_common(u16 fgName, Vec3f arg1, s32 arg2); // void func_8008AA98_jp(); // void func_8008AB14_jp(); // void func_8008AC74_jp(); @@ -109,8 +111,8 @@ struct CommonData; // void func_8008B2D0_jp(); // void func_8008B300_jp(); // void func_8008B318_jp(); -// void mFI_SetBearActor(); -// void func_8008B3E8_jp(); +void mFI_SetBearActor(struct PlayState* play, Vec3f arg1, s32 arg2); +s32 func_8008B3E8_jp(Vec3f* arg0, UNK_TYPE arg1); // void func_8008B4C0_jp(); // void func_8008B598_jp(); // void func_8008B66C_jp(); @@ -187,7 +189,7 @@ struct CommonData; // void func_8008DF04_jp(); // void func_8008E058_jp(); // void func_8008E514_jp(); -// void func_8008E5F4_jp(); +void func_8008E5F4_jp(Vec3f arg0); // void mFI_PrintNowBGNum(); // void mFI_PrintFgAttr(); // void func_8008E8E0_jp(); @@ -205,7 +207,7 @@ struct CommonData; // void func_8008EEE8_jp(); // void func_8008EF0C_jp(); // void mFRm_CheckSaveData(); -void mFRm_ClearSaveCheckData(CommonData* common_data); +void mFRm_ClearSaveCheckData(struct CommonData* common_data); // void func_8008EFDC_jp(); // void func_8008F020_jp(); // void func_8008F040_jp(); diff --git a/include/m_kankyo.h b/include/m_kankyo.h new file mode 100644 index 0000000..490796e --- /dev/null +++ b/include/m_kankyo.h @@ -0,0 +1,77 @@ +#ifndef M_KANKYO_H +#define M_KANKYO_H + +#include "ultra64.h" +#include "unk.h" + +struct Actor; + +typedef void (*Kankyo_unk_C0)(struct Actor*); + +typedef struct Kankyo { + /* 0x00 */ UNK_TYPE1 unk_00[0x2]; + /* 0x02 */ s8 unk_02; + /* 0x03 */ s8 unk_03; + /* 0x04 */ s8 unk_04; + /* 0x05 */ UNK_TYPE1 unk_05[0x3]; + /* 0x08 */ UNK_TYPE1 unk_08[0xB8]; + /* 0xC0 */ Kankyo_unk_C0 unk_C0; + /* 0xC4 */ UNK_TYPE1 unk_C4[0x4]; +} Kankyo; // size = 0xC8 + +// void mEnv_regist_nature(); +// void func_80096CA0_jp(); +// void func_80096CDC_jp(); +// void func_80096D60_jp(); +// void func_80096F5C_jp(); +// void func_80097048_jp(); +// void mEnv_RoomTypeLightSet(); +// void Global_kankyo_ct(); +// void mEnv_MakeShadowInfo(); +// void mEnv_set_time(); +// void func_800976BC_jp(); +// void func_80097738_jp(); +// void func_800978EC_jp(); +// void func_80097AE8_jp(); +// void func_80097BB0_jp(); +// void func_80097C54_jp(); +// void func_80097D40_jp(); +// void func_80097F88_jp(); +// void func_80097FB4_jp(); +// void func_8009802C_jp(); +// void func_800980C0_jp(); +// void func_80098158_jp(); +// void func_800981B8_jp(); +// void func_8009836C_jp(); +// void func_800983F0_jp(); +// void func_800984CC_jp(); +// void func_80098558_jp(); +// void func_8009867C_jp(); +// void func_80098794_jp(); +// void func_8009895C_jp(); +// void func_80098980_jp(); +// void func_80098990_jp(); +// void func_80098A90_jp(); +// void func_80098B50_jp(); +// void func_80098CCC_jp(); +// void func_80098D88_jp(); +// void func_80098DE0_jp(); +// void mEnv_NowWeather(); +// void func_80098F68_jp(); +// void func_80098FF0_jp(); +// void func_800990A8_jp(); +// void func_8009915C_jp(); +// void func_800991EC_jp(); +// void func_800992C8_jp(); +// void func_80099378_jp(); +// void func_8009944C_jp(); +// void func_8009949C_jp(); +// void func_80099594_jp(); +// void func_800996CC_jp(); +// void mEnv_GetShadowPrimColor_Light(); +// void func_80099718_jp(); +// void func_80099728_jp(); +// void mEnv_MakeWindowLightAlpha(); +// void func_800998AC_jp(); + +#endif diff --git a/include/m_lib.h b/include/m_lib.h index 4cc2b2f..3747eca 100644 --- a/include/m_lib.h +++ b/include/m_lib.h @@ -2,15 +2,16 @@ #define M_LIB_H #include "ultra64.h" +#include "z64math.h" // void mem_copy(); -// void mem_clear(); +s32 mem_clear(void* ptr, size_t size, u8 value); // void mem_cmp(); f32 cos_s(s16 angle); f32 sin_s(s16 angle); // void chase_angle(); // void chase_s(); -// void chase_f(); +s32 chase_f(f32* arg0, f32 arg1, f32 arg2); // void chase_angle2(); // void chase_s2(); // void chase_s3(); @@ -20,7 +21,7 @@ f32 sin_s(s16 angle); // void stick_ratio_set(); // void get_random_timer(); // void get_random_pattern_timer(); -// void xyz_t_move(); +void xyz_t_move(Vec3f* dst, Vec3f* src); // void xyz_t_move_s_xyz(); // void xyz_t_add(); // void xyz_t_sub(); @@ -28,9 +29,9 @@ f32 sin_s(s16 angle); // void xyz_t_mult_v(); // void search_position_distance(); // void search_position_distance2(); -// void search_position_distanceXZ(); +f32 search_position_distanceXZ(Vec3f* arg0, Vec3f* arg1); // void search_position_high(); -// void search_position_angleY(); +s16 search_position_angleY(Vec3f* arg0, Vec3f* arg1); // void search_position_angleX(); // void ValueSet_process(); // void ValueSet__s_char(); diff --git a/include/m_lights.h b/include/m_lights.h index edee343..4b71bfa 100644 --- a/include/m_lights.h +++ b/include/m_lights.h @@ -2,6 +2,19 @@ #define M_LIGHTS_H #include "ultra64.h" +#include "z64math.h" +#include "unk.h" + +struct GraphicsContext; +struct PlayState; + +typedef struct Lights { + /* 0x00 */ UNK_TYPE1 unk_00[0x80]; +} Lights; // size = 0x80 + +typedef struct LightContext { + /* 0x0 */ UNK_TYPE4 unk_0; +} LightContext; // size >= 0x4 // void func_8009B1E0_jp(); // void func_8009B23C_jp(); @@ -9,24 +22,24 @@ // void func_8009B308_jp(); // void func_8009B33C_jp(); // void func_8009B394_jp(); -// void LightsN_disp(); +void LightsN_disp(Lights* light, struct GraphicsContext* gfxCtx); // void func_8009B504_jp(); // void func_8009B534_jp(); // void func_8009B72C_jp(); // void func_8009B81C_jp(); -// void func_8009B884_jp(); +void LightsN_list_check(Lights* light, UNK_TYPE4 arg1, Vec3f* arg2); // void func_8009B954_jp(); // void func_8009B9E0_jp(); -// void func_8009BA28_jp(); +// void Global_light_ct(); // void func_8009BA94_jp(); // void func_8009BAC0_jp(); -// void Global_light_read(); +Lights* Global_light_read(LightContext* lightCtx, struct GraphicsContext* gfxCtx); // void func_8009BB34_jp(); // void func_8009BB40_jp(); // void func_8009BB8C_jp(); // void func_8009BBEC_jp(); // void func_8009BC48_jp(); // void func_8009BD90_jp(); -// void Light_list_point_draw(); +void Light_list_point_draw(struct PlayState* play); #endif diff --git a/include/m_npc.h b/include/m_npc.h index 4ef8e81..9e5ece4 100644 --- a/include/m_npc.h +++ b/include/m_npc.h @@ -2,6 +2,15 @@ #define M_NPC_H #include "ultra64.h" +#include "m_actor.h" +#include "unk.h" + +typedef struct Npc { + /* 0x000 */ Actor actor; + /* 0x174 */ UNK_TYPE1 unk_174[0x594]; + /* 0x708 */ s32 unk_708; +} Npc; // size >= 0x70C + // void func_800A6810_jp(); // void func_800A6920_jp(); @@ -117,7 +126,7 @@ // void func_800AB054_jp(); // void func_800AB09C_jp(); // void mNpc_SetNpcList(); -// void mNpc_SetNpcinfo(); +void mNpc_SetNpcinfo(struct Actor* actor, s8 arg1); // void func_800AB498_jp(); // void func_800AB62C_jp(); // void func_800AB6C8_jp(); diff --git a/include/m_play.h b/include/m_play.h deleted file mode 100644 index afae92c..0000000 --- a/include/m_play.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef M_PLAY_H -#define M_PLAY_H - -#include "ultra64.h" -#include "game.h" - -typedef struct PlayState { - /* 0x00000 */ GameState state; -} PlayState; // size = ?? - -#endif diff --git a/include/m_player_lib.h b/include/m_player_lib.h index e205d08..ccbf3e2 100644 --- a/include/m_player_lib.h +++ b/include/m_player_lib.h @@ -3,6 +3,10 @@ #include "ultra64.h" +struct Player; +struct PlayState; + + // void func_800B1160_jp(); // void func_800B11B0_jp(); // void func_800B11F8_jp(); @@ -36,7 +40,7 @@ // void func_800B1B6C_jp(); // void func_800B1BB8_jp(); // void func_800B1BE8_jp(); -// void get_player_actor_withoutCheck(); +struct Player* get_player_actor_withoutCheck(struct PlayState* play); // void func_800B1C90_jp(); // void func_800B1CBC_jp(); // void func_800B1CE0_jp(); diff --git a/include/m_scene.h b/include/m_scene.h new file mode 100644 index 0000000..e0154bc --- /dev/null +++ b/include/m_scene.h @@ -0,0 +1,14 @@ +#ifndef M_SCENE_H +#define M_SCENE_H + +#include "ultra64.h" +#include "z64math.h" + +typedef struct ActorEntry { + /* 0x0 */ s16 id; + /* 0x2 */ Vec3s pos; + /* 0x8 */ Vec3s rot; + /* 0xE */ s16 params; +} ActorEntry; // size = 0x10 + +#endif diff --git a/include/m_skin_matrix.h b/include/m_skin_matrix.h index 5c2c7f6..224a8f5 100644 --- a/include/m_skin_matrix.h +++ b/include/m_skin_matrix.h @@ -4,7 +4,7 @@ #include "ultra64.h" #include "z64math.h" -// void Skin_Matrix_PrjMulVector(); +void Skin_Matrix_PrjMulVector(MtxF* mf, Vec3f* src, Vec3f* xyzDest, f32* wDest); // void Skin_Matrix_MulVector(); void Skin_Matrix_MulMatrix(MtxF* mfB, MtxF* mfA, MtxF* dest); // void Skin_Matrix_getUnitMatrixPointer(); diff --git a/include/macros.h b/include/macros.h index bdfb477..0c88af1 100644 --- a/include/macros.h +++ b/include/macros.h @@ -10,7 +10,12 @@ #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 +#define PROJECTED_TO_SCREEN_X(projectedPos, invW) ((projectedPos).x * (invW) * (SCREEN_WIDTH / 2) + (SCREEN_WIDTH / 2)) +#define PROJECTED_TO_SCREEN_Y(projectedPos, invW) ((projectedPos).y * (invW) * (-SCREEN_HEIGHT / 2) + (SCREEN_HEIGHT / 2)) + #define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0])) #define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0])) +#define ABS(x) (((x) >= 0) ? (x): -(x)) + #endif diff --git a/include/ovlmgr.h b/include/ovlmgr.h index c0b6596..345b1ee 100644 --- a/include/ovlmgr.h +++ b/include/ovlmgr.h @@ -2,12 +2,13 @@ #define OVLMGR_H #include "ultra64.h" +#include "other_types.h" #include "unk.h" struct OverlayRelocationSection; -void ovlmgr_LoadImpl(void* vromStart, UNK_TYPE arg1, void* vramStart, void* vramEnd, void* allocatedRamAddr, struct OverlayRelocationSection* ovl, size_t size); -void ovlmgr_Load(void* vromStart, UNK_TYPE arg1, void* vramStart, void* vramEnd, void* allocatedRamAddr); +void ovlmgr_LoadImpl(RomOffset vromStart, RomOffset vromEndUnused, void* vramStart, void* vramEnd, void* allocatedRamAddr, struct OverlayRelocationSection* ovl, size_t size); +void ovlmgr_Load(RomOffset vromStart, RomOffset vromEnd, void* vramStart, void* vramEnd, void* allocatedRamAddr); #endif diff --git a/include/unknown_structs.h b/include/unknown_structs.h index a10218f..9b9403c 100644 --- a/include/unknown_structs.h +++ b/include/unknown_structs.h @@ -6,5 +6,23 @@ #include "libc/stdbool.h" #include "unk.h" +typedef struct struct_801161E8_jp { + /* 0x0 */ UNK_TYPE1 unk_0[0x8]; +} struct_801161E8_jp; // size <= 0x8 + +typedef struct CommonData_unk_1004C_unk_14_arg0 { + /* 0x00 */ s16 unk_00; + /* 0x00 */ s16 unk_02; + /* 0x04 */ UNK_TYPE1 unk_04[0x60]; +} CommonData_unk_1004C_unk_14_arg0; // size >= 0x64, maybe less, guessed from stack usage + +typedef struct PlayState_unk_0110 { + /* 0x00 */ s16 unk_00; + /* 0x02 */ UNK_TYPE1 unk_02[0x2]; + /* 0x04 */ void* segment; + /* 0x08 */ UNK_TYPE1 unk_08[0x48]; + /* 0x50 */ s16 unk_50; + /* 0x52 */ UNK_TYPE1 unk_52[0x2]; +} PlayState_unk_0110; // size = 0x54 #endif diff --git a/include/z64math.h b/include/z64math.h index 25f2c42..33bab3a 100644 --- a/include/z64math.h +++ b/include/z64math.h @@ -58,8 +58,6 @@ typedef union { // Calculate the floating point remainder of x / y. #define FMOD(x, y) ((x) - ((s32)((x) * (1.0f / (y))) * (f32)(y))) -#define ABS(x) (x >= 0.0f) ? x : -x; - // Casting a float to an integer, when the float value is larger than what the integer type can hold, // leads to undefined behavior. For example (f32)0x8000 doesn't fit in a s16, so it cannot be cast to s16. // This isn't an issue with IDO, but is one with for example GCC. @@ -83,4 +81,9 @@ typedef union { #define BINANG_TO_RAD_ALT(binang) (((f32)(binang) / 0x8000) * (f32)M_PI) #define BINANG_TO_RAD_ALT2(binang) (((f32)(binang) * (f32)M_PI) / 0x8000) +// Angle arithmetic macros +#define BINANG_ROT180(angle) ((s16)(angle + 0x8000)) +#define BINANG_SUB(a, b) ((s16)(a - b)) +#define BINANG_ADD(a, b) ((s16)(a + b)) + #endif diff --git a/include/z_std_dma.h b/include/z_std_dma.h index 9927304..bd337e5 100644 --- a/include/z_std_dma.h +++ b/include/z_std_dma.h @@ -28,7 +28,7 @@ void DmaMgr_RequestSync(void* ram, void* vrom, size_t size); // void func_80026BC0_jp(); // void func_80026C00_jp(); // void func_80026C28_jp(); -s32 func_80026C4C_jp(void* vromStart, void* vromEnd, void* ovlStart, void* ovlEnd); +s32 func_80026C4C_jp(RomOffset vromStart, RomOffset* vromEnd, void* ovlStart, void* ovlEnd); void func_80026CAC_jp(void); void func_80026DA0_jp(void); // void func_80026DCC_jp(); |
