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

255 lines
13 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_8021A318_6A1518
/* 6A1518 8021A318 27BDFF58 */ addiu $sp, $sp, -0xa8
/* 6A151C 8021A31C AFB30074 */ sw $s3, 0x74($sp)
/* 6A1520 8021A320 0080982D */ daddu $s3, $a0, $zero
/* 6A1524 8021A324 AFBF0088 */ sw $ra, 0x88($sp)
/* 6A1528 8021A328 AFB70084 */ sw $s7, 0x84($sp)
/* 6A152C 8021A32C AFB60080 */ sw $s6, 0x80($sp)
/* 6A1530 8021A330 AFB5007C */ sw $s5, 0x7c($sp)
/* 6A1534 8021A334 AFB40078 */ sw $s4, 0x78($sp)
/* 6A1538 8021A338 AFB20070 */ sw $s2, 0x70($sp)
/* 6A153C 8021A33C AFB1006C */ sw $s1, 0x6c($sp)
/* 6A1540 8021A340 AFB00068 */ sw $s0, 0x68($sp)
/* 6A1544 8021A344 F7B800A0 */ sdc1 $f24, 0xa0($sp)
/* 6A1548 8021A348 F7B60098 */ sdc1 $f22, 0x98($sp)
/* 6A154C 8021A34C F7B40090 */ sdc1 $f20, 0x90($sp)
/* 6A1550 8021A350 8E640148 */ lw $a0, 0x148($s3)
/* 6A1554 8021A354 0C09A75B */ jal get_actor
/* 6A1558 8021A358 00A0802D */ daddu $s0, $a1, $zero
/* 6A155C 8021A35C 14400003 */ bnez $v0, .L8021A36C
/* 6A1560 8021A360 0040202D */ daddu $a0, $v0, $zero
/* 6A1564 8021A364 080869A1 */ j .L8021A684
/* 6A1568 8021A368 24020002 */ addiu $v0, $zero, 2
.L8021A36C:
/* 6A156C 8021A36C 0C099117 */ jal get_actor_part
/* 6A1570 8021A370 24050001 */ addiu $a1, $zero, 1
/* 6A1574 8021A374 12000013 */ beqz $s0, .L8021A3C4
/* 6A1578 8021A378 0040A82D */ daddu $s5, $v0, $zero
/* 6A157C 8021A37C 0000802D */ daddu $s0, $zero, $zero
/* 6A1580 8021A380 241100FF */ addiu $s1, $zero, 0xff
/* 6A1584 8021A384 AE600074 */ sw $zero, 0x74($s3)
/* 6A1588 8021A388 AE600078 */ sw $zero, 0x78($s3)
/* 6A158C 8021A38C AE600070 */ sw $zero, 0x70($s3)
/* 6A1590 8021A390 0200282D */ daddu $a1, $s0, $zero
.L8021A394:
/* 6A1594 8021A394 24060011 */ addiu $a2, $zero, 0x11
/* 6A1598 8021A398 24070014 */ addiu $a3, $zero, 0x14
/* 6A159C 8021A39C AFA00010 */ sw $zero, 0x10($sp)
/* 6A15A0 8021A3A0 AFA00014 */ sw $zero, 0x14($sp)
/* 6A15A4 8021A3A4 AFB10018 */ sw $s1, 0x18($sp)
/* 6A15A8 8021A3A8 AFA0001C */ sw $zero, 0x1c($sp)
/* 6A15AC 8021A3AC 8EA40084 */ lw $a0, 0x84($s5)
/* 6A15B0 8021A3B0 0C0B79E0 */ jal func_802DE780
/* 6A15B4 8021A3B4 26100001 */ addiu $s0, $s0, 1
/* 6A15B8 8021A3B8 2A02000A */ slti $v0, $s0, 0xa
/* 6A15BC 8021A3BC 1440FFF5 */ bnez $v0, .L8021A394
/* 6A15C0 8021A3C0 0200282D */ daddu $a1, $s0, $zero
.L8021A3C4:
/* 6A15C4 8021A3C4 8E620074 */ lw $v0, 0x74($s3)
/* 6A15C8 8021A3C8 2444000A */ addiu $a0, $v0, 0xa
/* 6A15CC 8021A3CC 28820168 */ slti $v0, $a0, 0x168
/* 6A15D0 8021A3D0 14400010 */ bnez $v0, .L8021A414
/* 6A15D4 8021A3D4 AE640074 */ sw $a0, 0x74($s3)
/* 6A15D8 8021A3D8 3C02B60B */ lui $v0, 0xb60b
/* 6A15DC 8021A3DC 344260B7 */ ori $v0, $v0, 0x60b7
/* 6A15E0 8021A3E0 00820018 */ mult $a0, $v0
/* 6A15E4 8021A3E4 00041FC3 */ sra $v1, $a0, 0x1f
/* 6A15E8 8021A3E8 00004010 */ mfhi $t0
/* 6A15EC 8021A3EC 01041021 */ addu $v0, $t0, $a0
/* 6A15F0 8021A3F0 00021203 */ sra $v0, $v0, 8
/* 6A15F4 8021A3F4 00431023 */ subu $v0, $v0, $v1
/* 6A15F8 8021A3F8 00021840 */ sll $v1, $v0, 1
/* 6A15FC 8021A3FC 00621821 */ addu $v1, $v1, $v0
/* 6A1600 8021A400 00031100 */ sll $v0, $v1, 4
/* 6A1604 8021A404 00431023 */ subu $v0, $v0, $v1
/* 6A1608 8021A408 000210C0 */ sll $v0, $v0, 3
/* 6A160C 8021A40C 00821023 */ subu $v0, $a0, $v0
/* 6A1610 8021A410 AE620074 */ sw $v0, 0x74($s3)
.L8021A414:
/* 6A1614 8021A414 0000882D */ daddu $s1, $zero, $zero
/* 6A1618 8021A418 3C128000 */ lui $s2, 0x8000
/* 6A161C 8021A41C 0220802D */ daddu $s0, $s1, $zero
/* 6A1620 8021A420 3C013FF0 */ lui $at, 0x3ff0
/* 6A1624 8021A424 4481C800 */ mtc1 $at, $f25
/* 6A1628 8021A428 4480C000 */ mtc1 $zero, $f24
/* 6A162C 8021A42C 3C01404C */ lui $at, 0x404c
/* 6A1630 8021A430 4481B800 */ mtc1 $at, $f23
/* 6A1634 8021A434 4480B000 */ mtc1 $zero, $f22
/* 6A1638 8021A438 3C0141E0 */ lui $at, 0x41e0
/* 6A163C 8021A43C 4481A800 */ mtc1 $at, $f21
/* 6A1640 8021A440 4480A000 */ mtc1 $zero, $f20
.L8021A444:
/* 6A1644 8021A444 96640076 */ lhu $a0, 0x76($s3)
/* 6A1648 8021A448 00902021 */ addu $a0, $a0, $s0
/* 6A164C 8021A44C 24840078 */ addiu $a0, $a0, 0x78
/* 6A1650 8021A450 00042400 */ sll $a0, $a0, 0x10
/* 6A1654 8021A454 0C00A4F5 */ jal cosine
/* 6A1658 8021A458 00042403 */ sra $a0, $a0, 0x10
/* 6A165C 8021A45C 46000021 */ cvt.d.s $f0, $f0
/* 6A1660 8021A460 46380000 */ add.d $f0, $f0, $f24
/* 6A1664 8021A464 46360002 */ mul.d $f0, $f0, $f22
/* 6A1668 8021A468 00000000 */ nop
/* 6A166C 8021A46C 27A20020 */ addiu $v0, $sp, 0x20
/* 6A1670 8021A470 4620A03E */ c.le.d $f20, $f0
/* 6A1674 8021A474 00000000 */ nop
/* 6A1678 8021A478 45010005 */ bc1t .L8021A490
/* 6A167C 8021A47C 00511021 */ addu $v0, $v0, $s1
/* 6A1680 8021A480 4620008D */ trunc.w.d $f2, $f0
/* 6A1684 8021A484 44031000 */ mfc1 $v1, $f2
/* 6A1688 8021A488 0808692A */ j .L8021A4A8
/* 6A168C 8021A48C A0430000 */ sb $v1, ($v0)
.L8021A490:
/* 6A1690 8021A490 46340001 */ sub.d $f0, $f0, $f20
/* 6A1694 8021A494 4620008D */ trunc.w.d $f2, $f0
/* 6A1698 8021A498 44031000 */ mfc1 $v1, $f2
/* 6A169C 8021A49C 00000000 */ nop
/* 6A16A0 8021A4A0 00721825 */ or $v1, $v1, $s2
/* 6A16A4 8021A4A4 A0430000 */ sb $v1, ($v0)
.L8021A4A8:
/* 6A16A8 8021A4A8 96640076 */ lhu $a0, 0x76($s3)
/* 6A16AC 8021A4AC 00902021 */ addu $a0, $a0, $s0
/* 6A16B0 8021A4B0 2484003C */ addiu $a0, $a0, 0x3c
/* 6A16B4 8021A4B4 00042400 */ sll $a0, $a0, 0x10
/* 6A16B8 8021A4B8 0C00A4F5 */ jal cosine
/* 6A16BC 8021A4BC 00042403 */ sra $a0, $a0, 0x10
/* 6A16C0 8021A4C0 46000021 */ cvt.d.s $f0, $f0
/* 6A16C4 8021A4C4 46380000 */ add.d $f0, $f0, $f24
/* 6A16C8 8021A4C8 46360002 */ mul.d $f0, $f0, $f22
/* 6A16CC 8021A4CC 00000000 */ nop
/* 6A16D0 8021A4D0 27A20038 */ addiu $v0, $sp, 0x38
/* 6A16D4 8021A4D4 4620A03E */ c.le.d $f20, $f0
/* 6A16D8 8021A4D8 00000000 */ nop
/* 6A16DC 8021A4DC 45010005 */ bc1t .L8021A4F4
/* 6A16E0 8021A4E0 00511021 */ addu $v0, $v0, $s1
/* 6A16E4 8021A4E4 4620008D */ trunc.w.d $f2, $f0
/* 6A16E8 8021A4E8 44031000 */ mfc1 $v1, $f2
/* 6A16EC 8021A4EC 08086943 */ j .L8021A50C
/* 6A16F0 8021A4F0 A0430000 */ sb $v1, ($v0)
.L8021A4F4:
/* 6A16F4 8021A4F4 46340001 */ sub.d $f0, $f0, $f20
/* 6A16F8 8021A4F8 4620008D */ trunc.w.d $f2, $f0
/* 6A16FC 8021A4FC 44031000 */ mfc1 $v1, $f2
/* 6A1700 8021A500 00000000 */ nop
/* 6A1704 8021A504 00721825 */ or $v1, $v1, $s2
/* 6A1708 8021A508 A0430000 */ sb $v1, ($v0)
.L8021A50C:
/* 6A170C 8021A50C 96640076 */ lhu $a0, 0x76($s3)
/* 6A1710 8021A510 00902021 */ addu $a0, $a0, $s0
/* 6A1714 8021A514 248400B4 */ addiu $a0, $a0, 0xb4
/* 6A1718 8021A518 00042400 */ sll $a0, $a0, 0x10
/* 6A171C 8021A51C 0C00A4F5 */ jal cosine
/* 6A1720 8021A520 00042403 */ sra $a0, $a0, 0x10
/* 6A1724 8021A524 46000021 */ cvt.d.s $f0, $f0
/* 6A1728 8021A528 46380000 */ add.d $f0, $f0, $f24
/* 6A172C 8021A52C 46360002 */ mul.d $f0, $f0, $f22
/* 6A1730 8021A530 00000000 */ nop
/* 6A1734 8021A534 27A20050 */ addiu $v0, $sp, 0x50
/* 6A1738 8021A538 4620A03E */ c.le.d $f20, $f0
/* 6A173C 8021A53C 00000000 */ nop
/* 6A1740 8021A540 45010005 */ bc1t .L8021A558
/* 6A1744 8021A544 00511021 */ addu $v0, $v0, $s1
/* 6A1748 8021A548 4620008D */ trunc.w.d $f2, $f0
/* 6A174C 8021A54C 44031000 */ mfc1 $v1, $f2
/* 6A1750 8021A550 0808695C */ j .L8021A570
/* 6A1754 8021A554 A0430000 */ sb $v1, ($v0)
.L8021A558:
/* 6A1758 8021A558 46340001 */ sub.d $f0, $f0, $f20
/* 6A175C 8021A55C 4620008D */ trunc.w.d $f2, $f0
/* 6A1760 8021A560 44031000 */ mfc1 $v1, $f2
/* 6A1764 8021A564 00000000 */ nop
/* 6A1768 8021A568 00721825 */ or $v1, $v1, $s2
/* 6A176C 8021A56C A0430000 */ sb $v1, ($v0)
.L8021A570:
/* 6A1770 8021A570 26310001 */ addiu $s1, $s1, 1
/* 6A1774 8021A574 2A220014 */ slti $v0, $s1, 0x14
/* 6A1778 8021A578 1440FFB2 */ bnez $v0, .L8021A444
/* 6A177C 8021A57C 26100019 */ addiu $s0, $s0, 0x19
/* 6A1780 8021A580 8EA2007C */ lw $v0, 0x7c($s5)
/* 6A1784 8021A584 3C030008 */ lui $v1, 8
/* 6A1788 8021A588 00431024 */ and $v0, $v0, $v1
/* 6A178C 8021A58C 10400025 */ beqz $v0, .L8021A624
/* 6A1790 8021A590 0000882D */ daddu $s1, $zero, $zero
/* 6A1794 8021A594 27B70020 */ addiu $s7, $sp, 0x20
/* 6A1798 8021A598 27B60038 */ addiu $s6, $sp, 0x38
/* 6A179C 8021A59C 27B40050 */ addiu $s4, $sp, 0x50
/* 6A17A0 8021A5A0 241300FF */ addiu $s3, $zero, 0xff
/* 6A17A4 8021A5A4 0000802D */ daddu $s0, $zero, $zero
.L8021A5A8:
/* 6A17A8 8021A5A8 02F11021 */ addu $v0, $s7, $s1
/* 6A17AC 8021A5AC 02D12021 */ addu $a0, $s6, $s1
/* 6A17B0 8021A5B0 90430000 */ lbu $v1, ($v0)
/* 6A17B4 8021A5B4 02911021 */ addu $v0, $s4, $s1
/* 6A17B8 8021A5B8 90840000 */ lbu $a0, ($a0)
/* 6A17BC 8021A5BC 90420000 */ lbu $v0, ($v0)
/* 6A17C0 8021A5C0 00031E00 */ sll $v1, $v1, 0x18
/* 6A17C4 8021A5C4 00042400 */ sll $a0, $a0, 0x10
/* 6A17C8 8021A5C8 00641825 */ or $v1, $v1, $a0
/* 6A17CC 8021A5CC 00021200 */ sll $v0, $v0, 8
/* 6A17D0 8021A5D0 00621825 */ or $v1, $v1, $v0
/* 6A17D4 8021A5D4 347200FF */ ori $s2, $v1, 0xff
/* 6A17D8 8021A5D8 0200282D */ daddu $a1, $s0, $zero
.L8021A5DC:
/* 6A17DC 8021A5DC 2406000C */ addiu $a2, $zero, 0xc
/* 6A17E0 8021A5E0 0220382D */ daddu $a3, $s1, $zero
/* 6A17E4 8021A5E4 AFB20010 */ sw $s2, 0x10($sp)
/* 6A17E8 8021A5E8 AFA00014 */ sw $zero, 0x14($sp)
/* 6A17EC 8021A5EC AFB30018 */ sw $s3, 0x18($sp)
/* 6A17F0 8021A5F0 AFA0001C */ sw $zero, 0x1c($sp)
/* 6A17F4 8021A5F4 8EA40084 */ lw $a0, 0x84($s5)
/* 6A17F8 8021A5F8 0C0B79E0 */ jal func_802DE780
/* 6A17FC 8021A5FC 26100001 */ addiu $s0, $s0, 1
/* 6A1800 8021A600 2A02000A */ slti $v0, $s0, 0xa
/* 6A1804 8021A604 1440FFF5 */ bnez $v0, .L8021A5DC
/* 6A1808 8021A608 0200282D */ daddu $a1, $s0, $zero
/* 6A180C 8021A60C 26310001 */ addiu $s1, $s1, 1
/* 6A1810 8021A610 2A220014 */ slti $v0, $s1, 0x14
/* 6A1814 8021A614 1440FFE4 */ bnez $v0, .L8021A5A8
/* 6A1818 8021A618 0000802D */ daddu $s0, $zero, $zero
/* 6A181C 8021A61C 080869A1 */ j .L8021A684
/* 6A1820 8021A620 0000102D */ daddu $v0, $zero, $zero
.L8021A624:
/* 6A1824 8021A624 241200FF */ addiu $s2, $zero, 0xff
/* 6A1828 8021A628 0240A02D */ daddu $s4, $s2, $zero
/* 6A182C 8021A62C 0000802D */ daddu $s0, $zero, $zero
.L8021A630:
/* 6A1830 8021A630 0200282D */ daddu $a1, $s0, $zero
.L8021A634:
/* 6A1834 8021A634 2406000C */ addiu $a2, $zero, 0xc
/* 6A1838 8021A638 0220382D */ daddu $a3, $s1, $zero
/* 6A183C 8021A63C AFB20010 */ sw $s2, 0x10($sp)
/* 6A1840 8021A640 AFA00014 */ sw $zero, 0x14($sp)
/* 6A1844 8021A644 AFB40018 */ sw $s4, 0x18($sp)
/* 6A1848 8021A648 AFA0001C */ sw $zero, 0x1c($sp)
/* 6A184C 8021A64C 8EA40084 */ lw $a0, 0x84($s5)
/* 6A1850 8021A650 0C0B79E0 */ jal func_802DE780
/* 6A1854 8021A654 26100001 */ addiu $s0, $s0, 1
/* 6A1858 8021A658 2A02000A */ slti $v0, $s0, 0xa
/* 6A185C 8021A65C 1440FFF5 */ bnez $v0, .L8021A634
/* 6A1860 8021A660 0200282D */ daddu $a1, $s0, $zero
/* 6A1864 8021A664 26310001 */ addiu $s1, $s1, 1
/* 6A1868 8021A668 2A220014 */ slti $v0, $s1, 0x14
/* 6A186C 8021A66C 1440FFF0 */ bnez $v0, .L8021A630
/* 6A1870 8021A670 0000802D */ daddu $s0, $zero, $zero
/* 6A1874 8021A674 0000102D */ daddu $v0, $zero, $zero
/* 6A1878 8021A678 AE600074 */ sw $zero, 0x74($s3)
/* 6A187C 8021A67C AE600078 */ sw $zero, 0x78($s3)
/* 6A1880 8021A680 AE600070 */ sw $zero, 0x70($s3)
.L8021A684:
/* 6A1884 8021A684 8FBF0088 */ lw $ra, 0x88($sp)
/* 6A1888 8021A688 8FB70084 */ lw $s7, 0x84($sp)
/* 6A188C 8021A68C 8FB60080 */ lw $s6, 0x80($sp)
/* 6A1890 8021A690 8FB5007C */ lw $s5, 0x7c($sp)
/* 6A1894 8021A694 8FB40078 */ lw $s4, 0x78($sp)
/* 6A1898 8021A698 8FB30074 */ lw $s3, 0x74($sp)
/* 6A189C 8021A69C 8FB20070 */ lw $s2, 0x70($sp)
/* 6A18A0 8021A6A0 8FB1006C */ lw $s1, 0x6c($sp)
/* 6A18A4 8021A6A4 8FB00068 */ lw $s0, 0x68($sp)
/* 6A18A8 8021A6A8 D7B800A0 */ ldc1 $f24, 0xa0($sp)
/* 6A18AC 8021A6AC D7B60098 */ ldc1 $f22, 0x98($sp)
/* 6A18B0 8021A6B0 D7B40090 */ ldc1 $f20, 0x90($sp)
/* 6A18B4 8021A6B4 03E00008 */ jr $ra
/* 6A18B8 8021A6B8 27BD00A8 */ addiu $sp, $sp, 0xa8