diff --git a/asm/non_matchings/code/z_collision_check/func_8005B6B0.s b/asm/non_matchings/code/z_collision_check/func_8005B6B0.s deleted file mode 100644 index 7eb01f8454..0000000000 --- a/asm/non_matchings/code/z_collision_check/func_8005B6B0.s +++ /dev/null @@ -1,17 +0,0 @@ -glabel func_8005B6B0 -/* AD2850 8005B6B0 AFA40000 */ sw $a0, ($sp) -/* AD2854 8005B6B4 8CCE0000 */ lw $t6, ($a2) -/* AD2858 8005B6B8 24080010 */ li $t0, 16 -/* AD285C 8005B6BC 24020001 */ li $v0, 1 -/* AD2860 8005B6C0 ACAE0000 */ sw $t6, ($a1) -/* AD2864 8005B6C4 90CF0004 */ lbu $t7, 4($a2) -/* AD2868 8005B6C8 A0AF0010 */ sb $t7, 0x10($a1) -/* AD286C 8005B6CC 90D80005 */ lbu $t8, 5($a2) -/* AD2870 8005B6D0 A0B80011 */ sb $t8, 0x11($a1) -/* AD2874 8005B6D4 90D90006 */ lbu $t9, 6($a2) -/* AD2878 8005B6D8 A0A80013 */ sb $t0, 0x13($a1) -/* AD287C 8005B6DC A0B90012 */ sb $t9, 0x12($a1) -/* AD2880 8005B6E0 90C90007 */ lbu $t1, 7($a2) -/* AD2884 8005B6E4 03E00008 */ jr $ra -/* AD2888 8005B6E8 A0A90015 */ sb $t1, 0x15($a1) - diff --git a/include/functions.h b/include/functions.h index f4e3eb1581..03ec8e23f5 100644 --- a/include/functions.h +++ b/include/functions.h @@ -685,7 +685,7 @@ s32 func_8005C318(GlobalContext* globalCtx, ColliderCylinderDim* dim); s32 func_8005C328(GlobalContext* globalCtx, ColliderCylinderDim* dest, ColliderCylinderDim* src); s32 ActorCollider_AllocCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision); s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision); -s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* arg2); +s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit_Actor* arg2); 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); diff --git a/include/z64actor.h b/include/z64actor.h index e69568470b..3c24311496 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -284,9 +284,17 @@ typedef struct /* 0x03 */ u8 maskA; /* Bitwise-And with Mask B */ /* 0x04 */ u8 maskB; /* Bitwise-And with Mask A */ /* 0x05 */ u8 type; /* Collider Type */ - /* 0x06 */ u8 unk_06[0x2]; /* 0000 */ } ColliderInit; // size = 0x08 +typedef struct +{ + /* 0x00 */ Actor* actor; + /* 0x04 */ u8 colliderFlags; /* Compared to 0x11 */ + /* 0x05 */ u8 collideFlags; /* Compared to 0x10 */ + /* 0x06 */ u8 maskA; /* Bitwise-and compared to 0x13 */ + /* 0x07 */ u8 type; /* Cylinder Collection, Cylinder, Triangle Collection, Quad */ +} ColliderInit_Actor; // size = 0x08 + typedef struct { /* 0x00 */ s16 radius; /* Cylinder Radius */ @@ -309,6 +317,14 @@ typedef struct /* 0x20 */ ColliderCylinderDim dim; } ColliderCylinderInit; // size = 0x2C + +typedef struct +{ + /* 0x00 */ ColliderInit_Actor body; + /* 0x08 */ ColliderBodyInit inner; + /* 0x20 */ ColliderCylinderDim dim; +} ColliderCylinderInit_Actor; // size = 0x2C + typedef struct { /* 0x00 */ Actor* actor; diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 2ad23a40b3..31991716bb 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -27,7 +27,17 @@ s32 func_8005B6A0(GlobalContext* globalCtx, Collider* collision) return 1; } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005B6B0.s") +//SetInit Collider (ColliderInit_Actor) +s32 func_8005B6B0(GlobalContext* globalCtx, Collider* collision, ColliderInit_Actor* src) +{ + collision->actor = src->actor; + collision->colliderFlags = src->colliderFlags; + collision->collideFlags = src->collideFlags; + collision->maskA = src->maskA; + collision->maskB = 0x10; + collision->type = src->type; + return 1; +} //SetInit Collider (maskB = 0x10) s32 func_8005B6EC(GlobalContext* globalCtx, Collider* collision, Actor* actor, ColliderInit* src) @@ -235,7 +245,9 @@ s32 ActorCollider_FreeCylinder(GlobalContext* globalCtx, ColliderCylinderMain* c return 1; } -s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit* src) +//SetInit Cylinder legacy? +//used only by DekuJr, D_80B92A00 +s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, ColliderCylinderInit_Actor* src) { func_8005B6B0(globalCtx, &collision->base, &src->body); func_8005B93C(globalCtx, &collision->body, &src->inner); @@ -243,6 +255,7 @@ s32 func_8005C3F4(GlobalContext* globalCtx, ColliderCylinderMain* collision, Col return 1; } +//SetInit Cylinder maskB = 0x10 s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) { func_8005B6EC(globalCtx, &collision->base, actor, &src->body); @@ -251,6 +264,8 @@ s32 func_8005C450(GlobalContext* globalCtx, ColliderCylinderMain* collision, Act return 1; } +//SetInit Cylinder maskB = src->maskB +//8005c4ac s32 ActorCollider_InitCylinder(GlobalContext* globalCtx, ColliderCylinderMain* collision, Actor* actor, ColliderCylinderInit* src) { func_8005B72C(globalCtx, &collision->base, actor, &src->body);