1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-11 03:39:59 +00:00

Fixed one non-matching in z_actor (#240)

This commit is contained in:
Ethan Roseman 2020-07-05 11:51:48 -04:00 committed by GitHub
parent 61544b873d
commit e6ca2dfd70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 86 deletions

View file

@ -1,71 +0,0 @@
.late_rodata
glabel D_80136B0C
.float 340282346638528859811704183484516925440 # FLT_MAX
glabel D_80136B10
.float 0.8
glabel D_80136B14
.float 340282346638528859811704183484516925440 # FLT_MAX
.text
glabel func_8002EFC0
/* AA6160 8002EFC0 AFA60008 */ sw $a2, 8($sp)
/* AA6164 8002EFC4 848E008A */ lh $t6, 0x8a($a0)
/* AA6168 8002EFC8 00063400 */ sll $a2, $a2, 0x10
/* AA616C 8002EFCC 24018000 */ li $at, -32768
/* AA6170 8002EFD0 00063403 */ sra $a2, $a2, 0x10
/* AA6174 8002EFD4 01C1C821 */ addu $t9, $t6, $at
/* AA6178 8002EFD8 03261023 */ subu $v0, $t9, $a2
/* AA617C 8002EFDC 00021400 */ sll $v0, $v0, 0x10
/* AA6180 8002EFE0 00021403 */ sra $v0, $v0, 0x10
/* AA6184 8002EFE4 04400004 */ bltz $v0, .L8002EFF8
/* AA6188 8002EFE8 00021823 */ negu $v1, $v0
/* AA618C 8002EFEC 00021C00 */ sll $v1, $v0, 0x10
/* AA6190 8002EFF0 10000003 */ b .L8002F000
/* AA6194 8002EFF4 00031C03 */ sra $v1, $v1, 0x10
.L8002EFF8:
/* AA6198 8002EFF8 00031C00 */ sll $v1, $v1, 0x10
/* AA619C 8002EFFC 00031C03 */ sra $v1, $v1, 0x10
.L8002F000:
/* AA61A0 8002F000 8CA80664 */ lw $t0, 0x664($a1)
/* AA61A4 8002F004 28612AAB */ slti $at, $v1, 0x2aab
/* AA61A8 8002F008 1100001A */ beqz $t0, .L8002F074
/* AA61AC 8002F00C 00000000 */ nop
/* AA61B0 8002F010 28614001 */ slti $at, $v1, 0x4001
/* AA61B4 8002F014 10200006 */ beqz $at, .L8002F030
/* AA61B8 8002F018 00000000 */ nop
/* AA61BC 8002F01C 8C890004 */ lw $t1, 4($a0)
/* AA61C0 8002F020 240B4000 */ li $t3, 16384
/* AA61C4 8002F024 01636023 */ subu $t4, $t3, $v1
/* AA61C8 8002F028 00095100 */ sll $t2, $t1, 4
/* AA61CC 8002F02C 05410003 */ bgez $t2, .L8002F03C
.L8002F030:
/* AA61D0 8002F030 3C018013 */ lui $at, %hi(D_80136B0C)
/* AA61D4 8002F034 03E00008 */ jr $ra
/* AA61D8 8002F038 C4206B0C */ lwc1 $f0, %lo(D_80136B0C)($at)
.L8002F03C:
/* AA61DC 8002F03C 448C2000 */ mtc1 $t4, $f4
/* AA61E0 8002F040 3C013800 */ li $at, 0x38000000 # 0.000000
/* AA61E4 8002F044 44814000 */ mtc1 $at, $f8
/* AA61E8 8002F048 468021A0 */ cvt.s.w $f6, $f4
/* AA61EC 8002F04C 3C018013 */ lui $at, %hi(D_80136B10)
/* AA61F0 8002F050 C4306B10 */ lwc1 $f16, %lo(D_80136B10)($at)
/* AA61F4 8002F054 C48C008C */ lwc1 $f12, 0x8c($a0)
/* AA61F8 8002F058 46083282 */ mul.s $f10, $f6, $f8
/* AA61FC 8002F05C 00000000 */ nop
/* AA6200 8002F060 46106482 */ mul.s $f18, $f12, $f16
/* AA6204 8002F064 00000000 */ nop
/* AA6208 8002F068 460A9102 */ mul.s $f4, $f18, $f10
/* AA620C 8002F06C 03E00008 */ jr $ra
/* AA6210 8002F070 46046001 */ sub.s $f0, $f12, $f4
.L8002F074:
/* AA6214 8002F074 14200003 */ bnez $at, .L8002F084
/* AA6218 8002F078 3C018013 */ lui $at, %hi(D_80136B14)
/* AA621C 8002F07C 03E00008 */ jr $ra
/* AA6220 8002F080 C4206B14 */ lwc1 $f0, %lo(D_80136B14)($at)
.L8002F084:
/* AA6224 8002F084 C480008C */ lwc1 $f0, 0x8c($a0)
/* AA6228 8002F088 03E00008 */ jr $ra
/* AA622C 8002F08C 00000000 */ nop

View file

@ -1430,34 +1430,30 @@ PosRot* func_8002EF44(PosRot* arg0, Actor* actor) {
return arg0;
}
#ifdef NON_MATCHING
// single regalloc difference
f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2) {
s16 var;
s16 abs_var;
s16 yawTemp;
s16 yawTempAbs;
f32 ret;
var = (s16)(actor->yawTowardsLink - 0x8000) - arg2;
abs_var = ABS(var);
yawTemp = (s16)(actor->yawTowardsLink - 0x8000) - arg2;
yawTempAbs = ABS(yawTemp);
if (player->unk_664 != NULL) {
if ((abs_var > 0x4000) || (actor->flags & 0x8000000)) {
if ((yawTempAbs > 0x4000) || (actor->flags & 0x8000000)) {
return FLT_MAX;
} else {
return actor->xyzDistFromLinkSq -
actor->xyzDistFromLinkSq * 0.8f * ((0x4000 - abs_var) * 3.0517578125e-05f);
ret = actor->xyzDistFromLinkSq -
actor->xyzDistFromLinkSq * 0.8f * ((0x4000 - yawTempAbs) * 3.0517578125e-05f);
return ret;
}
}
if (abs_var > 0x2AAA) {
if (yawTempAbs > 0x2AAA) {
return FLT_MAX;
}
return actor->xyzDistFromLinkSq;
}
#else
extern f32 func_8002EFC0(Actor* actor, Player* player, s16 arg2);
#pragma GLOBAL_ASM("asm/non_matchings/code/z_actor/func_8002EFC0.s")
#endif
typedef struct {
f32 unk_0, unk_4;
@ -2370,7 +2366,8 @@ s32 func_800314D4(GlobalContext* globalCtx, Actor* actor, Vec3f* arg2, f32 arg3)
if ((arg2->z > -actor->uncullZoneScale) && (arg2->z < (actor->uncullZoneForward + actor->uncullZoneScale))) {
var = (arg3 < 1.0f) ? 1.0f : 1.0f / arg3;
if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < 1.0f) && (((arg2->y + actor->uncullZoneDownward) * var) > -1.0f) &&
if ((((fabsf(arg2->x) - actor->uncullZoneScale) * var) < 1.0f) &&
(((arg2->y + actor->uncullZoneDownward) * var) > -1.0f) &&
(((arg2->y - actor->uncullZoneScale) * var) < 1.0f)) {
return 1;
}