papermario/asm/nonmatchings/battle/area_kpa2/69F320/func_80219444_6A0644.s
2020-12-28 14:34:30 +09:00

259 lines
13 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80219444_6A0644
/* 6A0644 80219444 27BDFFA8 */ addiu $sp, $sp, -0x58
/* 6A0648 80219448 AFB1001C */ sw $s1, 0x1c($sp)
/* 6A064C 8021944C 0080882D */ daddu $s1, $a0, $zero
/* 6A0650 80219450 AFB20020 */ sw $s2, 0x20($sp)
/* 6A0654 80219454 AFBF002C */ sw $ra, 0x2c($sp)
/* 6A0658 80219458 AFB40028 */ sw $s4, 0x28($sp)
/* 6A065C 8021945C AFB30024 */ sw $s3, 0x24($sp)
/* 6A0660 80219460 AFB00018 */ sw $s0, 0x18($sp)
/* 6A0664 80219464 F7BC0050 */ sdc1 $f28, 0x50($sp)
/* 6A0668 80219468 F7BA0048 */ sdc1 $f26, 0x48($sp)
/* 6A066C 8021946C F7B80040 */ sdc1 $f24, 0x40($sp)
/* 6A0670 80219470 F7B60038 */ sdc1 $f22, 0x38($sp)
/* 6A0674 80219474 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 6A0678 80219478 8E240148 */ lw $a0, 0x148($s1)
/* 6A067C 8021947C 8E30000C */ lw $s0, 0xc($s1)
/* 6A0680 80219480 0C09A75B */ jal get_actor
/* 6A0684 80219484 00A0902D */ daddu $s2, $a1, $zero
/* 6A0688 80219488 0040982D */ daddu $s3, $v0, $zero
/* 6A068C 8021948C 126000D5 */ beqz $s3, .L802197E4
/* 6A0690 80219490 24020002 */ addiu $v0, $zero, 2
/* 6A0694 80219494 1240003C */ beqz $s2, .L80219588
/* 6A0698 80219498 0220202D */ daddu $a0, $s1, $zero
/* 6A069C 8021949C 8E050000 */ lw $a1, ($s0)
/* 6A06A0 802194A0 26100004 */ addiu $s0, $s0, 4
/* 6A06A4 802194A4 0C0B1EAF */ jal get_variable
/* 6A06A8 802194A8 0000902D */ daddu $s2, $zero, $zero
/* 6A06AC 802194AC 8E050000 */ lw $a1, ($s0)
/* 6A06B0 802194B0 26100004 */ addiu $s0, $s0, 4
/* 6A06B4 802194B4 4482E000 */ mtc1 $v0, $f28
/* 6A06B8 802194B8 00000000 */ nop
/* 6A06BC 802194BC 4680E720 */ cvt.s.w $f28, $f28
/* 6A06C0 802194C0 0C0B1EAF */ jal get_variable
/* 6A06C4 802194C4 0220202D */ daddu $a0, $s1, $zero
/* 6A06C8 802194C8 8E050000 */ lw $a1, ($s0)
/* 6A06CC 802194CC 26100004 */ addiu $s0, $s0, 4
/* 6A06D0 802194D0 4482D000 */ mtc1 $v0, $f26
/* 6A06D4 802194D4 00000000 */ nop
/* 6A06D8 802194D8 4680D6A0 */ cvt.s.w $f26, $f26
/* 6A06DC 802194DC 0C0B1EAF */ jal get_variable
/* 6A06E0 802194E0 0220202D */ daddu $a0, $s1, $zero
/* 6A06E4 802194E4 8E050000 */ lw $a1, ($s0)
/* 6A06E8 802194E8 26100004 */ addiu $s0, $s0, 4
/* 6A06EC 802194EC 4482C000 */ mtc1 $v0, $f24
/* 6A06F0 802194F0 00000000 */ nop
/* 6A06F4 802194F4 4680C620 */ cvt.s.w $f24, $f24
/* 6A06F8 802194F8 0C0B210B */ jal get_float_variable
/* 6A06FC 802194FC 0220202D */ daddu $a0, $s1, $zero
/* 6A0700 80219500 0220202D */ daddu $a0, $s1, $zero
/* 6A0704 80219504 8E050000 */ lw $a1, ($s0)
/* 6A0708 80219508 0C0B210B */ jal get_float_variable
/* 6A070C 8021950C 46000506 */ mov.s $f20, $f0
/* 6A0710 80219510 240400B4 */ addiu $a0, $zero, 0xb4
/* 6A0714 80219514 0C00AB39 */ jal heap_malloc
/* 6A0718 80219518 46000586 */ mov.s $f22, $f0
/* 6A071C 8021951C 0040882D */ daddu $s1, $v0, $zero
/* 6A0720 80219520 24060028 */ addiu $a2, $zero, 0x28
/* 6A0724 80219524 240500FF */ addiu $a1, $zero, 0xff
/* 6A0728 80219528 24040001 */ addiu $a0, $zero, 1
/* 6A072C 8021952C 26230038 */ addiu $v1, $s1, 0x38
/* 6A0730 80219530 AE710078 */ sw $s1, 0x78($s3)
.L80219534:
/* 6A0734 80219534 E47CFFCC */ swc1 $f28, -0x34($v1)
/* 6A0738 80219538 E47AFFD0 */ swc1 $f26, -0x30($v1)
/* 6A073C 8021953C E478FFD4 */ swc1 $f24, -0x2c($v1)
/* 6A0740 80219540 E474FFE0 */ swc1 $f20, -0x20($v1)
/* 6A0744 80219544 E474FFD8 */ swc1 $f20, -0x28($v1)
/* 6A0748 80219548 E476FFDC */ swc1 $f22, -0x24($v1)
/* 6A074C 8021954C AC64FFE4 */ sw $a0, -0x1c($v1)
/* 6A0750 80219550 AC66FFE8 */ sw $a2, -0x18($v1)
/* 6A0754 80219554 AC65FFEC */ sw $a1, -0x14($v1)
/* 6A0758 80219558 AC65FFF0 */ sw $a1, -0x10($v1)
/* 6A075C 8021955C AC60FFF4 */ sw $zero, -0xc($v1)
/* 6A0760 80219560 AC60FFF8 */ sw $zero, -8($v1)
/* 6A0764 80219564 AC60FFFC */ sw $zero, -4($v1)
/* 6A0768 80219568 AC600000 */ sw $zero, ($v1)
/* 6A076C 8021956C 2463003C */ addiu $v1, $v1, 0x3c
/* 6A0770 80219570 26520001 */ addiu $s2, $s2, 1
/* 6A0774 80219574 2A420003 */ slti $v0, $s2, 3
/* 6A0778 80219578 1440FFEE */ bnez $v0, .L80219534
/* 6A077C 8021957C 2484000A */ addiu $a0, $a0, 0xa
/* 6A0780 80219580 080865F9 */ j .L802197E4
/* 6A0784 80219584 0000102D */ daddu $v0, $zero, $zero
.L80219588:
/* 6A0788 80219588 0000A02D */ daddu $s4, $zero, $zero
/* 6A078C 8021958C 0280902D */ daddu $s2, $s4, $zero
/* 6A0790 80219590 8E710078 */ lw $s1, 0x78($s3)
/* 6A0794 80219594 3C013DCC */ lui $at, 0x3dcc
/* 6A0798 80219598 3421CCCD */ ori $at, $at, 0xcccd
/* 6A079C 8021959C 4481C000 */ mtc1 $at, $f24
/* 6A07A0 802195A0 3C013F00 */ lui $at, 0x3f00
/* 6A07A4 802195A4 4481B000 */ mtc1 $at, $f22
/* 6A07A8 802195A8 3C01437F */ lui $at, 0x437f
/* 6A07AC 802195AC 4481A000 */ mtc1 $at, $f20
/* 6A07B0 802195B0 26300028 */ addiu $s0, $s1, 0x28
.L802195B4:
/* 6A07B4 802195B4 8E02FFF4 */ lw $v0, -0xc($s0)
/* 6A07B8 802195B8 1840001C */ blez $v0, .L8021962C
/* 6A07BC 802195BC 2442FFFF */ addiu $v0, $v0, -1
/* 6A07C0 802195C0 1C40007D */ bgtz $v0, .L802197B8
/* 6A07C4 802195C4 AE02FFF4 */ sw $v0, -0xc($s0)
/* 6A07C8 802195C8 C600FFF0 */ lwc1 $f0, -0x10($s0)
/* 6A07CC 802195CC 2402FFFF */ addiu $v0, $zero, -1
/* 6A07D0 802195D0 AFA20014 */ sw $v0, 0x14($sp)
/* 6A07D4 802195D4 E7A00010 */ swc1 $f0, 0x10($sp)
/* 6A07D8 802195D8 8E05FFDC */ lw $a1, -0x24($s0)
/* 6A07DC 802195DC 8E06FFE0 */ lw $a2, -0x20($s0)
/* 6A07E0 802195E0 8E07FFE4 */ lw $a3, -0x1c($s0)
/* 6A07E4 802195E4 0C01CA9C */ jal func_80072A70
/* 6A07E8 802195E8 0000202D */ daddu $a0, $zero, $zero
/* 6A07EC 802195EC AE220000 */ sw $v0, ($s1)
/* 6A07F0 802195F0 8C42000C */ lw $v0, 0xc($v0)
/* 6A07F4 802195F4 C6000004 */ lwc1 $f0, 4($s0)
/* 6A07F8 802195F8 E440003C */ swc1 $f0, 0x3c($v0)
/* 6A07FC 802195FC 8E220000 */ lw $v0, ($s1)
/* 6A0800 80219600 C6000008 */ lwc1 $f0, 8($s0)
/* 6A0804 80219604 8C42000C */ lw $v0, 0xc($v0)
/* 6A0808 80219608 E4400040 */ swc1 $f0, 0x40($v0)
/* 6A080C 8021960C 8E220000 */ lw $v0, ($s1)
/* 6A0810 80219610 C600000C */ lwc1 $f0, 0xc($s0)
/* 6A0814 80219614 8C42000C */ lw $v0, 0xc($v0)
/* 6A0818 80219618 E4400044 */ swc1 $f0, 0x44($v0)
/* 6A081C 8021961C 8E220000 */ lw $v0, ($s1)
/* 6A0820 80219620 8C42000C */ lw $v0, 0xc($v0)
/* 6A0824 80219624 080865EE */ j .L802197B8
/* 6A0828 80219628 A4400000 */ sh $zero, ($v0)
.L8021962C:
/* 6A082C 8021962C 8E020010 */ lw $v0, 0x10($s0)
/* 6A0830 80219630 10400003 */ beqz $v0, .L80219640
/* 6A0834 80219634 00000000 */ nop
/* 6A0838 80219638 080865EE */ j .L802197B8
/* 6A083C 8021963C 26940001 */ addiu $s4, $s4, 1
.L80219640:
/* 6A0840 80219640 C600FFE8 */ lwc1 $f0, -0x18($s0)
/* 6A0844 80219644 C608FFEC */ lwc1 $f8, -0x14($s0)
/* 6A0848 80219648 46080001 */ sub.s $f0, $f0, $f8
/* 6A084C 8021964C C602FFF8 */ lwc1 $f2, -8($s0)
/* 6A0850 80219650 468010A0 */ cvt.s.w $f2, $f2
/* 6A0854 80219654 46000005 */ abs.s $f0, $f0
/* 6A0858 80219658 46020002 */ mul.s $f0, $f0, $f2
/* 6A085C 8021965C 00000000 */ nop
/* 6A0860 80219660 C606000C */ lwc1 $f6, 0xc($s0)
/* 6A0864 80219664 3C014110 */ lui $at, 0x4110
/* 6A0868 80219668 44811000 */ mtc1 $at, $f2
/* 6A086C 8021966C 3C014220 */ lui $at, 0x4220
/* 6A0870 80219670 44812000 */ mtc1 $at, $f4
/* 6A0874 80219674 46023180 */ add.s $f6, $f6, $f2
/* 6A0878 80219678 8E03FFF8 */ lw $v1, -8($s0)
/* 6A087C 8021967C 46040003 */ div.s $f0, $f0, $f4
/* 6A0880 80219680 46080000 */ add.s $f0, $f0, $f8
/* 6A0884 80219684 2862000B */ slti $v0, $v1, 0xb
/* 6A0888 80219688 E606000C */ swc1 $f6, 0xc($s0)
/* 6A088C 8021968C 1040001C */ beqz $v0, .L80219700
/* 6A0890 80219690 E600FFF0 */ swc1 $f0, -0x10($s0)
/* 6A0894 80219694 000317C2 */ srl $v0, $v1, 0x1f
/* 6A0898 80219698 00621021 */ addu $v0, $v1, $v0
/* 6A089C 8021969C 00021043 */ sra $v0, $v0, 1
/* 6A08A0 802196A0 44821000 */ mtc1 $v0, $f2
/* 6A08A4 802196A4 00000000 */ nop
/* 6A08A8 802196A8 468010A0 */ cvt.s.w $f2, $f2
/* 6A08AC 802196AC 0060102D */ daddu $v0, $v1, $zero
/* 6A08B0 802196B0 46181082 */ mul.s $f2, $f2, $f24
/* 6A08B4 802196B4 00000000 */ nop
/* 6A08B8 802196B8 00021FC2 */ srl $v1, $v0, 0x1f
/* 6A08BC 802196BC 00431021 */ addu $v0, $v0, $v1
/* 6A08C0 802196C0 00021043 */ sra $v0, $v0, 1
/* 6A08C4 802196C4 44820000 */ mtc1 $v0, $f0
/* 6A08C8 802196C8 00000000 */ nop
/* 6A08CC 802196CC 46800020 */ cvt.s.w $f0, $f0
/* 6A08D0 802196D0 46180002 */ mul.s $f0, $f0, $f24
/* 6A08D4 802196D4 00000000 */ nop
/* 6A08D8 802196D8 46161080 */ add.s $f2, $f2, $f22
/* 6A08DC 802196DC 46141082 */ mul.s $f2, $f2, $f20
/* 6A08E0 802196E0 00000000 */ nop
/* 6A08E4 802196E4 46160000 */ add.s $f0, $f0, $f22
/* 6A08E8 802196E8 46140002 */ mul.s $f0, $f0, $f20
/* 6A08EC 802196EC 00000000 */ nop
/* 6A08F0 802196F0 4600128D */ trunc.w.s $f10, $f2
/* 6A08F4 802196F4 E60AFFFC */ swc1 $f10, -4($s0)
/* 6A08F8 802196F8 4600028D */ trunc.w.s $f10, $f0
/* 6A08FC 802196FC E60A0000 */ swc1 $f10, ($s0)
.L80219700:
/* 6A0900 80219700 8E02FFF8 */ lw $v0, -8($s0)
/* 6A0904 80219704 2442FFFF */ addiu $v0, $v0, -1
/* 6A0908 80219708 1C400007 */ bgtz $v0, .L80219728
/* 6A090C 8021970C AE02FFF8 */ sw $v0, -8($s0)
/* 6A0910 80219710 8E240000 */ lw $a0, ($s1)
/* 6A0914 80219714 0C016914 */ jal remove_effect
/* 6A0918 80219718 00000000 */ nop
/* 6A091C 8021971C 24020001 */ addiu $v0, $zero, 1
/* 6A0920 80219720 080865EE */ j .L802197B8
/* 6A0924 80219724 AE020010 */ sw $v0, 0x10($s0)
.L80219728:
/* 6A0928 80219728 8E220000 */ lw $v0, ($s1)
/* 6A092C 8021972C C600FFDC */ lwc1 $f0, -0x24($s0)
/* 6A0930 80219730 8C42000C */ lw $v0, 0xc($v0)
/* 6A0934 80219734 E4400004 */ swc1 $f0, 4($v0)
/* 6A0938 80219738 8E220000 */ lw $v0, ($s1)
/* 6A093C 8021973C C600FFE0 */ lwc1 $f0, -0x20($s0)
/* 6A0940 80219740 8C42000C */ lw $v0, 0xc($v0)
/* 6A0944 80219744 E4400008 */ swc1 $f0, 8($v0)
/* 6A0948 80219748 8E220000 */ lw $v0, ($s1)
/* 6A094C 8021974C C600FFE4 */ lwc1 $f0, -0x1c($s0)
/* 6A0950 80219750 8C42000C */ lw $v0, 0xc($v0)
/* 6A0954 80219754 E440000C */ swc1 $f0, 0xc($v0)
/* 6A0958 80219758 8E220000 */ lw $v0, ($s1)
/* 6A095C 8021975C C6000004 */ lwc1 $f0, 4($s0)
/* 6A0960 80219760 8C42000C */ lw $v0, 0xc($v0)
/* 6A0964 80219764 E440003C */ swc1 $f0, 0x3c($v0)
/* 6A0968 80219768 8E220000 */ lw $v0, ($s1)
/* 6A096C 8021976C C6000008 */ lwc1 $f0, 8($s0)
/* 6A0970 80219770 8C42000C */ lw $v0, 0xc($v0)
/* 6A0974 80219774 E4400040 */ swc1 $f0, 0x40($v0)
/* 6A0978 80219778 8E220000 */ lw $v0, ($s1)
/* 6A097C 8021977C C600000C */ lwc1 $f0, 0xc($s0)
/* 6A0980 80219780 8C42000C */ lw $v0, 0xc($v0)
/* 6A0984 80219784 E4400044 */ swc1 $f0, 0x44($v0)
/* 6A0988 80219788 8E220000 */ lw $v0, ($s1)
/* 6A098C 8021978C C600FFF0 */ lwc1 $f0, -0x10($s0)
/* 6A0990 80219790 8C42000C */ lw $v0, 0xc($v0)
/* 6A0994 80219794 E4400038 */ swc1 $f0, 0x38($v0)
/* 6A0998 80219798 8E220000 */ lw $v0, ($s1)
/* 6A099C 8021979C 8C43000C */ lw $v1, 0xc($v0)
/* 6A09A0 802197A0 8E02FFFC */ lw $v0, -4($s0)
/* 6A09A4 802197A4 AC620024 */ sw $v0, 0x24($v1)
/* 6A09A8 802197A8 8E220000 */ lw $v0, ($s1)
/* 6A09AC 802197AC 8C43000C */ lw $v1, 0xc($v0)
/* 6A09B0 802197B0 8E020000 */ lw $v0, ($s0)
/* 6A09B4 802197B4 AC620034 */ sw $v0, 0x34($v1)
.L802197B8:
/* 6A09B8 802197B8 2610003C */ addiu $s0, $s0, 0x3c
/* 6A09BC 802197BC 26520001 */ addiu $s2, $s2, 1
/* 6A09C0 802197C0 2A420003 */ slti $v0, $s2, 3
/* 6A09C4 802197C4 1440FF7B */ bnez $v0, .L802195B4
/* 6A09C8 802197C8 2631003C */ addiu $s1, $s1, 0x3c
/* 6A09CC 802197CC 2A820003 */ slti $v0, $s4, 3
/* 6A09D0 802197D0 14400004 */ bnez $v0, .L802197E4
/* 6A09D4 802197D4 0000102D */ daddu $v0, $zero, $zero
/* 6A09D8 802197D8 0C00AB4B */ jal heap_free
/* 6A09DC 802197DC 0220202D */ daddu $a0, $s1, $zero
/* 6A09E0 802197E0 24020002 */ addiu $v0, $zero, 2
.L802197E4:
/* 6A09E4 802197E4 8FBF002C */ lw $ra, 0x2c($sp)
/* 6A09E8 802197E8 8FB40028 */ lw $s4, 0x28($sp)
/* 6A09EC 802197EC 8FB30024 */ lw $s3, 0x24($sp)
/* 6A09F0 802197F0 8FB20020 */ lw $s2, 0x20($sp)
/* 6A09F4 802197F4 8FB1001C */ lw $s1, 0x1c($sp)
/* 6A09F8 802197F8 8FB00018 */ lw $s0, 0x18($sp)
/* 6A09FC 802197FC D7BC0050 */ ldc1 $f28, 0x50($sp)
/* 6A0A00 80219800 D7BA0048 */ ldc1 $f26, 0x48($sp)
/* 6A0A04 80219804 D7B80040 */ ldc1 $f24, 0x40($sp)
/* 6A0A08 80219808 D7B60038 */ ldc1 $f22, 0x38($sp)
/* 6A0A0C 8021980C D7B40030 */ ldc1 $f20, 0x30($sp)
/* 6A0A10 80219810 03E00008 */ jr $ra
/* 6A0A14 80219814 27BD0058 */ addiu $sp, $sp, 0x58