papermario/asm/nonmatchings/code_317020/func_802BD1D0.s

248 lines
13 KiB
ArmAsm
Raw Normal View History

2020-10-18 04:27:25 +02:00
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802BD1D0
/* 3170F0 802BD1D0 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 3170F4 802BD1D4 AFB00018 */ sw $s0, 0x18($sp)
/* 3170F8 802BD1D8 3C108011 */ lui $s0, %hi(gPlayerData)
/* 3170FC 802BD1DC 2610F290 */ addiu $s0, $s0, %lo(gPlayerData)
/* 317100 802BD1E0 AFBF0028 */ sw $ra, 0x28($sp)
/* 317104 802BD1E4 AFB30024 */ sw $s3, 0x24($sp)
/* 317108 802BD1E8 AFB20020 */ sw $s2, 0x20($sp)
/* 31710C 802BD1EC AFB1001C */ sw $s1, 0x1c($sp)
/* 317110 802BD1F0 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 317114 802BD1F4 8C91014C */ lw $s1, 0x14c($a0)
/* 317118 802BD1F8 10A00009 */ beqz $a1, .L802BD220
/* 31711C 802BD1FC 0220202D */ daddu $a0, $s1, $zero
/* 317120 802BD200 0C03AE2A */ jal enable_partner_walking
/* 317124 802BD204 24050001 */ addiu $a1, $zero, 1
2020-11-29 08:13:07 +01:00
/* 317128 802BD208 3C04802C */ lui $a0, %hi(D_802BDD88)
/* 31712C 802BD20C 8C84DD88 */ lw $a0, %lo(D_802BDD88)($a0)
2020-10-18 04:27:25 +02:00
/* 317130 802BD210 0C00A580 */ jal mem_clear
/* 317134 802BD214 2405001C */ addiu $a1, $zero, 0x1c
2020-11-29 08:13:07 +01:00
/* 317138 802BD218 3C018011 */ lui $at, %hi(D_8010C954)
/* 31713C 802BD21C AC20C954 */ sw $zero, %lo(D_8010C954)($at)
2020-10-18 04:27:25 +02:00
.L802BD220:
2020-11-29 08:13:07 +01:00
/* 317140 802BD220 3C138011 */ lui $s3, %hi(D_8010C954)
/* 317144 802BD224 2673C954 */ addiu $s3, $s3, %lo(D_8010C954)
2020-10-18 04:27:25 +02:00
/* 317148 802BD228 8E0202F8 */ lw $v0, 0x2f8($s0)
/* 31714C 802BD22C 8E720000 */ lw $s2, ($s3)
/* 317150 802BD230 24420001 */ addiu $v0, $v0, 1
/* 317154 802BD234 16400007 */ bnez $s2, .L802BD254
/* 317158 802BD238 AE0202F8 */ sw $v0, 0x2f8($s0)
/* 31715C 802BD23C 0C03AE8F */ jal func_800EBA3C
/* 317160 802BD240 0220202D */ daddu $a0, $s1, $zero
/* 317164 802BD244 0C03AED0 */ jal func_800EBB40
/* 317168 802BD248 0220202D */ daddu $a0, $s1, $zero
/* 31716C 802BD24C 080AF551 */ j .L802BD544
/* 317170 802BD250 0000102D */ daddu $v0, $zero, $zero
.L802BD254:
2020-11-29 08:13:07 +01:00
/* 317174 802BD254 3C10802C */ lui $s0, %hi(D_802BDD88)
/* 317178 802BD258 2610DD88 */ addiu $s0, $s0, %lo(D_802BDD88)
2020-10-18 04:27:25 +02:00
/* 31717C 802BD25C 8E040000 */ lw $a0, ($s0)
/* 317180 802BD260 8C830004 */ lw $v1, 4($a0)
/* 317184 802BD264 24050001 */ addiu $a1, $zero, 1
/* 317188 802BD268 10650030 */ beq $v1, $a1, .L802BD32C
/* 31718C 802BD26C 28620002 */ slti $v0, $v1, 2
/* 317190 802BD270 10400005 */ beqz $v0, .L802BD288
/* 317194 802BD274 24020002 */ addiu $v0, $zero, 2
/* 317198 802BD278 10600009 */ beqz $v1, .L802BD2A0
/* 31719C 802BD27C 0000102D */ daddu $v0, $zero, $zero
/* 3171A0 802BD280 080AF551 */ j .L802BD544
/* 3171A4 802BD284 00000000 */ nop
.L802BD288:
/* 3171A8 802BD288 1062009A */ beq $v1, $v0, .L802BD4F4
/* 3171AC 802BD28C 24020003 */ addiu $v0, $zero, 3
/* 3171B0 802BD290 106200A0 */ beq $v1, $v0, .L802BD514
/* 3171B4 802BD294 0000102D */ daddu $v0, $zero, $zero
/* 3171B8 802BD298 080AF551 */ j .L802BD544
/* 3171BC 802BD29C 00000000 */ nop
.L802BD2A0:
/* 3171C0 802BD2A0 AC850004 */ sw $a1, 4($a0)
/* 3171C4 802BD2A4 8E220000 */ lw $v0, ($s1)
/* 3171C8 802BD2A8 AC820008 */ sw $v0, 8($a0)
/* 3171CC 802BD2AC C62C0038 */ lwc1 $f12, 0x38($s1)
/* 3171D0 802BD2B0 C62E0040 */ lwc1 $f14, 0x40($s1)
/* 3171D4 802BD2B4 8E460048 */ lw $a2, 0x48($s2)
/* 3171D8 802BD2B8 0C00A7B5 */ jal dist2D
/* 3171DC 802BD2BC 8E470050 */ lw $a3, 0x50($s2)
/* 3171E0 802BD2C0 8E020000 */ lw $v0, ($s0)
/* 3171E4 802BD2C4 46000005 */ abs.s $f0, $f0
/* 3171E8 802BD2C8 E440000C */ swc1 $f0, 0xc($v0)
/* 3171EC 802BD2CC C64C0048 */ lwc1 $f12, 0x48($s2)
/* 3171F0 802BD2D0 C64E0050 */ lwc1 $f14, 0x50($s2)
/* 3171F4 802BD2D4 8E260038 */ lw $a2, 0x38($s1)
/* 3171F8 802BD2D8 0C00A720 */ jal atan2
/* 3171FC 802BD2DC 8E270040 */ lw $a3, 0x40($s1)
/* 317200 802BD2E0 3C040004 */ lui $a0, 4
/* 317204 802BD2E4 24020078 */ addiu $v0, $zero, 0x78
/* 317208 802BD2E8 8E030000 */ lw $v1, ($s0)
/* 31720C 802BD2EC 3C0140C0 */ lui $at, 0x40c0
/* 317210 802BD2F0 44811000 */ mtc1 $at, $f2
/* 317214 802BD2F4 3C014248 */ lui $at, 0x4248
/* 317218 802BD2F8 44812000 */ mtc1 $at, $f4
/* 31721C 802BD2FC 34840148 */ ori $a0, $a0, 0x148
/* 317220 802BD300 E4600010 */ swc1 $f0, 0x10($v1)
/* 317224 802BD304 E4620014 */ swc1 $f2, 0x14($v1)
/* 317228 802BD308 E4640018 */ swc1 $f4, 0x18($v1)
/* 31722C 802BD30C AC620000 */ sw $v0, ($v1)
/* 317230 802BD310 8E220000 */ lw $v0, ($s1)
/* 317234 802BD314 2403FDFF */ addiu $v1, $zero, -0x201
/* 317238 802BD318 00441025 */ or $v0, $v0, $a0
/* 31723C 802BD31C 00431024 */ and $v0, $v0, $v1
/* 317240 802BD320 AE220000 */ sw $v0, ($s1)
2020-11-29 08:13:07 +01:00
/* 317244 802BD324 3C10802C */ lui $s0, %hi(D_802BDD88)
/* 317248 802BD328 2610DD88 */ addiu $s0, $s0, %lo(D_802BDD88)
2020-10-18 04:27:25 +02:00
.L802BD32C:
/* 31724C 802BD32C 8E020000 */ lw $v0, ($s0)
/* 317250 802BD330 3C0140C9 */ lui $at, 0x40c9
/* 317254 802BD334 34210FD0 */ ori $at, $at, 0xfd0
/* 317258 802BD338 44810000 */ mtc1 $at, $f0
/* 31725C 802BD33C C44C0010 */ lwc1 $f12, 0x10($v0)
/* 317260 802BD340 46006302 */ mul.s $f12, $f12, $f0
/* 317264 802BD344 00000000 */ nop
/* 317268 802BD348 27A50010 */ addiu $a1, $sp, 0x10
/* 31726C 802BD34C 3C0143B4 */ lui $at, 0x43b4
/* 317270 802BD350 44810000 */ mtc1 $at, $f0
/* 317274 802BD354 27A60014 */ addiu $a2, $sp, 0x14
/* 317278 802BD358 0C00A82D */ jal sin_cos_rad
/* 31727C 802BD35C 46006303 */ div.s $f12, $f12, $f0
/* 317280 802BD360 8E020000 */ lw $v0, ($s0)
/* 317284 802BD364 C7A20010 */ lwc1 $f2, 0x10($sp)
/* 317288 802BD368 C440000C */ lwc1 $f0, 0xc($v0)
/* 31728C 802BD36C 46001082 */ mul.s $f2, $f2, $f0
/* 317290 802BD370 00000000 */ nop
/* 317294 802BD374 C6400048 */ lwc1 $f0, 0x48($s2)
/* 317298 802BD378 46020000 */ add.s $f0, $f0, $f2
/* 31729C 802BD37C E6200038 */ swc1 $f0, 0x38($s1)
/* 3172A0 802BD380 C7A20014 */ lwc1 $f2, 0x14($sp)
/* 3172A4 802BD384 C440000C */ lwc1 $f0, 0xc($v0)
/* 3172A8 802BD388 46001082 */ mul.s $f2, $f2, $f0
/* 3172AC 802BD38C 00000000 */ nop
/* 3172B0 802BD390 C6400050 */ lwc1 $f0, 0x50($s2)
/* 3172B4 802BD394 46020001 */ sub.s $f0, $f0, $f2
/* 3172B8 802BD398 E6200040 */ swc1 $f0, 0x40($s1)
/* 3172BC 802BD39C C4400010 */ lwc1 $f0, 0x10($v0)
/* 3172C0 802BD3A0 C44C0014 */ lwc1 $f12, 0x14($v0)
/* 3172C4 802BD3A4 0C00A6C9 */ jal clamp_angle
/* 3172C8 802BD3A8 460C0301 */ sub.s $f12, $f0, $f12
/* 3172CC 802BD3AC 8E100000 */ lw $s0, ($s0)
/* 3172D0 802BD3B0 3C0141A0 */ lui $at, 0x41a0
/* 3172D4 802BD3B4 44811000 */ mtc1 $at, $f2
/* 3172D8 802BD3B8 C604000C */ lwc1 $f4, 0xc($s0)
/* 3172DC 802BD3BC 4604103C */ c.lt.s $f2, $f4
/* 3172E0 802BD3C0 00000000 */ nop
/* 3172E4 802BD3C4 45000005 */ bc1f .L802BD3DC
/* 3172E8 802BD3C8 E6000010 */ swc1 $f0, 0x10($s0)
/* 3172EC 802BD3CC 3C013F80 */ lui $at, 0x3f80
/* 3172F0 802BD3D0 44810000 */ mtc1 $at, $f0
/* 3172F4 802BD3D4 080AF502 */ j .L802BD408
/* 3172F8 802BD3D8 46002001 */ sub.s $f0, $f4, $f0
.L802BD3DC:
/* 3172FC 802BD3DC 3C014198 */ lui $at, 0x4198
/* 317300 802BD3E0 44810000 */ mtc1 $at, $f0
/* 317304 802BD3E4 00000000 */ nop
/* 317308 802BD3E8 4600203C */ c.lt.s $f4, $f0
/* 31730C 802BD3EC 00000000 */ nop
/* 317310 802BD3F0 45000006 */ bc1f .L802BD40C
/* 317314 802BD3F4 00000000 */ nop
/* 317318 802BD3F8 3C013F80 */ lui $at, 0x3f80
/* 31731C 802BD3FC 44810000 */ mtc1 $at, $f0
/* 317320 802BD400 00000000 */ nop
/* 317324 802BD404 46002000 */ add.s $f0, $f4, $f0
.L802BD408:
/* 317328 802BD408 E600000C */ swc1 $f0, 0xc($s0)
.L802BD40C:
2020-11-29 08:13:07 +01:00
/* 31732C 802BD40C 3C10802C */ lui $s0, %hi(D_802BDD88)
/* 317330 802BD410 2610DD88 */ addiu $s0, $s0, %lo(D_802BDD88)
2020-10-18 04:27:25 +02:00
/* 317334 802BD414 8E020000 */ lw $v0, ($s0)
/* 317338 802BD418 3C0140C9 */ lui $at, 0x40c9
/* 31733C 802BD41C 34210FD0 */ ori $at, $at, 0xfd0
/* 317340 802BD420 44810000 */ mtc1 $at, $f0
/* 317344 802BD424 C44C0018 */ lwc1 $f12, 0x18($v0)
/* 317348 802BD428 46006302 */ mul.s $f12, $f12, $f0
/* 31734C 802BD42C 00000000 */ nop
/* 317350 802BD430 3C0143B4 */ lui $at, 0x43b4
/* 317354 802BD434 4481A000 */ mtc1 $at, $f20
/* 317358 802BD438 0C00A85B */ jal sin_rad
/* 31735C 802BD43C 46146303 */ div.s $f12, $f12, $f20
/* 317360 802BD440 8E020000 */ lw $v0, ($s0)
/* 317364 802BD444 3C014040 */ lui $at, 0x4040
/* 317368 802BD448 44812000 */ mtc1 $at, $f4
/* 31736C 802BD44C C4420018 */ lwc1 $f2, 0x18($v0)
/* 317370 802BD450 46041080 */ add.s $f2, $f2, $f4
/* 317374 802BD454 3C014316 */ lui $at, 0x4316
/* 317378 802BD458 44813000 */ mtc1 $at, $f6
/* 31737C 802BD45C 00000000 */ nop
/* 317380 802BD460 4602303C */ c.lt.s $f6, $f2
/* 317384 802BD464 E4420018 */ swc1 $f2, 0x18($v0)
/* 317388 802BD468 46040082 */ mul.s $f2, $f0, $f4
/* 31738C 802BD46C 00000000 */ nop
/* 317390 802BD470 45030001 */ bc1tl .L802BD478
/* 317394 802BD474 E4460018 */ swc1 $f6, 0x18($v0)
.L802BD478:
/* 317398 802BD478 C620003C */ lwc1 $f0, 0x3c($s1)
/* 31739C 802BD47C 46020000 */ add.s $f0, $f0, $f2
/* 3173A0 802BD480 8E020000 */ lw $v0, ($s0)
/* 3173A4 802BD484 E620003C */ swc1 $f0, 0x3c($s1)
/* 3173A8 802BD488 C44C0010 */ lwc1 $f12, 0x10($v0)
/* 3173AC 802BD48C 0C00A6C9 */ jal clamp_angle
/* 3173B0 802BD490 460CA301 */ sub.s $f12, $f20, $f12
/* 3173B4 802BD494 8E020000 */ lw $v0, ($s0)
/* 3173B8 802BD498 E6200034 */ swc1 $f0, 0x34($s1)
/* 3173BC 802BD49C C4400014 */ lwc1 $f0, 0x14($v0)
2020-11-29 08:13:07 +01:00
/* 3173C0 802BD4A0 3C01802C */ lui $at, %hi(D_802BDE80)
/* 3173C4 802BD4A4 D422DE80 */ ldc1 $f2, %lo(D_802BDE80)($at)
2020-10-18 04:27:25 +02:00
/* 3173C8 802BD4A8 46000021 */ cvt.d.s $f0, $f0
/* 3173CC 802BD4AC 46220000 */ add.d $f0, $f0, $f2
/* 3173D0 802BD4B0 3C014220 */ lui $at, 0x4220
/* 3173D4 802BD4B4 44811000 */ mtc1 $at, $f2
/* 3173D8 802BD4B8 46200020 */ cvt.s.d $f0, $f0
/* 3173DC 802BD4BC 4600103C */ c.lt.s $f2, $f0
/* 3173E0 802BD4C0 00000000 */ nop
/* 3173E4 802BD4C4 45000002 */ bc1f .L802BD4D0
/* 3173E8 802BD4C8 E4400014 */ swc1 $f0, 0x14($v0)
/* 3173EC 802BD4CC E4420014 */ swc1 $f2, 0x14($v0)
.L802BD4D0:
/* 3173F0 802BD4D0 8E030000 */ lw $v1, ($s0)
/* 3173F4 802BD4D4 8C620000 */ lw $v0, ($v1)
/* 3173F8 802BD4D8 2442FFFF */ addiu $v0, $v0, -1
/* 3173FC 802BD4DC 14400018 */ bnez $v0, .L802BD540
/* 317400 802BD4E0 AC620000 */ sw $v0, ($v1)
/* 317404 802BD4E4 8C620004 */ lw $v0, 4($v1)
/* 317408 802BD4E8 24420001 */ addiu $v0, $v0, 1
/* 31740C 802BD4EC 080AF550 */ j .L802BD540
/* 317410 802BD4F0 AC620004 */ sw $v0, 4($v1)
.L802BD4F4:
/* 317414 802BD4F4 8C820008 */ lw $v0, 8($a0)
/* 317418 802BD4F8 AE220000 */ sw $v0, ($s1)
/* 31741C 802BD4FC 8C820004 */ lw $v0, 4($a0)
/* 317420 802BD500 2403001E */ addiu $v1, $zero, 0x1e
/* 317424 802BD504 AC830000 */ sw $v1, ($a0)
/* 317428 802BD508 24420001 */ addiu $v0, $v0, 1
/* 31742C 802BD50C 080AF550 */ j .L802BD540
/* 317430 802BD510 AC820004 */ sw $v0, 4($a0)
.L802BD514:
/* 317434 802BD514 0C03AE8F */ jal func_800EBA3C
/* 317438 802BD518 0220202D */ daddu $a0, $s1, $zero
/* 31743C 802BD51C 0C03AED0 */ jal func_800EBB40
/* 317440 802BD520 0220202D */ daddu $a0, $s1, $zero
/* 317444 802BD524 8E030000 */ lw $v1, ($s0)
/* 317448 802BD528 8C620000 */ lw $v0, ($v1)
/* 31744C 802BD52C 2442FFFF */ addiu $v0, $v0, -1
/* 317450 802BD530 14400003 */ bnez $v0, .L802BD540
/* 317454 802BD534 AC620000 */ sw $v0, ($v1)
/* 317458 802BD538 AC600004 */ sw $zero, 4($v1)
/* 31745C 802BD53C AE600000 */ sw $zero, ($s3)
.L802BD540:
/* 317460 802BD540 0000102D */ daddu $v0, $zero, $zero
.L802BD544:
/* 317464 802BD544 8FBF0028 */ lw $ra, 0x28($sp)
/* 317468 802BD548 8FB30024 */ lw $s3, 0x24($sp)
/* 31746C 802BD54C 8FB20020 */ lw $s2, 0x20($sp)
/* 317470 802BD550 8FB1001C */ lw $s1, 0x1c($sp)
/* 317474 802BD554 8FB00018 */ lw $s0, 0x18($sp)
/* 317478 802BD558 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 31747C 802BD55C 03E00008 */ jr $ra
/* 317480 802BD560 27BD0038 */ addiu $sp, $sp, 0x38