diff --git a/asm/non_matchings/code/z_collision_check/func_8005B76C.s b/asm/non_matchings/code/z_collision_check/func_8005B76C.s deleted file mode 100644 index a7c7f44e36..0000000000 --- a/asm/non_matchings/code/z_collision_check/func_8005B76C.s +++ /dev/null @@ -1,8 +0,0 @@ -glabel func_8005B76C -/* AD290C 8005B76C AFA40000 */ sw $a0, ($sp) -/* AD2910 8005B770 90AE0010 */ lbu $t6, 0x10($a1) -/* AD2914 8005B774 ACA00004 */ sw $zero, 4($a1) -/* AD2918 8005B778 31CFFFF9 */ andi $t7, $t6, 0xfff9 -/* AD291C 8005B77C 03E00008 */ jr $ra -/* AD2920 8005B780 A0AF0010 */ sb $t7, 0x10($a1) - diff --git a/asm/non_matchings/code/z_collision_check/func_8005C124.s b/asm/non_matchings/code/z_collision_check/func_8005C124.s deleted file mode 100644 index 90b196908b..0000000000 --- a/asm/non_matchings/code/z_collision_check/func_8005C124.s +++ /dev/null @@ -1,38 +0,0 @@ -.text -glabel func_8005C124 -/* AD32C4 8005C124 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* AD32C8 8005C128 AFBF0024 */ sw $ra, 0x24($sp) -/* AD32CC 8005C12C AFB20020 */ sw $s2, 0x20($sp) -/* AD32D0 8005C130 AFB1001C */ sw $s1, 0x1c($sp) -/* AD32D4 8005C134 00809025 */ move $s2, $a0 -/* AD32D8 8005C138 AFB00018 */ sw $s0, 0x18($sp) -/* AD32DC 8005C13C 00A08825 */ move $s1, $a1 -/* AD32E0 8005C140 0C016DDB */ jal func_8005B76C -/* AD32E4 8005C144 AFA5002C */ sw $a1, 0x2c($sp) -/* AD32E8 8005C148 8FA5002C */ lw $a1, 0x2c($sp) -/* AD32EC 8005C14C 8CAE0018 */ lw $t6, 0x18($a1) -/* AD32F0 8005C150 8CB0001C */ lw $s0, 0x1c($a1) -/* AD32F4 8005C154 000E7980 */ sll $t7, $t6, 6 -/* AD32F8 8005C158 020FC021 */ addu $t8, $s0, $t7 -/* AD32FC 8005C15C 0218082B */ sltu $at, $s0, $t8 -/* AD3300 8005C160 1020000B */ beqz $at, .L8005C190 -/* AD3304 8005C164 02402025 */ move $a0, $s2 -.L8005C168: -/* AD3308 8005C168 0C016EE3 */ jal func_8005BB8C -/* AD330C 8005C16C 02002825 */ move $a1, $s0 -/* AD3310 8005C170 8E280018 */ lw $t0, 0x18($s1) -/* AD3314 8005C174 8E39001C */ lw $t9, 0x1c($s1) -/* AD3318 8005C178 26100040 */ addiu $s0, $s0, 0x40 -/* AD331C 8005C17C 00084980 */ sll $t1, $t0, 6 -/* AD3320 8005C180 03295021 */ addu $t2, $t9, $t1 -/* AD3324 8005C184 020A082B */ sltu $at, $s0, $t2 -/* AD3328 8005C188 5420FFF7 */ bnezl $at, .L8005C168 -/* AD332C 8005C18C 02402025 */ move $a0, $s2 -.L8005C190: -/* AD3330 8005C190 8FBF0024 */ lw $ra, 0x24($sp) -/* AD3334 8005C194 8FB00018 */ lw $s0, 0x18($sp) -/* AD3338 8005C198 8FB1001C */ lw $s1, 0x1c($sp) -/* AD333C 8005C19C 8FB20020 */ lw $s2, 0x20($sp) -/* AD3340 8005C1A0 27BD0028 */ addiu $sp, $sp, 0x28 -/* AD3344 8005C1A4 03E00008 */ jr $ra -/* AD3348 8005C1A8 24020001 */ li $v0, 1 diff --git a/asm/non_matchings/code/z_collision_check/func_8005C1AC.s b/asm/non_matchings/code/z_collision_check/func_8005C1AC.s deleted file mode 100644 index 1cd5be79bf..0000000000 --- a/asm/non_matchings/code/z_collision_check/func_8005C1AC.s +++ /dev/null @@ -1,38 +0,0 @@ -.text -glabel func_8005C1AC -/* AD334C 8005C1AC 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* AD3350 8005C1B0 AFBF0024 */ sw $ra, 0x24($sp) -/* AD3354 8005C1B4 AFB20020 */ sw $s2, 0x20($sp) -/* AD3358 8005C1B8 AFB1001C */ sw $s1, 0x1c($sp) -/* AD335C 8005C1BC 00809025 */ move $s2, $a0 -/* AD3360 8005C1C0 AFB00018 */ sw $s0, 0x18($sp) -/* AD3364 8005C1C4 00A08825 */ move $s1, $a1 -/* AD3368 8005C1C8 0C016DE1 */ jal func_8005B784 -/* AD336C 8005C1CC AFA5002C */ sw $a1, 0x2c($sp) -/* AD3370 8005C1D0 8FA5002C */ lw $a1, 0x2c($sp) -/* AD3374 8005C1D4 8CAE0018 */ lw $t6, 0x18($a1) -/* AD3378 8005C1D8 8CB0001C */ lw $s0, 0x1c($a1) -/* AD337C 8005C1DC 000E7980 */ sll $t7, $t6, 6 -/* AD3380 8005C1E0 020FC021 */ addu $t8, $s0, $t7 -/* AD3384 8005C1E4 0218082B */ sltu $at, $s0, $t8 -/* AD3388 8005C1E8 1020000B */ beqz $at, .L8005C218 -/* AD338C 8005C1EC 02402025 */ move $a0, $s2 -.L8005C1F0: -/* AD3390 8005C1F0 0C016EEC */ jal func_8005BBB0 -/* AD3394 8005C1F4 02002825 */ move $a1, $s0 -/* AD3398 8005C1F8 8E280018 */ lw $t0, 0x18($s1) -/* AD339C 8005C1FC 8E39001C */ lw $t9, 0x1c($s1) -/* AD33A0 8005C200 26100040 */ addiu $s0, $s0, 0x40 -/* AD33A4 8005C204 00084980 */ sll $t1, $t0, 6 -/* AD33A8 8005C208 03295021 */ addu $t2, $t9, $t1 -/* AD33AC 8005C20C 020A082B */ sltu $at, $s0, $t2 -/* AD33B0 8005C210 5420FFF7 */ bnezl $at, .L8005C1F0 -/* AD33B4 8005C214 02402025 */ move $a0, $s2 -.L8005C218: -/* AD33B8 8005C218 8FBF0024 */ lw $ra, 0x24($sp) -/* AD33BC 8005C21C 8FB00018 */ lw $s0, 0x18($sp) -/* AD33C0 8005C220 8FB1001C */ lw $s1, 0x1c($sp) -/* AD33C4 8005C224 8FB20020 */ lw $s2, 0x20($sp) -/* AD33C8 8005C228 27BD0028 */ addiu $sp, $sp, 0x28 -/* AD33CC 8005C22C 03E00008 */ jr $ra -/* AD33D0 8005C230 24020001 */ li $v0, 1 diff --git a/asm/non_matchings/code/z_collision_check/func_8005C234.s b/asm/non_matchings/code/z_collision_check/func_8005C234.s deleted file mode 100644 index 6c399d85c4..0000000000 --- a/asm/non_matchings/code/z_collision_check/func_8005C234.s +++ /dev/null @@ -1,39 +0,0 @@ -.text -glabel func_8005C234 -/* AD33D4 8005C234 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* AD33D8 8005C238 AFBF0024 */ sw $ra, 0x24($sp) -/* AD33DC 8005C23C AFB20020 */ sw $s2, 0x20($sp) -/* AD33E0 8005C240 AFB1001C */ sw $s1, 0x1c($sp) -/* AD33E4 8005C244 00809025 */ move $s2, $a0 -/* AD33E8 8005C248 AFB00018 */ sw $s0, 0x18($sp) -/* AD33EC 8005C24C 00A08825 */ move $s1, $a1 -/* AD33F0 8005C250 0C016DE7 */ jal func_8005B79C -/* AD33F4 8005C254 AFA5002C */ sw $a1, 0x2c($sp) -/* AD33F8 8005C258 8FA5002C */ lw $a1, 0x2c($sp) -/* AD33FC 8005C25C 8CAE0018 */ lw $t6, 0x18($a1) -/* AD3400 8005C260 8CB0001C */ lw $s0, 0x1c($a1) -/* AD3404 8005C264 000E7980 */ sll $t7, $t6, 6 -/* AD3408 8005C268 020FC021 */ addu $t8, $s0, $t7 -/* AD340C 8005C26C 0218082B */ sltu $at, $s0, $t8 -/* AD3410 8005C270 1020000B */ beqz $at, .L8005C2A0 -/* AD3414 8005C274 02402025 */ move $a0, $s2 -.L8005C278: -/* AD3418 8005C278 0C016EF5 */ jal func_8005BBD4 -/* AD341C 8005C27C 02002825 */ move $a1, $s0 -/* AD3420 8005C280 8E280018 */ lw $t0, 0x18($s1) -/* AD3424 8005C284 8E39001C */ lw $t9, 0x1c($s1) -/* AD3428 8005C288 26100040 */ addiu $s0, $s0, 0x40 -/* AD342C 8005C28C 00084980 */ sll $t1, $t0, 6 -/* AD3430 8005C290 03295021 */ addu $t2, $t9, $t1 -/* AD3434 8005C294 020A082B */ sltu $at, $s0, $t2 -/* AD3438 8005C298 5420FFF7 */ bnezl $at, .L8005C278 -/* AD343C 8005C29C 02402025 */ move $a0, $s2 -.L8005C2A0: -/* AD3440 8005C2A0 8FBF0024 */ lw $ra, 0x24($sp) -/* AD3444 8005C2A4 8FB00018 */ lw $s0, 0x18($sp) -/* AD3448 8005C2A8 8FB1001C */ lw $s1, 0x1c($sp) -/* AD344C 8005C2AC 8FB20020 */ lw $s2, 0x20($sp) -/* AD3450 8005C2B0 27BD0028 */ addiu $sp, $sp, 0x28 -/* AD3454 8005C2B4 03E00008 */ jr $ra -/* AD3458 8005C2B8 24020001 */ li $v0, 1 - diff --git a/asm/non_matchings/code/z_collision_check/func_8005CC98.s b/asm/non_matchings/code/z_collision_check/func_8005CC98.s deleted file mode 100644 index 2c8071ab34..0000000000 --- a/asm/non_matchings/code/z_collision_check/func_8005CC98.s +++ /dev/null @@ -1,43 +0,0 @@ -.text -glabel func_8005CC98 -/* AD3E38 8005CC98 27BDFFD8 */ addiu $sp, $sp, -0x28 -/* AD3E3C 8005CC9C AFBF0024 */ sw $ra, 0x24($sp) -/* AD3E40 8005CCA0 AFB2001C */ sw $s2, 0x1c($sp) -/* AD3E44 8005CCA4 AFB10018 */ sw $s1, 0x18($sp) -/* AD3E48 8005CCA8 00809025 */ move $s2, $a0 -/* AD3E4C 8005CCAC AFB30020 */ sw $s3, 0x20($sp) -/* AD3E50 8005CCB0 AFB00014 */ sw $s0, 0x14($sp) -/* AD3E54 8005CCB4 00A08825 */ move $s1, $a1 -/* AD3E58 8005CCB8 0C016DDB */ jal func_8005B76C -/* AD3E5C 8005CCBC AFA5002C */ sw $a1, 0x2c($sp) -/* AD3E60 8005CCC0 8FA5002C */ lw $a1, 0x2c($sp) -/* AD3E64 8005CCC4 2413005C */ li $s3, 92 -/* AD3E68 8005CCC8 8CAE0018 */ lw $t6, 0x18($a1) -/* AD3E6C 8005CCCC 8CB0001C */ lw $s0, 0x1c($a1) -/* AD3E70 8005CCD0 01D30019 */ multu $t6, $s3 -/* AD3E74 8005CCD4 00007812 */ mflo $t7 -/* AD3E78 8005CCD8 020FC021 */ addu $t8, $s0, $t7 -/* AD3E7C 8005CCDC 0218082B */ sltu $at, $s0, $t8 -/* AD3E80 8005CCE0 1020000C */ beqz $at, .L8005CD14 -/* AD3E84 8005CCE4 02402025 */ move $a0, $s2 -.L8005CCE8: -/* AD3E88 8005CCE8 0C0171DD */ jal func_8005C774 -/* AD3E8C 8005CCEC 02002825 */ move $a1, $s0 -/* AD3E90 8005CCF0 8E280018 */ lw $t0, 0x18($s1) -/* AD3E94 8005CCF4 8E39001C */ lw $t9, 0x1c($s1) -/* AD3E98 8005CCF8 2610005C */ addiu $s0, $s0, 0x5c -/* AD3E9C 8005CCFC 01130019 */ multu $t0, $s3 -/* AD3EA0 8005CD00 00004812 */ mflo $t1 -/* AD3EA4 8005CD04 03295021 */ addu $t2, $t9, $t1 -/* AD3EA8 8005CD08 020A082B */ sltu $at, $s0, $t2 -/* AD3EAC 8005CD0C 5420FFF6 */ bnezl $at, .L8005CCE8 -/* AD3EB0 8005CD10 02402025 */ move $a0, $s2 -.L8005CD14: -/* AD3EB4 8005CD14 8FBF0024 */ lw $ra, 0x24($sp) -/* AD3EB8 8005CD18 8FB00014 */ lw $s0, 0x14($sp) -/* AD3EBC 8005CD1C 8FB10018 */ lw $s1, 0x18($sp) -/* AD3EC0 8005CD20 8FB2001C */ lw $s2, 0x1c($sp) -/* AD3EC4 8005CD24 8FB30020 */ lw $s3, 0x20($sp) -/* AD3EC8 8005CD28 27BD0028 */ addiu $sp, $sp, 0x28 -/* AD3ECC 8005CD2C 03E00008 */ jr $ra -/* AD3ED0 8005CD30 24020001 */ li $v0, 1 diff --git a/src/code/z_collision_check.c b/src/code/z_collision_check.c index 158ebb5029..91a60aa0d3 100644 --- a/src/code/z_collision_check.c +++ b/src/code/z_collision_check.c @@ -424,65 +424,56 @@ s32 func_8005C050(GlobalContext* globalCtx, ColliderJntSph* dest, Actor* actor, return 1; } -#ifdef NON_MATCHING -//Set collider body property. arg1 not confirmed +//Set ColliderJntSph collider body property s32 func_8005C124(GlobalContext* globalCtx, ColliderJntSph* collider) { - ColliderJntSphItem* phi_s0; - - func_8005B76C(globalCtx, &collider->base); - - phi_s0 = collider->list; - - while (phi_s0 < collider->list + collider->count) { - func_8005BB8C(globalCtx, phi_s0); - phi_s0++; - } - return 1; -} -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C124.s") -#endif // NON_MATCHING - -#ifdef NON_MATCHING -//Set collider body property. arg1 not confirmed -s32 func_8005C1AC(GlobalContext* globalCtx, ColliderJntSph* collider) { ColliderJntSphItem* next; + ColliderJntSph* col = collider; + GlobalContext* gctx = globalCtx; - func_8005B784(globalCtx, &collider->base); - next = collider->list; + func_8005B76C(gctx, &col->base); + next = col->list; - while (next < collider->list + collider->count) - { - func_8005BBB0(globalCtx, next); + while (next < col->list + col->count) { + func_8005BB8C(gctx, next); + next++; + } + return 1; +} + +//Set ColliderJntSph collider body property +s32 func_8005C1AC(GlobalContext* globalCtx, ColliderJntSph* collider) { + ColliderJntSphItem* next; + ColliderJntSph* col = collider; + GlobalContext* gctx = globalCtx; + + func_8005B784(gctx, &col->base); + next = col->list; + + while (next < col->list + col->count) { + func_8005BBB0(gctx, next); next++; } return 1; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C1AC.s") -#endif // NON_MATCHING -#ifdef NON_MATCHING -//Set collider body property. arg1 not confirmed +//Set ColliderJntSph collider body property //D_8011DF18 func ptr s32 func_8005C234(GlobalContext* globalCtx, ColliderJntSph* collider) { ColliderJntSphItem* next; + ColliderJntSph* col = collider; + GlobalContext* gctx = globalCtx; - func_8005B79C(globalCtx, &collider->base); - next = collider->list; - while (next < collider->list + collider->count) { - func_8005BBD4(globalCtx, next); + func_8005B79C(gctx, &col->base); + next = col->list; + while (next < col->list + col->count) { + func_8005BBD4(gctx, next); next++; } return 1; } -#else -#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005C234.s") -#endif // NON_MATCHING - #ifdef NON_MATCHING //Initialize ColliderCylinderDim //matching, but needs data section imported @@ -788,7 +779,22 @@ s32 func_8005CBAC(GlobalContext* globalCtx, ColliderTris* dest, Actor* actor, Co } -#pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005CC98.s") +//Set ColliderTris collider body property +s32 func_8005CC98(GlobalContext* globalCtx, ColliderTris* collider) { + ColliderTriItem* next; + ColliderTris* col = collider; + GlobalContext* gctx = globalCtx; + + func_8005B76C(gctx, &col->base); + next = col->list; + + while (next < col->list + col->count) { + func_8005C774(gctx, next); + next++; + } + return 1; +} + #pragma GLOBAL_ASM("asm/non_matchings/code/z_collision_check/func_8005CD34.s")