papermario/asm/nonmatchings/battle/area_kzn/58C2F0/func_80218000_58C2F0.s
2020-12-28 14:34:30 +09:00

85 lines
4.2 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80218000_58C2F0
/* 58C2F0 80218000 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 58C2F4 80218004 AFB20020 */ sw $s2, 0x20($sp)
/* 58C2F8 80218008 0080902D */ daddu $s2, $a0, $zero
/* 58C2FC 8021800C AFBF0024 */ sw $ra, 0x24($sp)
/* 58C300 80218010 AFB1001C */ sw $s1, 0x1c($sp)
/* 58C304 80218014 AFB00018 */ sw $s0, 0x18($sp)
/* 58C308 80218018 8E440148 */ lw $a0, 0x148($s2)
/* 58C30C 8021801C 0C09A75B */ jal get_actor
/* 58C310 80218020 00A0802D */ daddu $s0, $a1, $zero
/* 58C314 80218024 1200002D */ beqz $s0, .L802180DC
/* 58C318 80218028 0040882D */ daddu $s1, $v0, $zero
/* 58C31C 8021802C C6220018 */ lwc1 $f2, 0x18($s1)
/* 58C320 80218030 C6200144 */ lwc1 $f0, 0x144($s1)
/* 58C324 80218034 46001081 */ sub.s $f2, $f2, $f0
/* 58C328 80218038 46021082 */ mul.s $f2, $f2, $f2
/* 58C32C 8021803C 00000000 */ nop
/* 58C330 80218040 C626001C */ lwc1 $f6, 0x1c($s1)
/* 58C334 80218044 C6200148 */ lwc1 $f0, 0x148($s1)
/* 58C338 80218048 46003181 */ sub.s $f6, $f6, $f0
/* 58C33C 8021804C 46063182 */ mul.s $f6, $f6, $f6
/* 58C340 80218050 00000000 */ nop
/* 58C344 80218054 C624014C */ lwc1 $f4, 0x14c($s1)
/* 58C348 80218058 C6200020 */ lwc1 $f0, 0x20($s1)
/* 58C34C 8021805C 46040001 */ sub.s $f0, $f0, $f4
/* 58C350 80218060 46000002 */ mul.s $f0, $f0, $f0
/* 58C354 80218064 00000000 */ nop
/* 58C358 80218068 46061080 */ add.s $f2, $f2, $f6
/* 58C35C 8021806C 46001300 */ add.s $f12, $f2, $f0
/* 58C360 80218070 46006104 */ sqrt.s $f4, $f12
/* 58C364 80218074 46042032 */ c.eq.s $f4, $f4
/* 58C368 80218078 00000000 */ nop
/* 58C36C 8021807C 45010004 */ bc1t .L80218090
/* 58C370 80218080 00000000 */ nop
/* 58C374 80218084 0C0187BC */ jal sqrtf
/* 58C378 80218088 00000000 */ nop
/* 58C37C 8021808C 46000106 */ mov.s $f4, $f0
.L80218090:
/* 58C380 80218090 C620004C */ lwc1 $f0, 0x4c($s1)
/* 58C384 80218094 3C013F00 */ lui $at, 0x3f00
/* 58C388 80218098 44811000 */ mtc1 $at, $f2
/* 58C38C 8021809C 46002003 */ div.s $f0, $f4, $f0
/* 58C390 802180A0 46020002 */ mul.s $f0, $f0, $f2
/* 58C394 802180A4 00000000 */ nop
/* 58C398 802180A8 3C013F80 */ lui $at, 0x3f80
/* 58C39C 802180AC 44811000 */ mtc1 $at, $f2
/* 58C3A0 802180B0 00000000 */ nop
/* 58C3A4 802180B4 46020000 */ add.s $f0, $f0, $f2
/* 58C3A8 802180B8 4600020D */ trunc.w.s $f8, $f0
/* 58C3AC 802180BC E6480070 */ swc1 $f8, 0x70($s2)
/* 58C3B0 802180C0 C620014C */ lwc1 $f0, 0x14c($s1)
/* 58C3B4 802180C4 24040359 */ addiu $a0, $zero, 0x359
/* 58C3B8 802180C8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 58C3BC 802180CC 8E260144 */ lw $a2, 0x144($s1)
/* 58C3C0 802180D0 8E270148 */ lw $a3, 0x148($s1)
/* 58C3C4 802180D4 0C052757 */ jal play_sound_at_position
/* 58C3C8 802180D8 0000282D */ daddu $a1, $zero, $zero
.L802180DC:
/* 58C3CC 802180DC 8E420070 */ lw $v0, 0x70($s2)
/* 58C3D0 802180E0 0040182D */ daddu $v1, $v0, $zero
/* 58C3D4 802180E4 2442FFFF */ addiu $v0, $v0, -1
/* 58C3D8 802180E8 1C60000A */ bgtz $v1, .L80218114
/* 58C3DC 802180EC AE420070 */ sw $v0, 0x70($s2)
/* 58C3E0 802180F0 C620014C */ lwc1 $f0, 0x14c($s1)
/* 58C3E4 802180F4 24040759 */ addiu $a0, $zero, 0x759
/* 58C3E8 802180F8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 58C3EC 802180FC 8E260144 */ lw $a2, 0x144($s1)
/* 58C3F0 80218100 8E270148 */ lw $a3, 0x148($s1)
/* 58C3F4 80218104 0C052757 */ jal play_sound_at_position
/* 58C3F8 80218108 0000282D */ daddu $a1, $zero, $zero
/* 58C3FC 8021810C 08086046 */ j .L80218118
/* 58C400 80218110 24020002 */ addiu $v0, $zero, 2
.L80218114:
/* 58C404 80218114 0000102D */ daddu $v0, $zero, $zero
.L80218118:
/* 58C408 80218118 8FBF0024 */ lw $ra, 0x24($sp)
/* 58C40C 8021811C 8FB20020 */ lw $s2, 0x20($sp)
/* 58C410 80218120 8FB1001C */ lw $s1, 0x1c($sp)
/* 58C414 80218124 8FB00018 */ lw $s0, 0x18($sp)
/* 58C418 80218128 03E00008 */ jr $ra
/* 58C41C 8021812C 27BD0028 */ addiu $sp, $sp, 0x28