papermario/asm/nonmatchings/code_197F40/PlayerRunToGoal.s
2020-10-14 23:49:49 -04:00

182 lines
9.2 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel PlayerRunToGoal
/* 1A2544 80273C64 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 1A2548 80273C68 AFB00018 */ sw $s0, 0x18($sp)
/* 1A254C 80273C6C 3C10800E */ lui $s0, 0x800e
/* 1A2550 80273C70 8E10C148 */ lw $s0, -0x3eb8($s0)
/* 1A2554 80273C74 AFB20020 */ sw $s2, 0x20($sp)
/* 1A2558 80273C78 0080902D */ daddu $s2, $a0, $zero
/* 1A255C 80273C7C AFBF0024 */ sw $ra, 0x24($sp)
/* 1A2560 80273C80 AFB1001C */ sw $s1, 0x1c($sp)
/* 1A2564 80273C84 F7BA0040 */ sdc1 $f26, 0x40($sp)
/* 1A2568 80273C88 F7B80038 */ sdc1 $f24, 0x38($sp)
/* 1A256C 80273C8C F7B60030 */ sdc1 $f22, 0x30($sp)
/* 1A2570 80273C90 F7B40028 */ sdc1 $f20, 0x28($sp)
/* 1A2574 80273C94 8E43000C */ lw $v1, 0xc($s2)
/* 1A2578 80273C98 10A00002 */ beqz $a1, .L80273CA4
/* 1A257C 80273C9C 2611000C */ addiu $s1, $s0, 0xc
/* 1A2580 80273CA0 AE400070 */ sw $zero, 0x70($s2)
.L80273CA4:
/* 1A2584 80273CA4 8E420070 */ lw $v0, 0x70($s2)
/* 1A2588 80273CA8 14400041 */ bnez $v0, .L80273DB0
/* 1A258C 80273CAC 00000000 */ nop
/* 1A2590 80273CB0 8C650000 */ lw $a1, ($v1)
/* 1A2594 80273CB4 0C0B1EAF */ jal get_variable
/* 1A2598 80273CB8 0240202D */ daddu $a0, $s2, $zero
/* 1A259C 80273CBC C6180018 */ lwc1 $f24, 0x18($s0)
/* 1A25A0 80273CC0 C61A0020 */ lwc1 $f26, 0x20($s0)
/* 1A25A4 80273CC4 C6000144 */ lwc1 $f0, 0x144($s0)
/* 1A25A8 80273CC8 C614014C */ lwc1 $f20, 0x14c($s0)
/* 1A25AC 80273CCC 4406C000 */ mfc1 $a2, $f24
/* 1A25B0 80273CD0 4407D000 */ mfc1 $a3, $f26
/* 1A25B4 80273CD4 A6020070 */ sh $v0, 0x70($s0)
/* 1A25B8 80273CD8 E600000C */ swc1 $f0, 0xc($s0)
/* 1A25BC 80273CDC C6000148 */ lwc1 $f0, 0x148($s0)
/* 1A25C0 80273CE0 C616000C */ lwc1 $f22, 0xc($s0)
/* 1A25C4 80273CE4 4600A386 */ mov.s $f14, $f20
/* 1A25C8 80273CE8 E6140014 */ swc1 $f20, 0x14($s0)
/* 1A25CC 80273CEC 4600B306 */ mov.s $f12, $f22
/* 1A25D0 80273CF0 0C00A720 */ jal atan2
/* 1A25D4 80273CF4 E6000010 */ swc1 $f0, 0x10($s0)
/* 1A25D8 80273CF8 4600B306 */ mov.s $f12, $f22
/* 1A25DC 80273CFC 4406C000 */ mfc1 $a2, $f24
/* 1A25E0 80273D00 4407D000 */ mfc1 $a3, $f26
/* 1A25E4 80273D04 4600A386 */ mov.s $f14, $f20
/* 1A25E8 80273D08 0C00A7B5 */ jal dist2D
/* 1A25EC 80273D0C E6000054 */ swc1 $f0, 0x54($s0)
/* 1A25F0 80273D10 86020070 */ lh $v0, 0x70($s0)
/* 1A25F4 80273D14 46000086 */ mov.s $f2, $f0
/* 1A25F8 80273D18 14400018 */ bnez $v0, .L80273D7C
/* 1A25FC 80273D1C E6020058 */ swc1 $f2, 0x58($s0)
/* 1A2600 80273D20 C600004C */ lwc1 $f0, 0x4c($s0)
/* 1A2604 80273D24 46001003 */ div.s $f0, $f2, $f0
/* 1A2608 80273D28 4600020D */ trunc.w.s $f8, $f0
/* 1A260C 80273D2C 44024000 */ mfc1 $v0, $f8
/* 1A2610 80273D30 00000000 */ nop
/* 1A2614 80273D34 A6020070 */ sh $v0, 0x70($s0)
/* 1A2618 80273D38 00021400 */ sll $v0, $v0, 0x10
/* 1A261C 80273D3C 14400002 */ bnez $v0, .L80273D48
/* 1A2620 80273D40 24020001 */ addiu $v0, $zero, 1
/* 1A2624 80273D44 A6020070 */ sh $v0, 0x70($s0)
.L80273D48:
/* 1A2628 80273D48 86020070 */ lh $v0, 0x70($s0)
/* 1A262C 80273D4C C602004C */ lwc1 $f2, 0x4c($s0)
/* 1A2630 80273D50 44823000 */ mtc1 $v0, $f6
/* 1A2634 80273D54 00000000 */ nop
/* 1A2638 80273D58 468031A0 */ cvt.s.w $f6, $f6
/* 1A263C 80273D5C 46023102 */ mul.s $f4, $f6, $f2
/* 1A2640 80273D60 00000000 */ nop
/* 1A2644 80273D64 C6000058 */ lwc1 $f0, 0x58($s0)
/* 1A2648 80273D68 46040001 */ sub.s $f0, $f0, $f4
/* 1A264C 80273D6C 46060003 */ div.s $f0, $f0, $f6
/* 1A2650 80273D70 46001080 */ add.s $f2, $f2, $f0
/* 1A2654 80273D74 0809CF64 */ j .L80273D90
/* 1A2658 80273D78 E602004C */ swc1 $f2, 0x4c($s0)
.L80273D7C:
/* 1A265C 80273D7C 44820000 */ mtc1 $v0, $f0
/* 1A2660 80273D80 00000000 */ nop
/* 1A2664 80273D84 46800020 */ cvt.s.w $f0, $f0
/* 1A2668 80273D88 46001003 */ div.s $f0, $f2, $f0
/* 1A266C 80273D8C E600004C */ swc1 $f0, 0x4c($s0)
.L80273D90:
/* 1A2670 80273D90 860201B4 */ lh $v0, 0x1b4($s0)
/* 1A2674 80273D94 24420001 */ addiu $v0, $v0, 1
/* 1A2678 80273D98 44820000 */ mtc1 $v0, $f0
/* 1A267C 80273D9C 00000000 */ nop
/* 1A2680 80273DA0 46800020 */ cvt.s.w $f0, $f0
/* 1A2684 80273DA4 24020001 */ addiu $v0, $zero, 1
/* 1A2688 80273DA8 E620004C */ swc1 $f0, 0x4c($s1)
/* 1A268C 80273DAC AE420070 */ sw $v0, 0x70($s2)
.L80273DB0:
/* 1A2690 80273DB0 8E250040 */ lw $a1, 0x40($s1)
/* 1A2694 80273DB4 8E260048 */ lw $a2, 0x48($s1)
/* 1A2698 80273DB8 0C09904A */ jal add_xz_vec3f
/* 1A269C 80273DBC 0220202D */ daddu $a0, $s1, $zero
/* 1A26A0 80273DC0 C6200000 */ lwc1 $f0, ($s1)
/* 1A26A4 80273DC4 E6000144 */ swc1 $f0, 0x144($s0)
/* 1A26A8 80273DC8 C6200004 */ lwc1 $f0, 4($s1)
/* 1A26AC 80273DCC E6000148 */ swc1 $f0, 0x148($s0)
/* 1A26B0 80273DD0 C6200008 */ lwc1 $f0, 8($s1)
/* 1A26B4 80273DD4 E600014C */ swc1 $f0, 0x14c($s0)
/* 1A26B8 80273DD8 C6220040 */ lwc1 $f2, 0x40($s1)
/* 1A26BC 80273DDC 3C014080 */ lui $at, 0x4080
/* 1A26C0 80273DE0 44810000 */ mtc1 $at, $f0
/* 1A26C4 80273DE4 00000000 */ nop
/* 1A26C8 80273DE8 4600103C */ c.lt.s $f2, $f0
/* 1A26CC 80273DEC 00000000 */ nop
/* 1A26D0 80273DF0 45000007 */ bc1f .L80273E10
/* 1A26D4 80273DF4 0000202D */ daddu $a0, $zero, $zero
/* 1A26D8 80273DF8 C600018C */ lwc1 $f0, 0x18c($s0)
/* 1A26DC 80273DFC E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A26E0 80273E00 8E050144 */ lw $a1, 0x144($s0)
/* 1A26E4 80273E04 8E060148 */ lw $a2, 0x148($s0)
/* 1A26E8 80273E08 0809CF8A */ j .L80273E28
/* 1A26EC 80273E0C 8E07014C */ lw $a3, 0x14c($s0)
.L80273E10:
/* 1A26F0 80273E10 C600018C */ lwc1 $f0, 0x18c($s0)
/* 1A26F4 80273E14 E7A00010 */ swc1 $f0, 0x10($sp)
/* 1A26F8 80273E18 8E050144 */ lw $a1, 0x144($s0)
/* 1A26FC 80273E1C 8E060148 */ lw $a2, 0x148($s0)
/* 1A2700 80273E20 8E07014C */ lw $a3, 0x14c($s0)
/* 1A2704 80273E24 24040001 */ addiu $a0, $zero, 1
.L80273E28:
/* 1A2708 80273E28 0C0990BC */ jal play_movement_dust_effects
/* 1A270C 80273E2C 00000000 */ nop
/* 1A2710 80273E30 C622004C */ lwc1 $f2, 0x4c($s1)
/* 1A2714 80273E34 C6200040 */ lwc1 $f0, 0x40($s1)
/* 1A2718 80273E38 46001080 */ add.s $f2, $f2, $f0
/* 1A271C 80273E3C E622004C */ swc1 $f2, 0x4c($s1)
/* 1A2720 80273E40 860201B4 */ lh $v0, 0x1b4($s0)
/* 1A2724 80273E44 44820000 */ mtc1 $v0, $f0
/* 1A2728 80273E48 00000000 */ nop
/* 1A272C 80273E4C 46800020 */ cvt.s.w $f0, $f0
/* 1A2730 80273E50 4602003C */ c.lt.s $f0, $f2
/* 1A2734 80273E54 00000000 */ nop
/* 1A2738 80273E58 45000013 */ bc1f .L80273EA8
/* 1A273C 80273E5C 00000000 */ nop
/* 1A2740 80273E60 92020135 */ lbu $v0, 0x135($s0)
/* 1A2744 80273E64 24420001 */ addiu $v0, $v0, 1
/* 1A2748 80273E68 A2020135 */ sb $v0, 0x135($s0)
/* 1A274C 80273E6C AE20004C */ sw $zero, 0x4c($s1)
/* 1A2750 80273E70 92020135 */ lbu $v0, 0x135($s0)
/* 1A2754 80273E74 30420001 */ andi $v0, $v0, 1
/* 1A2758 80273E78 10400004 */ beqz $v0, .L80273E8C
/* 1A275C 80273E7C 24040141 */ addiu $a0, $zero, 0x141
/* 1A2760 80273E80 C600014C */ lwc1 $f0, 0x14c($s0)
/* 1A2764 80273E84 0809CFA6 */ j .L80273E98
/* 1A2768 80273E88 E7A00010 */ swc1 $f0, 0x10($sp)
.L80273E8C:
/* 1A276C 80273E8C C600014C */ lwc1 $f0, 0x14c($s0)
/* 1A2770 80273E90 24040142 */ addiu $a0, $zero, 0x142
/* 1A2774 80273E94 E7A00010 */ swc1 $f0, 0x10($sp)
.L80273E98:
/* 1A2778 80273E98 8E060144 */ lw $a2, 0x144($s0)
/* 1A277C 80273E9C 8E070148 */ lw $a3, 0x148($s0)
/* 1A2780 80273EA0 0C052757 */ jal play_sound_at_position
/* 1A2784 80273EA4 0000282D */ daddu $a1, $zero, $zero
.L80273EA8:
/* 1A2788 80273EA8 96220064 */ lhu $v0, 0x64($s1)
/* 1A278C 80273EAC 2442FFFF */ addiu $v0, $v0, -1
/* 1A2790 80273EB0 A6220064 */ sh $v0, 0x64($s1)
/* 1A2794 80273EB4 00021400 */ sll $v0, $v0, 0x10
/* 1A2798 80273EB8 1C400006 */ bgtz $v0, .L80273ED4
/* 1A279C 80273EBC 0000102D */ daddu $v0, $zero, $zero
/* 1A27A0 80273EC0 C620000C */ lwc1 $f0, 0xc($s1)
/* 1A27A4 80273EC4 E6000144 */ swc1 $f0, 0x144($s0)
/* 1A27A8 80273EC8 C6200014 */ lwc1 $f0, 0x14($s1)
/* 1A27AC 80273ECC 24020002 */ addiu $v0, $zero, 2
/* 1A27B0 80273ED0 E600014C */ swc1 $f0, 0x14c($s0)
.L80273ED4:
/* 1A27B4 80273ED4 8FBF0024 */ lw $ra, 0x24($sp)
/* 1A27B8 80273ED8 8FB20020 */ lw $s2, 0x20($sp)
/* 1A27BC 80273EDC 8FB1001C */ lw $s1, 0x1c($sp)
/* 1A27C0 80273EE0 8FB00018 */ lw $s0, 0x18($sp)
/* 1A27C4 80273EE4 D7BA0040 */ ldc1 $f26, 0x40($sp)
/* 1A27C8 80273EE8 D7B80038 */ ldc1 $f24, 0x38($sp)
/* 1A27CC 80273EEC D7B60030 */ ldc1 $f22, 0x30($sp)
/* 1A27D0 80273EF0 D7B40028 */ ldc1 $f20, 0x28($sp)
/* 1A27D4 80273EF4 03E00008 */ jr $ra
/* 1A27D8 80273EF8 27BD0048 */ addiu $sp, $sp, 0x48