func_8005E81C ok

This commit is contained in:
mzxrules 2020-04-02 16:18:52 -04:00
parent 8c2da636cd
commit 1e6d38c1f8
4 changed files with 65 additions and 152 deletions

View File

@ -1,9 +0,0 @@
glabel func_8005E800
/* AD59A0 8005E800 908E0010 */ lbu $t6, 0x10($a0)
/* AD59A4 8005E804 35CF0004 */ ori $t7, $t6, 4
/* AD59A8 8005E808 A08F0010 */ sb $t7, 0x10($a0)
/* AD59AC 8005E80C 90B80011 */ lbu $t8, 0x11($a1)
/* AD59B0 8005E810 37190080 */ ori $t9, $t8, 0x80
/* AD59B4 8005E814 03E00008 */ jr $ra
/* AD59B8 8005E818 A0B90011 */ sb $t9, 0x11($a1)

View File

@ -1,113 +0,0 @@
.text
glabel func_8005E81C
/* AD59BC 8005E81C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* AD59C0 8005E820 AFA70034 */ sw $a3, 0x34($sp)
/* AD59C4 8005E824 8FA70038 */ lw $a3, 0x38($sp)
/* AD59C8 8005E828 AFBF0024 */ sw $ra, 0x24($sp)
/* AD59CC 8005E82C AFB00020 */ sw $s0, 0x20($sp)
/* AD59D0 8005E830 AFA40028 */ sw $a0, 0x28($sp)
/* AD59D4 8005E834 90EE0011 */ lbu $t6, 0x11($a3)
/* AD59D8 8005E838 00A08025 */ move $s0, $a1
/* AD59DC 8005E83C 31CF0004 */ andi $t7, $t6, 4
/* AD59E0 8005E840 51E0000E */ beql $t7, $zero, .L8005E87C
/* AD59E4 8005E844 8FA2003C */ lw $v0, 0x3c($sp)
/* AD59E8 8005E848 8CB80000 */ lw $t8, ($a1)
/* AD59EC 8005E84C 5300000B */ beql $t8, $zero, .L8005E87C
/* AD59F0 8005E850 8FA2003C */ lw $v0, 0x3c($sp)
/* AD59F4 8005E854 8CF90000 */ lw $t9, ($a3)
/* AD59F8 8005E858 00A02025 */ move $a0, $a1
/* AD59FC 8005E85C 00E02825 */ move $a1, $a3
/* AD5A00 8005E860 53200006 */ beql $t9, $zero, .L8005E87C
/* AD5A04 8005E864 8FA2003C */ lw $v0, 0x3c($sp)
/* AD5A08 8005E868 0C017A00 */ jal func_8005E800
/* AD5A0C 8005E86C AFA60030 */ sw $a2, 0x30($sp)
/* AD5A10 8005E870 8FA60030 */ lw $a2, 0x30($sp)
/* AD5A14 8005E874 8FA70038 */ lw $a3, 0x38($sp)
/* AD5A18 8005E878 8FA2003C */ lw $v0, 0x3c($sp)
.L8005E87C:
/* AD5A1C 8005E87C 02002825 */ move $a1, $s0
/* AD5A20 8005E880 90490016 */ lbu $t1, 0x16($v0)
/* AD5A24 8005E884 312A0008 */ andi $t2, $t1, 8
/* AD5A28 8005E888 55400011 */ bnezl $t2, .L8005E8D0
/* AD5A2C 8005E88C 90F90011 */ lbu $t9, 0x11($a3)
/* AD5A30 8005E890 920B0010 */ lbu $t3, 0x10($s0)
/* AD5A34 8005E894 356C0002 */ ori $t4, $t3, 2
/* AD5A38 8005E898 A20C0010 */ sb $t4, 0x10($s0)
/* AD5A3C 8005E89C 8CED0000 */ lw $t5, ($a3)
/* AD5A40 8005E8A0 AE0D0004 */ sw $t5, 4($s0)
/* AD5A44 8005E8A4 90CE0015 */ lbu $t6, 0x15($a2)
/* AD5A48 8005E8A8 ACC70018 */ sw $a3, 0x18($a2)
/* AD5A4C 8005E8AC ACC20020 */ sw $v0, 0x20($a2)
/* AD5A50 8005E8B0 35CF0002 */ ori $t7, $t6, 2
/* AD5A54 8005E8B4 A0CF0015 */ sb $t7, 0x15($a2)
/* AD5A58 8005E8B8 8E030000 */ lw $v1, ($s0)
/* AD5A5C 8005E8BC 50600004 */ beql $v1, $zero, .L8005E8D0
/* AD5A60 8005E8C0 90F90011 */ lbu $t9, 0x11($a3)
/* AD5A64 8005E8C4 9058000C */ lbu $t8, 0xc($v0)
/* AD5A68 8005E8C8 A07800B2 */ sb $t8, 0xb2($v1)
/* AD5A6C 8005E8CC 90F90011 */ lbu $t9, 0x11($a3)
.L8005E8D0:
/* AD5A70 8005E8D0 37290002 */ ori $t1, $t9, 2
/* AD5A74 8005E8D4 A0E90011 */ sb $t1, 0x11($a3)
/* AD5A78 8005E8D8 8E0A0000 */ lw $t2, ($s0)
/* AD5A7C 8005E8DC ACEA0008 */ sw $t2, 8($a3)
/* AD5A80 8005E8E0 904B0016 */ lbu $t3, 0x16($v0)
/* AD5A84 8005E8E4 AC50001C */ sw $s0, 0x1c($v0)
/* AD5A88 8005E8E8 AC460024 */ sw $a2, 0x24($v0)
/* AD5A8C 8005E8EC 356C0002 */ ori $t4, $t3, 2
/* AD5A90 8005E8F0 A04C0016 */ sb $t4, 0x16($v0)
/* AD5A94 8005E8F4 8CE30000 */ lw $v1, ($a3)
/* AD5A98 8005E8F8 50600004 */ beql $v1, $zero, .L8005E90C
/* AD5A9C 8005E8FC 8FA80044 */ lw $t0, 0x44($sp)
/* AD5AA0 8005E900 90CD0004 */ lbu $t5, 4($a2)
/* AD5AA4 8005E904 A06D00B3 */ sb $t5, 0xb3($v1)
/* AD5AA8 8005E908 8FA80044 */ lw $t0, 0x44($sp)
.L8005E90C:
/* AD5AAC 8005E90C C5040000 */ lwc1 $f4, ($t0)
/* AD5AB0 8005E910 4600218D */ trunc.w.s $f6, $f4
/* AD5AB4 8005E914 440F3000 */ mfc1 $t7, $f6
/* AD5AB8 8005E918 00000000 */ nop
/* AD5ABC 8005E91C A44F000E */ sh $t7, 0xe($v0)
/* AD5AC0 8005E920 C5080004 */ lwc1 $f8, 4($t0)
/* AD5AC4 8005E924 4600428D */ trunc.w.s $f10, $f8
/* AD5AC8 8005E928 44195000 */ mfc1 $t9, $f10
/* AD5ACC 8005E92C 00000000 */ nop
/* AD5AD0 8005E930 A4590010 */ sh $t9, 0x10($v0)
/* AD5AD4 8005E934 C5100008 */ lwc1 $f16, 8($t0)
/* AD5AD8 8005E938 4600848D */ trunc.w.s $f18, $f16
/* AD5ADC 8005E93C 440A9000 */ mfc1 $t2, $f18
/* AD5AE0 8005E940 00000000 */ nop
/* AD5AE4 8005E944 A44A0012 */ sh $t2, 0x12($v0)
/* AD5AE8 8005E948 90CB0015 */ lbu $t3, 0x15($a2)
/* AD5AEC 8005E94C 8FA40028 */ lw $a0, 0x28($sp)
/* AD5AF0 8005E950 316C0020 */ andi $t4, $t3, 0x20
/* AD5AF4 8005E954 5580000E */ bnezl $t4, .L8005E990
/* AD5AF8 8005E958 AFA20010 */ sw $v0, 0x10($sp)
/* AD5AFC 8005E95C 90E30014 */ lbu $v1, 0x14($a3)
/* AD5B00 8005E960 24010009 */ li $at, 9
/* AD5B04 8005E964 10610009 */ beq $v1, $at, .L8005E98C
/* AD5B08 8005E968 2401000B */ li $at, 11
/* AD5B0C 8005E96C 10610007 */ beq $v1, $at, .L8005E98C
/* AD5B10 8005E970 2401000C */ li $at, 12
/* AD5B14 8005E974 50610006 */ beql $v1, $at, .L8005E990
/* AD5B18 8005E978 AFA20010 */ sw $v0, 0x10($sp)
/* AD5B1C 8005E97C 904D0016 */ lbu $t5, 0x16($v0)
/* AD5B20 8005E980 35AE0080 */ ori $t6, $t5, 0x80
/* AD5B24 8005E984 10000009 */ b .L8005E9AC
/* AD5B28 8005E988 A04E0016 */ sb $t6, 0x16($v0)
.L8005E98C:
/* AD5B2C 8005E98C AFA20010 */ sw $v0, 0x10($sp)
.L8005E990:
/* AD5B30 8005E990 AFA80014 */ sw $t0, 0x14($sp)
/* AD5B34 8005E994 0C017981 */ jal func_8005E604
/* AD5B38 8005E998 AFA60030 */ sw $a2, 0x30($sp)
/* AD5B3C 8005E99C 8FA60030 */ lw $a2, 0x30($sp)
/* AD5B40 8005E9A0 90CF0015 */ lbu $t7, 0x15($a2)
/* AD5B44 8005E9A4 35F80040 */ ori $t8, $t7, 0x40
/* AD5B48 8005E9A8 A0D80015 */ sb $t8, 0x15($a2)
.L8005E9AC:
/* AD5B4C 8005E9AC 8FBF0024 */ lw $ra, 0x24($sp)
/* AD5B50 8005E9B0 8FB00020 */ lw $s0, 0x20($sp)
/* AD5B54 8005E9B4 27BD0028 */ addiu $sp, $sp, 0x28
/* AD5B58 8005E9B8 03E00008 */ jr $ra
/* AD5B5C 8005E9BC 24020001 */ li $v0, 1

View File

@ -212,18 +212,18 @@ typedef struct
/* 0x04 */ Actor* at;
/* 0x08 */ Actor* ac;
/* 0x0C */ Actor* oc;
/* 0x10 */ u8 colliderFlags; /* Compared to 0x11 */
/* 0x11 */ u8 collideFlags; /* Compared to 0x10 */
/* 0x12 */ u8 maskA; /* Bitwise-and compared to 0x13 */
/* 0x13 */ u8 maskB; /* Bitwise-and compared to 0x12 */
/* 0x10 */ u8 colliderFlags; //Compared to 0x11
/* 0x11 */ u8 collideFlags; //Compared to 0x10
/* 0x12 */ u8 maskA; //Bitwise-and compared to 0x13
/* 0x13 */ u8 maskB; //Bitwise-and compared to 0x12
/* 0x14 */ u8 unk_14;
/* 0x15 */ u8 type; /* Cylinder Collection, Cylinder, Triangle Collection, Quad */
/* 0x15 */ u8 type; //Cylinder Collection, Cylinder, Triangle Collection, Quad
} Collider; // size = 0x18
typedef struct
{
/* 0x00 */ s32 flags; /* Toucher Attack Identifier Flags */
/* 0x04 */ u8 unk_04;
/* 0x04 */ u8 effect;
/* 0x05 */ u8 damage; /* Damage or Stun Timer */
} ColliderTouch; // size = 0x08
@ -232,9 +232,7 @@ typedef struct
/* 0x00 */ s32 flags; /* Collision Exclusion Mask */
/* 0x04 */ u8 effect; /* Damage Effect (Knockback, Fire, etc.) */
/* 0x05 */ u8 unk_05;
/* 0x06 */ s16 unk_06;
/* 0x08 */ s16 unk_08;
/* 0x0A */ s16 unk_0A;
/* 0x06 */ Vec3s unk_06;
} ColliderBump; // size = 0x0C
typedef struct
@ -252,18 +250,12 @@ typedef struct ColliderBody
/* 0x15 */ u8 toucherFlags;
/* 0x16 */ u8 bumperFlags;
/* 0x17 */ u8 flags2;
/* 0x18 */ s32 unk_18;
/* 0x1C */ struct ColliderBodyEntry* colBuf;
/* 0x20 */ s32 unk_20;
/* 0x24 */ struct ColliderBody* colliding;
/* 0x18 */ Collider* unk18; //left
/* 0x1C */ Collider* colBuf; //right
/* 0x20 */ struct ColliderBody* unk20; //left
/* 0x24 */ struct ColliderBody* colliding; //right
} ColliderBody; // size = 0x28
typedef struct ColliderBodyEntry
{
/* 0x00 */ ColliderBody c;
/* 0x28 */ char unk_28[0x18];
} ColliderBodyEntry; // size = 0x40
typedef struct
{
/* 0x00 */ u8 bodyFlags;

View File

@ -103,7 +103,7 @@ s32 func_8005B7E4(GlobalContext* globalCtx, ColliderTouch* touch)
s32 func_8005B7F4(GlobalContext* globalCtx, ColliderTouch* dest, ColliderTouch* src)
{
dest->flags = src->flags;
dest->unk_04 = src->unk_04;
dest->effect = src->effect;
dest->damage = src->damage;
return 1;
}
@ -116,7 +116,7 @@ void func_8005B818(GlobalContext* globalCtx, ColliderBody* body)
//Initialize ColliderBump
s32 func_8005B824(GlobalContext* globalCtx, ColliderBump* bump)
{
static ColliderBump init = { (s32)0xFFCFFFFF, 0, 0, 0, 0, 0 };
static ColliderBump init = { (s32)0xFFCFFFFF, 0, 0, { 0, 0, 0 } };
*bump = init;
return 1;
}
@ -140,7 +140,7 @@ s32 func_8005B860(GlobalContext* globalCtx, ColliderBump* bump, ColliderBumpInit
s32 func_8005B884(GlobalContext* globalCtx, ColliderBody* body) {
static ColliderBody init = {
{ 0, 0, 0 },
{ (s32)0xFFCFFFFF, 0, 0, 0, 0, 0 },
{ (s32)0xFFCFFFFF, 0, 0, {0, 0, 0} },
0, 0, 0, 0, 0, NULL, 0, NULL,
};
*body = init;
@ -172,8 +172,8 @@ s32 func_8005B93C(GlobalContext* globalCtx, ColliderBody* body, ColliderBodyInit
//SetAT ColliderBody
void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
{
body->unk_18 = 0;
body->unk_20 = 0;
body->unk18 = NULL;
body->unk20 = NULL;
body->toucherFlags &= ~0x2;
body->toucherFlags &= ~0x40;
func_8005B818(globalCtx, body);
@ -182,13 +182,13 @@ void func_8005B9B0(GlobalContext* globalCtx, ColliderBody* body)
//SetAC ColliderBody
void func_8005B9E8(GlobalContext* globalCtx, ColliderBody* body)
{
body->bumper.unk_0A = 0;
body->bumper.unk_06.z = 0;
body->bumperFlags &= ~0x2;
body->bumperFlags &= ~0x80;
body->colBuf = NULL;
body->colliding = NULL;
body->bumper.unk_08 = body->bumper.unk_0A;
body->bumper.unk_06 = body->bumper.unk_0A;
body->bumper.unk_06.y = body->bumper.unk_06.z;
body->bumper.unk_06.x = body->bumper.unk_06.z;
}
//SetOC ColliderBody
@ -1117,12 +1117,55 @@ void func_8005DF9C(UNK_TYPE arg0, UNK_TYPE arg1, UNK_TYPE arg2) {
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005E604.s")
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005E800.s")
void func_8005E800(Collider* left, Collider* right) {
left->colliderFlags |= 4;
right->collideFlags |= 0x80;
}
//Set AT to AC collision
s32 func_8005E81C(GlobalContext* globalContext,
Collider* left, ColliderBody* leftBody, Vec3f* leftv,
Collider* right, ColliderBody* rightBody, Vec3f* rightv, Vec3f* unk);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005E81C.s")
Collider* right, ColliderBody* rightBody, Vec3f* rightv, Vec3f* arg7) {
if ((right->collideFlags & 4) != 0) {
if (left->actor != NULL) {
if (right->actor != NULL) {
func_8005E800(left, right);
}
}
}
if ((rightBody->bumperFlags & 8) == 0) {
left->colliderFlags |= 2;
left->at = right->actor;
leftBody->unk18 = right;
leftBody->unk20 = rightBody;
leftBody->toucherFlags |= 2;
if (left->actor != NULL) {
left->actor->sub_98.impactEffect = rightBody->bumper.effect;
}
}
right->collideFlags |= 2;
right->ac = left->actor;
rightBody->colBuf = left;
rightBody->colliding = leftBody;
rightBody->bumperFlags |= 2;
if (right->actor != NULL) {
right->actor->sub_98.unk_1B = (u8)leftBody->toucher.effect;
}
rightBody->bumper.unk_06.x = (s16)arg7->x;
rightBody->bumper.unk_06.y = (s16)arg7->y;
rightBody->bumper.unk_06.z = (s16)arg7->z;
if (((((leftBody->toucherFlags & 0x20) == 0) && (right->unk_14 != 9)) && (right->unk_14 != 0xB)) && (right->unk_14 != 0xC)) {
rightBody->bumperFlags |= 0x80;
}
else {
leftBody = (void*)leftBody;
func_8005E604(globalContext, left, leftBody, right, rightBody, arg7);
leftBody->toucherFlags |= 0x40;
}
return 1;
}
//Check ColliderJntSph to ColliderJntSph
void func_8005E9C0(GlobalContext* globalCtx, CollisionCheckContext* check, Collider* l, Collider* r) {