papermario/asm/nonmatchings/battle/area_hos/47F570/func_802186B8_47F768.s
Ethan Roseman 20a99f4037 OK
2021-02-03 15:40:16 +09:00

214 lines
11 KiB
ArmAsm
Generated

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802186B8_47F768
/* 47F768 802186B8 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 47F76C 802186BC AFB20028 */ sw $s2, 0x28($sp)
/* 47F770 802186C0 2492FFFF */ addiu $s2, $a0, -1
/* 47F774 802186C4 0240202D */ daddu $a0, $s2, $zero
/* 47F778 802186C8 27A50010 */ addiu $a1, $sp, 0x10
/* 47F77C 802186CC 27A60014 */ addiu $a2, $sp, 0x14
/* 47F780 802186D0 AFBF003C */ sw $ra, 0x3c($sp)
/* 47F784 802186D4 AFB60038 */ sw $s6, 0x38($sp)
/* 47F788 802186D8 AFB50034 */ sw $s5, 0x34($sp)
/* 47F78C 802186DC AFB40030 */ sw $s4, 0x30($sp)
/* 47F790 802186E0 AFB3002C */ sw $s3, 0x2c($sp)
/* 47F794 802186E4 AFB10024 */ sw $s1, 0x24($sp)
/* 47F798 802186E8 AFB00020 */ sw $s0, 0x20($sp)
/* 47F79C 802186EC F7B40040 */ sdc1 $f20, 0x40($sp)
/* 47F7A0 802186F0 0C0470AC */ jal func_8011C2B0
/* 47F7A4 802186F4 27A70018 */ addiu $a3, $sp, 0x18
/* 47F7A8 802186F8 8FA20018 */ lw $v0, 0x18($sp)
/* 47F7AC 802186FC 18400097 */ blez $v0, .L8021895C
/* 47F7B0 80218700 0000802D */ daddu $s0, $zero, $zero
/* 47F7B4 80218704 3C038022 */ lui $v1, %hi(D_80224BB0_48BC60)
/* 47F7B8 80218708 24634BB0 */ addiu $v1, $v1, %lo(D_80224BB0_48BC60)
/* 47F7BC 8021870C 00121040 */ sll $v0, $s2, 1
/* 47F7C0 80218710 0043A021 */ addu $s4, $v0, $v1
/* 47F7C4 80218714 3C135555 */ lui $s3, 0x5555
/* 47F7C8 80218718 36735556 */ ori $s3, $s3, 0x5556
/* 47F7CC 8021871C 34168000 */ ori $s6, $zero, 0x8000
/* 47F7D0 80218720 3C0141E0 */ lui $at, 0x41e0
/* 47F7D4 80218724 4481A800 */ mtc1 $at, $f21
/* 47F7D8 80218728 4480A000 */ mtc1 $zero, $f20
/* 47F7DC 8021872C 3C158000 */ lui $s5, 0x8000
/* 47F7E0 80218730 02130018 */ mult $s0, $s3
.L80218734:
/* 47F7E4 80218734 00101FC3 */ sra $v1, $s0, 0x1f
/* 47F7E8 80218738 00004810 */ mfhi $t1
/* 47F7EC 8021873C 01231823 */ subu $v1, $t1, $v1
/* 47F7F0 80218740 00031040 */ sll $v0, $v1, 1
/* 47F7F4 80218744 00431021 */ addu $v0, $v0, $v1
/* 47F7F8 80218748 02021023 */ subu $v0, $s0, $v0
/* 47F7FC 8021874C 96830000 */ lhu $v1, ($s4)
/* 47F800 80218750 24420001 */ addiu $v0, $v0, 1
/* 47F804 80218754 00620018 */ mult $v1, $v0
/* 47F808 80218758 8FA20014 */ lw $v0, 0x14($sp)
/* 47F80C 8021875C 00001812 */ mflo $v1
/* 47F810 80218760 00702021 */ addu $a0, $v1, $s0
/* 47F814 80218764 3084FFFF */ andi $a0, $a0, 0xffff
/* 47F818 80218768 00101900 */ sll $v1, $s0, 4
/* 47F81C 8021876C 00431021 */ addu $v0, $v0, $v1
/* 47F820 80218770 0C01917C */ jal sins
/* 47F824 80218774 2451000C */ addiu $s1, $v0, 0xc
/* 47F828 80218778 00021400 */ sll $v0, $v0, 0x10
/* 47F82C 8021877C 00021403 */ sra $v0, $v0, 0x10
/* 47F830 80218780 00561021 */ addu $v0, $v0, $s6
/* 47F834 80218784 00021FC2 */ srl $v1, $v0, 0x1f
/* 47F838 80218788 00431021 */ addu $v0, $v0, $v1
/* 47F83C 8021878C 00021043 */ sra $v0, $v0, 1
/* 47F840 80218790 00021C00 */ sll $v1, $v0, 0x10
/* 47F844 80218794 00031C03 */ sra $v1, $v1, 0x10
/* 47F848 80218798 00032080 */ sll $a0, $v1, 2
/* 47F84C 8021879C 00832021 */ addu $a0, $a0, $v1
/* 47F850 802187A0 00041940 */ sll $v1, $a0, 5
/* 47F854 802187A4 00641823 */ subu $v1, $v1, $a0
/* 47F858 802187A8 04610002 */ bgez $v1, .L802187B4
/* 47F85C 802187AC 0040202D */ daddu $a0, $v0, $zero
/* 47F860 802187B0 24637FFF */ addiu $v1, $v1, 0x7fff
.L802187B4:
/* 47F864 802187B4 000313C3 */ sra $v0, $v1, 0xf
/* 47F868 802187B8 3C018022 */ lui $at, %hi(D_80225FB0_48D060)
/* 47F86C 802187BC D4225FB0 */ ldc1 $f2, %lo(D_80225FB0_48D060)($at)
/* 47F870 802187C0 44820000 */ mtc1 $v0, $f0
/* 47F874 802187C4 00000000 */ nop
/* 47F878 802187C8 46800021 */ cvt.d.w $f0, $f0
/* 47F87C 802187CC 46220000 */ add.d $f0, $f0, $f2
/* 47F880 802187D0 4620A03E */ c.le.d $f20, $f0
/* 47F884 802187D4 00000000 */ nop
/* 47F888 802187D8 45030005 */ bc1tl .L802187F0
/* 47F88C 802187DC 46340001 */ sub.d $f0, $f0, $f20
/* 47F890 802187E0 4620010D */ trunc.w.d $f4, $f0
/* 47F894 802187E4 44022000 */ mfc1 $v0, $f4
/* 47F898 802187E8 08086201 */ j .L80218804
/* 47F89C 802187EC A2220000 */ sb $v0, ($s1)
.L802187F0:
/* 47F8A0 802187F0 4620010D */ trunc.w.d $f4, $f0
/* 47F8A4 802187F4 44022000 */ mfc1 $v0, $f4
/* 47F8A8 802187F8 00000000 */ nop
/* 47F8AC 802187FC 00551025 */ or $v0, $v0, $s5
/* 47F8B0 80218800 A2220000 */ sb $v0, ($s1)
.L80218804:
/* 47F8B4 80218804 00041400 */ sll $v0, $a0, 0x10
/* 47F8B8 80218808 00021403 */ sra $v0, $v0, 0x10
/* 47F8BC 8021880C 00021880 */ sll $v1, $v0, 2
/* 47F8C0 80218810 00621821 */ addu $v1, $v1, $v0
/* 47F8C4 80218814 00031140 */ sll $v0, $v1, 5
/* 47F8C8 80218818 00431023 */ subu $v0, $v0, $v1
/* 47F8CC 8021881C 04410002 */ bgez $v0, .L80218828
/* 47F8D0 80218820 26230001 */ addiu $v1, $s1, 1
/* 47F8D4 80218824 24427FFF */ addiu $v0, $v0, 0x7fff
.L80218828:
/* 47F8D8 80218828 000213C3 */ sra $v0, $v0, 0xf
/* 47F8DC 8021882C 3C018022 */ lui $at, %hi(D_80225FB8_48D068)
/* 47F8E0 80218830 D4225FB8 */ ldc1 $f2, %lo(D_80225FB8_48D068)($at)
/* 47F8E4 80218834 44820000 */ mtc1 $v0, $f0
/* 47F8E8 80218838 00000000 */ nop
/* 47F8EC 8021883C 46800021 */ cvt.d.w $f0, $f0
/* 47F8F0 80218840 46220000 */ add.d $f0, $f0, $f2
/* 47F8F4 80218844 4620A03E */ c.le.d $f20, $f0
/* 47F8F8 80218848 00000000 */ nop
/* 47F8FC 8021884C 45030005 */ bc1tl .L80218864
/* 47F900 80218850 46340001 */ sub.d $f0, $f0, $f20
/* 47F904 80218854 4620010D */ trunc.w.d $f4, $f0
/* 47F908 80218858 44022000 */ mfc1 $v0, $f4
/* 47F90C 8021885C 0808621E */ j .L80218878
/* 47F910 80218860 A0620000 */ sb $v0, ($v1)
.L80218864:
/* 47F914 80218864 4620010D */ trunc.w.d $f4, $f0
/* 47F918 80218868 44022000 */ mfc1 $v0, $f4
/* 47F91C 8021886C 00000000 */ nop
/* 47F920 80218870 00551025 */ or $v0, $v0, $s5
/* 47F924 80218874 A0620000 */ sb $v0, ($v1)
.L80218878:
/* 47F928 80218878 00101FC2 */ srl $v1, $s0, 0x1f
/* 47F92C 8021887C 02031821 */ addu $v1, $s0, $v1
/* 47F930 80218880 00032843 */ sra $a1, $v1, 1
/* 47F934 80218884 00B30018 */ mult $a1, $s3
/* 47F938 80218888 96840000 */ lhu $a0, ($s4)
/* 47F93C 8021888C 00031FC3 */ sra $v1, $v1, 0x1f
/* 47F940 80218890 000433C2 */ srl $a2, $a0, 0xf
/* 47F944 80218894 00004810 */ mfhi $t1
/* 47F948 80218898 01231823 */ subu $v1, $t1, $v1
/* 47F94C 8021889C 00031040 */ sll $v0, $v1, 1
/* 47F950 802188A0 00431021 */ addu $v0, $v0, $v1
/* 47F954 802188A4 00A22823 */ subu $a1, $a1, $v0
/* 47F958 802188A8 24A50001 */ addiu $a1, $a1, 1
/* 47F95C 802188AC 00052BC0 */ sll $a1, $a1, 0xf
/* 47F960 802188B0 00C50018 */ mult $a2, $a1
/* 47F964 802188B4 00042382 */ srl $a0, $a0, 0xe
/* 47F968 802188B8 000423C0 */ sll $a0, $a0, 0xf
/* 47F96C 802188BC 00001812 */ mflo $v1
/* 47F970 802188C0 00642021 */ addu $a0, $v1, $a0
/* 47F974 802188C4 00902021 */ addu $a0, $a0, $s0
/* 47F978 802188C8 0C01917C */ jal sins
/* 47F97C 802188CC 3084FFFF */ andi $a0, $a0, 0xffff
/* 47F980 802188D0 00021400 */ sll $v0, $v0, 0x10
/* 47F984 802188D4 00021403 */ sra $v0, $v0, 0x10
/* 47F988 802188D8 92230000 */ lbu $v1, ($s1)
/* 47F98C 802188DC 00561021 */ addu $v0, $v0, $s6
/* 47F990 802188E0 00620018 */ mult $v1, $v0
/* 47F994 802188E4 00001812 */ mflo $v1
/* 47F998 802188E8 04610003 */ bgez $v1, .L802188F8
/* 47F99C 802188EC 26240002 */ addiu $a0, $s1, 2
/* 47F9A0 802188F0 3402FFFF */ ori $v0, $zero, 0xffff
/* 47F9A4 802188F4 00621821 */ addu $v1, $v1, $v0
.L802188F8:
/* 47F9A8 802188F8 00031403 */ sra $v0, $v1, 0x10
/* 47F9AC 802188FC 3C018022 */ lui $at, %hi(D_80225FC0_48D070)
/* 47F9B0 80218900 D4225FC0 */ ldc1 $f2, %lo(D_80225FC0_48D070)($at)
/* 47F9B4 80218904 44820000 */ mtc1 $v0, $f0
/* 47F9B8 80218908 00000000 */ nop
/* 47F9BC 8021890C 46800021 */ cvt.d.w $f0, $f0
/* 47F9C0 80218910 46220000 */ add.d $f0, $f0, $f2
/* 47F9C4 80218914 4620A03E */ c.le.d $f20, $f0
/* 47F9C8 80218918 00000000 */ nop
/* 47F9CC 8021891C 45030005 */ bc1tl .L80218934
/* 47F9D0 80218920 46340001 */ sub.d $f0, $f0, $f20
/* 47F9D4 80218924 4620010D */ trunc.w.d $f4, $f0
/* 47F9D8 80218928 44022000 */ mfc1 $v0, $f4
/* 47F9DC 8021892C 08086252 */ j .L80218948
/* 47F9E0 80218930 A0820000 */ sb $v0, ($a0)
.L80218934:
/* 47F9E4 80218934 4620010D */ trunc.w.d $f4, $f0
/* 47F9E8 80218938 44022000 */ mfc1 $v0, $f4
/* 47F9EC 8021893C 00000000 */ nop
/* 47F9F0 80218940 00551025 */ or $v0, $v0, $s5
/* 47F9F4 80218944 A0820000 */ sb $v0, ($a0)
.L80218948:
/* 47F9F8 80218948 8FA20018 */ lw $v0, 0x18($sp)
/* 47F9FC 8021894C 26100001 */ addiu $s0, $s0, 1
/* 47FA00 80218950 0202102A */ slt $v0, $s0, $v0
/* 47FA04 80218954 1440FF77 */ bnez $v0, .L80218734
/* 47FA08 80218958 02130018 */ mult $s0, $s3
.L8021895C:
/* 47FA0C 8021895C 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 47FA10 80218960 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 47FA14 80218964 8C620000 */ lw $v0, ($v1)
/* 47FA18 80218968 0240202D */ daddu $a0, $s2, $zero
/* 47FA1C 8021896C 0040802D */ daddu $s0, $v0, $zero
/* 47FA20 80218970 24420008 */ addiu $v0, $v0, 8
/* 47FA24 80218974 AC620000 */ sw $v0, ($v1)
/* 47FA28 80218978 3C02DE00 */ lui $v0, 0xde00
/* 47FA2C 8021897C 0C0470BB */ jal func_8011C2EC
/* 47FA30 80218980 AE020000 */ sw $v0, ($s0)
/* 47FA34 80218984 AE020004 */ sw $v0, 4($s0)
/* 47FA38 80218988 3C028022 */ lui $v0, %hi(D_80224BB0_48BC60)
/* 47FA3C 8021898C 24424BB0 */ addiu $v0, $v0, %lo(D_80224BB0_48BC60)
/* 47FA40 80218990 00121840 */ sll $v1, $s2, 1
/* 47FA44 80218994 00621821 */ addu $v1, $v1, $v0
/* 47FA48 80218998 94620000 */ lhu $v0, ($v1)
/* 47FA4C 8021899C 24420253 */ addiu $v0, $v0, 0x253
/* 47FA50 802189A0 A4620000 */ sh $v0, ($v1)
/* 47FA54 802189A4 8FBF003C */ lw $ra, 0x3c($sp)
/* 47FA58 802189A8 8FB60038 */ lw $s6, 0x38($sp)
/* 47FA5C 802189AC 8FB50034 */ lw $s5, 0x34($sp)
/* 47FA60 802189B0 8FB40030 */ lw $s4, 0x30($sp)
/* 47FA64 802189B4 8FB3002C */ lw $s3, 0x2c($sp)
/* 47FA68 802189B8 8FB20028 */ lw $s2, 0x28($sp)
/* 47FA6C 802189BC 8FB10024 */ lw $s1, 0x24($sp)
/* 47FA70 802189C0 8FB00020 */ lw $s0, 0x20($sp)
/* 47FA74 802189C4 D7B40040 */ ldc1 $f20, 0x40($sp)
/* 47FA78 802189C8 03E00008 */ jr $ra
/* 47FA7C 802189CC 27BD0048 */ addiu $sp, $sp, 0x48