papermario/ver/us/asm/nonmatchings/EF2680/func_80242218_EF4828.s
Alexander Faßbender 11a6166cd8
Decompile miscellaneous dead funcs and find_duplicates.py (#349)
* match last bow fumction

* decomp more partner functions

* :)

* :)

* resolve merge conflict and style conflicts

* fix

* decomp :)

* :(

* :(((

* :)

* :(

* :)

* :)))))

* :(

* :/

* idk

* :/

* What

* Done.

* PR comments

* :(

* decompile dead funcs

* find_duplicates.py +x

* rename dead functions and resolve PR

* :)

* .

* .

Co-authored-by: Ethan Roseman <ethteck@gmail.com>
2021-08-02 23:04:11 +09:00

94 lines
4.5 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.section .rodata
glabel D_80245408_EF7A18
.double 0.8
.section .text
glabel func_80242218_EF4828
/* EF4828 80242218 27BDFFD8 */ addiu $sp, $sp, -0x28
/* EF482C 8024221C AFB3001C */ sw $s3, 0x1c($sp)
/* EF4830 80242220 0080982D */ daddu $s3, $a0, $zero
/* EF4834 80242224 AFBF0020 */ sw $ra, 0x20($sp)
/* EF4838 80242228 AFB20018 */ sw $s2, 0x18($sp)
/* EF483C 8024222C AFB10014 */ sw $s1, 0x14($sp)
/* EF4840 80242230 AFB00010 */ sw $s0, 0x10($sp)
/* EF4844 80242234 8E710148 */ lw $s1, 0x148($s3)
/* EF4848 80242238 86240008 */ lh $a0, 8($s1)
/* EF484C 8024223C 0C00F92F */ jal dead_get_npc_unsafe
/* EF4850 80242240 00A0902D */ daddu $s2, $a1, $zero
/* EF4854 80242244 0040802D */ daddu $s0, $v0, $zero
/* EF4858 80242248 8602008E */ lh $v0, 0x8e($s0)
/* EF485C 8024224C 9603008E */ lhu $v1, 0x8e($s0)
/* EF4860 80242250 18400005 */ blez $v0, .L80242268
/* EF4864 80242254 2462FFFF */ addiu $v0, $v1, -1
/* EF4868 80242258 A602008E */ sh $v0, 0x8e($s0)
/* EF486C 8024225C 00021400 */ sll $v0, $v0, 0x10
/* EF4870 80242260 1C400033 */ bgtz $v0, .L80242330
/* EF4874 80242264 00000000 */ nop
.L80242268:
/* EF4878 80242268 8602008C */ lh $v0, 0x8c($s0)
/* EF487C 8024226C 14400030 */ bnez $v0, .L80242330
/* EF4880 80242270 00000000 */ nop
/* EF4884 80242274 8E2200CC */ lw $v0, 0xcc($s1)
/* EF4888 80242278 8C420024 */ lw $v0, 0x24($v0)
/* EF488C 8024227C AE020028 */ sw $v0, 0x28($s0)
/* EF4890 80242280 C6400018 */ lwc1 $f0, 0x18($s2)
/* EF4894 80242284 E6000018 */ swc1 $f0, 0x18($s0)
/* EF4898 80242288 8E230088 */ lw $v1, 0x88($s1)
/* EF489C 8024228C 24020005 */ addiu $v0, $zero, 5
/* EF48A0 80242290 10620005 */ beq $v1, $v0, .L802422A8
/* EF48A4 80242294 00000000 */ nop
/* EF48A8 80242298 10600003 */ beqz $v1, .L802422A8
/* EF48AC 8024229C 24020001 */ addiu $v0, $zero, 1
/* EF48B0 802422A0 14620006 */ bne $v1, $v0, .L802422BC
/* EF48B4 802422A4 00000000 */ nop
.L802422A8:
/* EF48B8 802422A8 8E220084 */ lw $v0, 0x84($s1)
/* EF48BC 802422AC 00021FC2 */ srl $v1, $v0, 0x1f
/* EF48C0 802422B0 00431021 */ addu $v0, $v0, $v1
/* EF48C4 802422B4 00021043 */ sra $v0, $v0, 1
/* EF48C8 802422B8 A60200A8 */ sh $v0, 0xa8($s0)
.L802422BC:
/* EF48CC 802422BC 3C028010 */ lui $v0, %hi(dead_gPlayerStatusPtr)
/* EF48D0 802422C0 8C42FC90 */ lw $v0, %lo(dead_gPlayerStatusPtr)($v0)
/* EF48D4 802422C4 C60C0038 */ lwc1 $f12, 0x38($s0)
/* EF48D8 802422C8 C60E0040 */ lwc1 $f14, 0x40($s0)
/* EF48DC 802422CC 8C460028 */ lw $a2, 0x28($v0)
/* EF48E0 802422D0 0C00AC71 */ jal func_8002B1C4
/* EF48E4 802422D4 8C470030 */ lw $a3, 0x30($v0)
/* EF48E8 802422D8 C6020018 */ lwc1 $f2, 0x18($s0)
/* EF48EC 802422DC 46020003 */ div.s $f0, $f0, $f2
/* EF48F0 802422E0 3C018024 */ lui $at, %hi(D_80245408_EF7A18)
/* EF48F4 802422E4 D4225408 */ ldc1 $f2, %lo(D_80245408_EF7A18)($at)
/* EF48F8 802422E8 46000021 */ cvt.d.s $f0, $f0
/* EF48FC 802422EC 46220000 */ add.d $f0, $f0, $f2
/* EF4900 802422F0 4620010D */ trunc.w.d $f4, $f0
/* EF4904 802422F4 44022000 */ mfc1 $v0, $f4
/* EF4908 802422F8 00000000 */ nop
/* EF490C 802422FC A602008E */ sh $v0, 0x8e($s0)
/* EF4910 80242300 00021400 */ sll $v0, $v0, 0x10
/* EF4914 80242304 8E230078 */ lw $v1, 0x78($s1)
/* EF4918 80242308 00021403 */ sra $v0, $v0, 0x10
/* EF491C 8024230C 0043102A */ slt $v0, $v0, $v1
/* EF4920 80242310 10400003 */ beqz $v0, .L80242320
/* EF4924 80242314 00000000 */ nop
/* EF4928 80242318 9622007A */ lhu $v0, 0x7a($s1)
/* EF492C 8024231C A602008E */ sh $v0, 0x8e($s0)
.L80242320:
/* EF4930 80242320 8602008E */ lh $v0, 0x8e($s0)
/* EF4934 80242324 AE22007C */ sw $v0, 0x7c($s1)
/* EF4938 80242328 2402000E */ addiu $v0, $zero, 0xe
/* EF493C 8024232C AE620070 */ sw $v0, 0x70($s3)
.L80242330:
/* EF4940 80242330 8FBF0020 */ lw $ra, 0x20($sp)
/* EF4944 80242334 8FB3001C */ lw $s3, 0x1c($sp)
/* EF4948 80242338 8FB20018 */ lw $s2, 0x18($sp)
/* EF494C 8024233C 8FB10014 */ lw $s1, 0x14($sp)
/* EF4950 80242340 8FB00010 */ lw $s0, 0x10($sp)
/* EF4954 80242344 03E00008 */ jr $ra
/* EF4958 80242348 27BD0028 */ addiu $sp, $sp, 0x28