papermario/asm/nonmatchings/code_104940_len_dc0/func_802E36E4.s
2020-08-12 21:56:23 -04:00

220 lines
10 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.include "include/macro.inc"
glabel func_802E36E4
/* 104F64 802E36E4 8C820040 */ lw $v0, 0x40($a0)
/* 104F68 802E36E8 2403FFFF */ addiu $v1, $zero, -1
/* 104F6C 802E36EC A4430010 */ sh $v1, 0x10($v0)
/* 104F70 802E36F0 C480004C */ lwc1 $f0, 0x4c($a0)
/* 104F74 802E36F4 3C05FFDF */ lui $a1, 0xffdf
/* 104F78 802E36F8 A443000E */ sh $v1, 0xe($v0)
/* 104F7C 802E36FC E4400014 */ swc1 $f0, 0x14($v0)
/* 104F80 802E3700 8C820000 */ lw $v0, ($a0)
/* 104F84 802E3704 34A5FFFF */ ori $a1, $a1, 0xffff
/* 104F88 802E3708 00451024 */ and $v0, $v0, $a1
/* 104F8C 802E370C 03E00008 */ jr $ra
/* 104F90 802E3710 AC820000 */ sw $v0, ($a0)
/* 104F94 802E3714 8C820040 */ lw $v0, 0x40($a0)
/* 104F98 802E3718 3C0142B4 */ lui $at, 0x42b4
/* 104F9C 802E371C 44810000 */ mtc1 $at, $f0
/* 104FA0 802E3720 03E00008 */ jr $ra
/* 104FA4 802E3724 E4400018 */ swc1 $f0, 0x18($v0)
/* 104FA8 802E3728 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 104FAC 802E372C AFB10014 */ sw $s1, 0x14($sp)
/* 104FB0 802E3730 0080882D */ daddu $s1, $a0, $zero
/* 104FB4 802E3734 AFBF0018 */ sw $ra, 0x18($sp)
/* 104FB8 802E3738 AFB00010 */ sw $s0, 0x10($sp)
/* 104FBC 802E373C F7B40020 */ sdc1 $f20, 0x20($sp)
/* 104FC0 802E3740 0C0B8E80 */ jal func_802E3A00
/* 104FC4 802E3744 8E300040 */ lw $s0, 0x40($s1)
/* 104FC8 802E3748 3C0140C9 */ lui $at, 0x40c9
/* 104FCC 802E374C 34210FD0 */ ori $at, $at, 0xfd0
/* 104FD0 802E3750 44810000 */ mtc1 $at, $f0
/* 104FD4 802E3754 C60C0018 */ lwc1 $f12, 0x18($s0)
/* 104FD8 802E3758 46006302 */ mul.s $f12, $f12, $f0
/* 104FDC 802E375C 00000000 */ nop
/* 104FE0 802E3760 C634004C */ lwc1 $f20, 0x4c($s1)
/* 104FE4 802E3764 3C0143B4 */ lui $at, 0x43b4
/* 104FE8 802E3768 44810000 */ mtc1 $at, $f0
/* 104FEC 802E376C 4600A521 */ cvt.d.s $f20, $f20
/* 104FF0 802E3770 0C00A85B */ jal sin_rad
/* 104FF4 802E3774 46006303 */ div.s $f12, $f12, $f0
/* 104FF8 802E3778 46000021 */ cvt.d.s $f0, $f0
/* 104FFC 802E377C 46200000 */ add.d $f0, $f0, $f0
/* 105000 802E3780 4620A500 */ add.d $f20, $f20, $f0
/* 105004 802E3784 3C014270 */ lui $at, 0x4270
/* 105008 802E3788 44810000 */ mtc1 $at, $f0
/* 10500C 802E378C 4620A520 */ cvt.s.d $f20, $f20
/* 105010 802E3790 E634004C */ swc1 $f20, 0x4c($s1)
/* 105014 802E3794 C6020018 */ lwc1 $f2, 0x18($s0)
/* 105018 802E3798 46001300 */ add.s $f12, $f2, $f0
/* 10501C 802E379C 3C0143E1 */ lui $at, 0x43e1
/* 105020 802E37A0 44810000 */ mtc1 $at, $f0
/* 105024 802E37A4 00000000 */ nop
/* 105028 802E37A8 460C003C */ c.lt.s $f0, $f12
/* 10502C 802E37AC 00000000 */ nop
/* 105030 802E37B0 45000006 */ bc1f .L802E37CC
/* 105034 802E37B4 E60C0018 */ swc1 $f12, 0x18($s0)
/* 105038 802E37B8 0C00A6C9 */ jal clamp_angle
/* 10503C 802E37BC 00000000 */ nop
/* 105040 802E37C0 E6000018 */ swc1 $f0, 0x18($s0)
/* 105044 802E37C4 0C043F5A */ jal func_8010FD68
/* 105048 802E37C8 0220202D */ daddu $a0, $s1, $zero
.L802E37CC:
/* 10504C 802E37CC 8FBF0018 */ lw $ra, 0x18($sp)
/* 105050 802E37D0 8FB10014 */ lw $s1, 0x14($sp)
/* 105054 802E37D4 8FB00010 */ lw $s0, 0x10($sp)
/* 105058 802E37D8 D7B40020 */ ldc1 $f20, 0x20($sp)
/* 10505C 802E37DC 03E00008 */ jr $ra
/* 105060 802E37E0 27BD0028 */ addiu $sp, $sp, 0x28
/* 105064 802E37E4 27BDFFD0 */ addiu $sp, $sp, -0x30
/* 105068 802E37E8 AFB10014 */ sw $s1, 0x14($sp)
/* 10506C 802E37EC 0080882D */ daddu $s1, $a0, $zero
/* 105070 802E37F0 AFBF0018 */ sw $ra, 0x18($sp)
/* 105074 802E37F4 AFB00010 */ sw $s0, 0x10($sp)
/* 105078 802E37F8 F7B60028 */ sdc1 $f22, 0x28($sp)
/* 10507C 802E37FC F7B40020 */ sdc1 $f20, 0x20($sp)
/* 105080 802E3800 0C0B8E80 */ jal func_802E3A00
/* 105084 802E3804 8E300040 */ lw $s0, 0x40($s1)
/* 105088 802E3808 3C0140C9 */ lui $at, 0x40c9
/* 10508C 802E380C 34210FD0 */ ori $at, $at, 0xfd0
/* 105090 802E3810 44810000 */ mtc1 $at, $f0
/* 105094 802E3814 C60C0018 */ lwc1 $f12, 0x18($s0)
/* 105098 802E3818 46006302 */ mul.s $f12, $f12, $f0
/* 10509C 802E381C 00000000 */ nop
/* 1050A0 802E3820 C634004C */ lwc1 $f20, 0x4c($s1)
/* 1050A4 802E3824 3C0143B4 */ lui $at, 0x43b4
/* 1050A8 802E3828 4481B000 */ mtc1 $at, $f22
/* 1050AC 802E382C 4600A521 */ cvt.d.s $f20, $f20
/* 1050B0 802E3830 0C00A85B */ jal sin_rad
/* 1050B4 802E3834 46166303 */ div.s $f12, $f12, $f22
/* 1050B8 802E3838 46000021 */ cvt.d.s $f0, $f0
/* 1050BC 802E383C 4620A500 */ add.d $f20, $f20, $f0
/* 1050C0 802E3840 3C014270 */ lui $at, 0x4270
/* 1050C4 802E3844 44811000 */ mtc1 $at, $f2
/* 1050C8 802E3848 4620A520 */ cvt.s.d $f20, $f20
/* 1050CC 802E384C E634004C */ swc1 $f20, 0x4c($s1)
/* 1050D0 802E3850 C6000018 */ lwc1 $f0, 0x18($s0)
/* 1050D4 802E3854 46020000 */ add.s $f0, $f0, $f2
/* 1050D8 802E3858 4600B03E */ c.le.s $f22, $f0
/* 1050DC 802E385C 00000000 */ nop
/* 1050E0 802E3860 45000006 */ bc1f .L802E387C
/* 1050E4 802E3864 E6000018 */ swc1 $f0, 0x18($s0)
/* 1050E8 802E3868 C6000014 */ lwc1 $f0, 0x14($s0)
/* 1050EC 802E386C 0220202D */ daddu $a0, $s1, $zero
/* 1050F0 802E3870 AE000018 */ sw $zero, 0x18($s0)
/* 1050F4 802E3874 0C043F5A */ jal func_8010FD68
/* 1050F8 802E3878 E480004C */ swc1 $f0, 0x4c($a0)
.L802E387C:
/* 1050FC 802E387C 8FBF0018 */ lw $ra, 0x18($sp)
/* 105100 802E3880 8FB10014 */ lw $s1, 0x14($sp)
/* 105104 802E3884 8FB00010 */ lw $s0, 0x10($sp)
/* 105108 802E3888 D7B60028 */ ldc1 $f22, 0x28($sp)
/* 10510C 802E388C D7B40020 */ ldc1 $f20, 0x20($sp)
/* 105110 802E3890 03E00008 */ jr $ra
/* 105114 802E3894 27BD0030 */ addiu $sp, $sp, 0x30
/* 105118 802E3898 27BDFFE8 */ addiu $sp, $sp, -0x18
/* 10511C 802E389C AFB00010 */ sw $s0, 0x10($sp)
/* 105120 802E38A0 AFBF0014 */ sw $ra, 0x14($sp)
/* 105124 802E38A4 0C0B8DB9 */ jal func_802E36E4
/* 105128 802E38A8 0080802D */ daddu $s0, $a0, $zero
/* 10512C 802E38AC 8E030040 */ lw $v1, 0x40($s0)
/* 105130 802E38B0 2402000A */ addiu $v0, $zero, 0xa
/* 105134 802E38B4 A4620004 */ sh $v0, 4($v1)
/* 105138 802E38B8 2402007B */ addiu $v0, $zero, 0x7b
/* 10513C 802E38BC A4620006 */ sh $v0, 6($v1)
/* 105140 802E38C0 3402FFFF */ ori $v0, $zero, 0xffff
/* 105144 802E38C4 A462000A */ sh $v0, 0xa($v1)
/* 105148 802E38C8 8FBF0014 */ lw $ra, 0x14($sp)
/* 10514C 802E38CC 8FB00010 */ lw $s0, 0x10($sp)
/* 105150 802E38D0 03E00008 */ jr $ra
/* 105154 802E38D4 27BD0018 */ addiu $sp, $sp, 0x18
/* 105158 802E38D8 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 10515C 802E38DC AFB1001C */ sw $s1, 0x1c($sp)
/* 105160 802E38E0 0080882D */ daddu $s1, $a0, $zero
/* 105164 802E38E4 AFBF0020 */ sw $ra, 0x20($sp)
/* 105168 802E38E8 AFB00018 */ sw $s0, 0x18($sp)
/* 10516C 802E38EC 8E300040 */ lw $s0, 0x40($s1)
/* 105170 802E38F0 86030004 */ lh $v1, 4($s0)
/* 105174 802E38F4 18600018 */ blez $v1, .L802E3958
/* 105178 802E38F8 2402000A */ addiu $v0, $zero, 0xa
/* 10517C 802E38FC 14620004 */ bne $v1, $v0, .L802E3910
/* 105180 802E3900 24030014 */ addiu $v1, $zero, 0x14
/* 105184 802E3904 9602000A */ lhu $v0, 0xa($s0)
/* 105188 802E3908 080B8E45 */ j .L802E3914
/* 10518C 802E390C 24030015 */ addiu $v1, $zero, 0x15
.L802E3910:
/* 105190 802E3910 0000102D */ daddu $v0, $zero, $zero
.L802E3914:
/* 105194 802E3914 C620004C */ lwc1 $f0, 0x4c($s1)
/* 105198 802E3918 3C01403C */ lui $at, 0x403c
/* 10519C 802E391C 44811800 */ mtc1 $at, $f3
/* 1051A0 802E3920 44801000 */ mtc1 $zero, $f2
/* 1051A4 802E3924 AFA30010 */ sw $v1, 0x10($sp)
/* 1051A8 802E3928 AFA20014 */ sw $v0, 0x14($sp)
/* 1051AC 802E392C 46000021 */ cvt.d.s $f0, $f0
/* 1051B0 802E3930 46220000 */ add.d $f0, $f0, $f2
/* 1051B4 802E3934 8E250048 */ lw $a1, 0x48($s1)
/* 1051B8 802E3938 8E270050 */ lw $a3, 0x50($s1)
/* 1051BC 802E393C 46200020 */ cvt.s.d $f0, $f0
/* 1051C0 802E3940 44060000 */ mfc1 $a2, $f0
/* 1051C4 802E3944 0C04C6A5 */ jal make_item_entity_nodelay
/* 1051C8 802E3948 24040157 */ addiu $a0, $zero, 0x157
/* 1051CC 802E394C 96020004 */ lhu $v0, 4($s0)
/* 1051D0 802E3950 2442FFFF */ addiu $v0, $v0, -1
/* 1051D4 802E3954 A6020004 */ sh $v0, 4($s0)
.L802E3958:
/* 1051D8 802E3958 86020004 */ lh $v0, 4($s0)
/* 1051DC 802E395C 10400004 */ beqz $v0, .L802E3970
/* 1051E0 802E3960 00000000 */ nop
/* 1051E4 802E3964 86020006 */ lh $v0, 6($s0)
/* 1051E8 802E3968 14400020 */ bnez $v0, .L802E39EC
/* 1051EC 802E396C 00000000 */ nop
.L802E3970:
/* 1051F0 802E3970 3C04802F */ lui $a0, 0x802f
/* 1051F4 802E3974 2484A07C */ addiu $a0, $a0, -0x5f84
/* 1051F8 802E3978 24020001 */ addiu $v0, $zero, 1
/* 1051FC 802E397C A2020003 */ sb $v0, 3($s0)
/* 105200 802E3980 C6220048 */ lwc1 $f2, 0x48($s1)
/* 105204 802E3984 C624004C */ lwc1 $f4, 0x4c($s1)
/* 105208 802E3988 C6260050 */ lwc1 $f6, 0x50($s1)
/* 10520C 802E398C C6200064 */ lwc1 $f0, 0x64($s1)
/* 105210 802E3990 3C028000 */ lui $v0, 0x8000
/* 105214 802E3994 AFA20014 */ sw $v0, 0x14($sp)
/* 105218 802E3998 4600020D */ trunc.w.s $f8, $f0
/* 10521C 802E399C E7A80010 */ swc1 $f8, 0x10($sp)
/* 105220 802E39A0 4600120D */ trunc.w.s $f8, $f2
/* 105224 802E39A4 44054000 */ mfc1 $a1, $f8
/* 105228 802E39A8 4600220D */ trunc.w.s $f8, $f4
/* 10522C 802E39AC 44064000 */ mfc1 $a2, $f8
/* 105230 802E39B0 4600320D */ trunc.w.s $f8, $f6
/* 105234 802E39B4 44074000 */ mfc1 $a3, $f8
/* 105238 802E39B8 0C044631 */ jal create_entity
/* 10523C 802E39BC 00000000 */ nop
/* 105240 802E39C0 0C04417A */ jal get_entity_by_index
/* 105244 802E39C4 0040202D */ daddu $a0, $v0, $zero
/* 105248 802E39C8 3C05802F */ lui $a1, 0x802f
/* 10524C 802E39CC 24A59E54 */ addiu $a1, $a1, -0x61ac
/* 105250 802E39D0 0C043EF0 */ jal func_8010FBC0
/* 105254 802E39D4 0040202D */ daddu $a0, $v0, $zero
/* 105258 802E39D8 3C032000 */ lui $v1, 0x2000
/* 10525C 802E39DC 8E220000 */ lw $v0, ($s1)
/* 105260 802E39E0 34630020 */ ori $v1, $v1, 0x20
/* 105264 802E39E4 00431025 */ or $v0, $v0, $v1
/* 105268 802E39E8 AE220000 */ sw $v0, ($s1)
.L802E39EC:
/* 10526C 802E39EC 8FBF0020 */ lw $ra, 0x20($sp)
/* 105270 802E39F0 8FB1001C */ lw $s1, 0x1c($sp)
/* 105274 802E39F4 8FB00018 */ lw $s0, 0x18($sp)
/* 105278 802E39F8 03E00008 */ jr $ra
/* 10527C 802E39FC 27BD0028 */ addiu $sp, $sp, 0x28