papermario/asm/nonmatchings/code_16c8e0/remove_player_buffs.s
2020-08-12 22:37:16 -04:00

220 lines
10 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel remove_player_buffs
/* 195D34 80267454 27BDFFB8 */ addiu $sp, $sp, -0x48
/* 195D38 80267458 AFB30024 */ sw $s3, 0x24($sp)
/* 195D3C 8026745C 0080982D */ daddu $s3, $a0, $zero
/* 195D40 80267460 AFB20020 */ sw $s2, 0x20($sp)
/* 195D44 80267464 3C12800E */ lui $s2, 0x800e
/* 195D48 80267468 2652C070 */ addiu $s2, $s2, -0x3f90
/* 195D4C 8026746C 32620001 */ andi $v0, $s3, 1
/* 195D50 80267470 AFBF002C */ sw $ra, 0x2c($sp)
/* 195D54 80267474 AFB40028 */ sw $s4, 0x28($sp)
/* 195D58 80267478 AFB1001C */ sw $s1, 0x1c($sp)
/* 195D5C 8026747C AFB00018 */ sw $s0, 0x18($sp)
/* 195D60 80267480 F7B80040 */ sdc1 $f24, 0x40($sp)
/* 195D64 80267484 F7B60038 */ sdc1 $f22, 0x38($sp)
/* 195D68 80267488 F7B40030 */ sdc1 $f20, 0x30($sp)
/* 195D6C 8026748C 8E5100D8 */ lw $s1, 0xd8($s2)
/* 195D70 80267490 8E5400DC */ lw $s4, 0xdc($s2)
/* 195D74 80267494 8E3001F4 */ lw $s0, 0x1f4($s1)
/* 195D78 80267498 10400006 */ beqz $v0, .L802674B4
/* 195D7C 8026749C 3C03DFFF */ lui $v1, 0xdfff
/* 195D80 802674A0 8E420000 */ lw $v0, ($s2)
/* 195D84 802674A4 3463FFFF */ ori $v1, $v1, 0xffff
/* 195D88 802674A8 A2400097 */ sb $zero, 0x97($s2)
/* 195D8C 802674AC 00431024 */ and $v0, $v0, $v1
/* 195D90 802674B0 AE420000 */ sw $v0, ($s2)
.L802674B4:
/* 195D94 802674B4 32620002 */ andi $v0, $s3, 2
/* 195D98 802674B8 10400006 */ beqz $v0, .L802674D4
/* 195D9C 802674BC 3C03EFFF */ lui $v1, 0xefff
/* 195DA0 802674C0 8E420000 */ lw $v0, ($s2)
/* 195DA4 802674C4 3463FFFF */ ori $v1, $v1, 0xffff
/* 195DA8 802674C8 A2400096 */ sb $zero, 0x96($s2)
/* 195DAC 802674CC 00431024 */ and $v0, $v0, $v1
/* 195DB0 802674D0 AE420000 */ sw $v0, ($s2)
.L802674D4:
/* 195DB4 802674D4 32620008 */ andi $v0, $s3, 8
/* 195DB8 802674D8 10400003 */ beqz $v0, .L802674E8
/* 195DBC 802674DC 32620010 */ andi $v0, $s3, 0x10
/* 195DC0 802674E0 A2200215 */ sb $zero, 0x215($s1)
/* 195DC4 802674E4 A2200214 */ sb $zero, 0x214($s1)
.L802674E8:
/* 195DC8 802674E8 10400006 */ beqz $v0, .L80267504
/* 195DCC 802674EC 3C03FBFF */ lui $v1, 0xfbff
/* 195DD0 802674F0 8E420000 */ lw $v0, ($s2)
/* 195DD4 802674F4 3463FFFF */ ori $v1, $v1, 0xffff
/* 195DD8 802674F8 A240008B */ sb $zero, 0x8b($s2)
/* 195DDC 802674FC 00431024 */ and $v0, $v0, $v1
/* 195DE0 80267500 AE420000 */ sw $v0, ($s2)
.L80267504:
/* 195DE4 80267504 32620020 */ andi $v0, $s3, 0x20
/* 195DE8 80267508 10400009 */ beqz $v0, .L80267530
/* 195DEC 8026750C 32620040 */ andi $v0, $s3, 0x40
/* 195DF0 80267510 82220212 */ lb $v0, 0x212($s1)
/* 195DF4 80267514 10400006 */ beqz $v0, .L80267530
/* 195DF8 80267518 32620040 */ andi $v0, $s3, 0x40
/* 195DFC 8026751C 86240436 */ lh $a0, 0x436($s1)
/* 195E00 80267520 A2200213 */ sb $zero, 0x213($s1)
/* 195E04 80267524 0C011E68 */ jal func_800479A0
/* 195E08 80267528 A2200212 */ sb $zero, 0x212($s1)
/* 195E0C 8026752C 32620040 */ andi $v0, $s3, 0x40
.L80267530:
/* 195E10 80267530 1040000C */ beqz $v0, .L80267564
/* 195E14 80267534 32620200 */ andi $v0, $s3, 0x200
/* 195E18 80267538 82220218 */ lb $v0, 0x218($s1)
/* 195E1C 8026753C 10400008 */ beqz $v0, .L80267560
/* 195E20 80267540 2403FEFF */ addiu $v1, $zero, -0x101
/* 195E24 80267544 A2200219 */ sb $zero, 0x219($s1)
/* 195E28 80267548 A2200218 */ sb $zero, 0x218($s1)
/* 195E2C 8026754C 8E020000 */ lw $v0, ($s0)
/* 195E30 80267550 00431024 */ and $v0, $v0, $v1
/* 195E34 80267554 AE020000 */ sw $v0, ($s0)
/* 195E38 80267558 0C011EAA */ jal func_80047AA8
/* 195E3C 8026755C 86240436 */ lh $a0, 0x436($s1)
.L80267560:
/* 195E40 80267560 32620200 */ andi $v0, $s3, 0x200
.L80267564:
/* 195E44 80267564 10400058 */ beqz $v0, .L802676C8
/* 195E48 80267568 32620100 */ andi $v0, $s3, 0x100
/* 195E4C 8026756C 8242009D */ lb $v0, 0x9d($s2)
/* 195E50 80267570 10400055 */ beqz $v0, .L802676C8
/* 195E54 80267574 32620100 */ andi $v0, $s3, 0x100
/* 195E58 80267578 8E42043C */ lw $v0, 0x43c($s2)
/* 195E5C 8026757C 3C013FC0 */ lui $at, 0x3fc0
/* 195E60 80267580 44811000 */ mtc1 $at, $f2
/* 195E64 80267584 A240009D */ sb $zero, 0x9d($s2)
/* 195E68 80267588 8C42000C */ lw $v0, 0xc($v0)
/* 195E6C 8026758C A4400010 */ sh $zero, 0x10($v0)
/* 195E70 80267590 8E4300A0 */ lw $v1, 0xa0($s2)
/* 195E74 80267594 3C014190 */ lui $at, 0x4190
/* 195E78 80267598 44810000 */ mtc1 $at, $f0
/* 195E7C 8026759C 8C620000 */ lw $v0, ($v1)
/* 195E80 802675A0 3C0140A0 */ lui $at, 0x40a0
/* 195E84 802675A4 4481A000 */ mtc1 $at, $f20
/* 195E88 802675A8 34420010 */ ori $v0, $v0, 0x10
/* 195E8C 802675AC AC620000 */ sw $v0, ($v1)
/* 195E90 802675B0 2402000A */ addiu $v0, $zero, 0xa
/* 195E94 802675B4 C6240148 */ lwc1 $f4, 0x148($s1)
/* 195E98 802675B8 C626014C */ lwc1 $f6, 0x14c($s1)
/* 195E9C 802675BC 46002100 */ add.s $f4, $f4, $f0
/* 195EA0 802675C0 E7A20010 */ swc1 $f2, 0x10($sp)
/* 195EA4 802675C4 AFA20014 */ sw $v0, 0x14($sp)
/* 195EA8 802675C8 46143180 */ add.s $f6, $f6, $f20
/* 195EAC 802675CC 8E250144 */ lw $a1, 0x144($s1)
/* 195EB0 802675D0 44062000 */ mfc1 $a2, $f4
/* 195EB4 802675D4 44073000 */ mfc1 $a3, $f6
/* 195EB8 802675D8 0C01C694 */ jal func_80071A50
/* 195EBC 802675DC 24040001 */ addiu $a0, $zero, 1
/* 195EC0 802675E0 C6220144 */ lwc1 $f2, 0x144($s1)
/* 195EC4 802675E4 3C014120 */ lui $at, 0x4120
/* 195EC8 802675E8 44810000 */ mtc1 $at, $f0
/* 195ECC 802675EC 00000000 */ nop
/* 195ED0 802675F0 46001081 */ sub.s $f2, $f2, $f0
/* 195ED4 802675F4 C6200148 */ lwc1 $f0, 0x148($s1)
/* 195ED8 802675F8 46140000 */ add.s $f0, $f0, $f20
/* 195EDC 802675FC 44060000 */ mfc1 $a2, $f0
/* 195EE0 80267600 C620014C */ lwc1 $f0, 0x14c($s1)
/* 195EE4 80267604 0000202D */ daddu $a0, $zero, $zero
/* 195EE8 80267608 46140000 */ add.s $f0, $f0, $f20
/* 195EEC 8026760C 3C013F80 */ lui $at, 0x3f80
/* 195EF0 80267610 4481B000 */ mtc1 $at, $f22
/* 195EF4 80267614 44051000 */ mfc1 $a1, $f2
/* 195EF8 80267618 44070000 */ mfc1 $a3, $f0
/* 195EFC 8026761C 24100018 */ addiu $s0, $zero, 0x18
/* 195F00 80267620 E7B60010 */ swc1 $f22, 0x10($sp)
/* 195F04 80267624 0C01C70C */ jal func_80071C30
/* 195F08 80267628 AFB00014 */ sw $s0, 0x14($sp)
/* 195F0C 8026762C C6200144 */ lwc1 $f0, 0x144($s1)
/* 195F10 80267630 3C014170 */ lui $at, 0x4170
/* 195F14 80267634 4481C000 */ mtc1 $at, $f24
/* 195F18 80267638 00000000 */ nop
/* 195F1C 8026763C 46180001 */ sub.s $f0, $f0, $f24
/* 195F20 80267640 C6220148 */ lwc1 $f2, 0x148($s1)
/* 195F24 80267644 44050000 */ mfc1 $a1, $f0
/* 195F28 80267648 3C014200 */ lui $at, 0x4200
/* 195F2C 8026764C 44810000 */ mtc1 $at, $f0
/* 195F30 80267650 00000000 */ nop
/* 195F34 80267654 46001080 */ add.s $f2, $f2, $f0
/* 195F38 80267658 C620014C */ lwc1 $f0, 0x14c($s1)
/* 195F3C 8026765C 46140000 */ add.s $f0, $f0, $f20
/* 195F40 80267660 44061000 */ mfc1 $a2, $f2
/* 195F44 80267664 44070000 */ mfc1 $a3, $f0
/* 195F48 80267668 0000202D */ daddu $a0, $zero, $zero
/* 195F4C 8026766C E7B60010 */ swc1 $f22, 0x10($sp)
/* 195F50 80267670 0C01C70C */ jal func_80071C30
/* 195F54 80267674 AFB00014 */ sw $s0, 0x14($sp)
/* 195F58 80267678 C6200144 */ lwc1 $f0, 0x144($s1)
/* 195F5C 8026767C 46180000 */ add.s $f0, $f0, $f24
/* 195F60 80267680 C6220148 */ lwc1 $f2, 0x148($s1)
/* 195F64 80267684 44050000 */ mfc1 $a1, $f0
/* 195F68 80267688 3C0141B0 */ lui $at, 0x41b0
/* 195F6C 8026768C 44810000 */ mtc1 $at, $f0
/* 195F70 80267690 00000000 */ nop
/* 195F74 80267694 46001080 */ add.s $f2, $f2, $f0
/* 195F78 80267698 C620014C */ lwc1 $f0, 0x14c($s1)
/* 195F7C 8026769C 46140000 */ add.s $f0, $f0, $f20
/* 195F80 802676A0 44061000 */ mfc1 $a2, $f2
/* 195F84 802676A4 44070000 */ mfc1 $a3, $f0
/* 195F88 802676A8 24040001 */ addiu $a0, $zero, 1
/* 195F8C 802676AC E7B60010 */ swc1 $f22, 0x10($sp)
/* 195F90 802676B0 0C01C70C */ jal func_80071C30
/* 195F94 802676B4 AFB00014 */ sw $s0, 0x14($sp)
/* 195F98 802676B8 24040299 */ addiu $a0, $zero, 0x299
/* 195F9C 802676BC 0C05272D */ jal play_sound
/* 195FA0 802676C0 AE4000A0 */ sw $zero, 0xa0($s2)
/* 195FA4 802676C4 32620100 */ andi $v0, $s3, 0x100
.L802676C8:
/* 195FA8 802676C8 10400009 */ beqz $v0, .L802676F0
/* 195FAC 802676CC 32620080 */ andi $v0, $s3, 0x80
/* 195FB0 802676D0 8242009B */ lb $v0, 0x9b($s2)
/* 195FB4 802676D4 10400006 */ beqz $v0, .L802676F0
/* 195FB8 802676D8 32620080 */ andi $v0, $s3, 0x80
/* 195FBC 802676DC 8E42043C */ lw $v0, 0x43c($s2)
/* 195FC0 802676E0 A240009B */ sb $zero, 0x9b($s2)
/* 195FC4 802676E4 8C42000C */ lw $v0, 0xc($v0)
/* 195FC8 802676E8 A4400024 */ sh $zero, 0x24($v0)
/* 195FCC 802676EC 32620080 */ andi $v0, $s3, 0x80
.L802676F0:
/* 195FD0 802676F0 1040000B */ beqz $v0, .L80267720
/* 195FD4 802676F4 00000000 */ nop
/* 195FD8 802676F8 824200A4 */ lb $v0, 0xa4($s2)
/* 195FDC 802676FC 10400008 */ beqz $v0, .L80267720
/* 195FE0 80267700 00000000 */ nop
/* 195FE4 80267704 8E42043C */ lw $v0, 0x43c($s2)
/* 195FE8 80267708 A24000A4 */ sb $zero, 0xa4($s2)
/* 195FEC 8026770C 8C42000C */ lw $v0, 0xc($v0)
/* 195FF0 80267710 A440001A */ sh $zero, 0x1a($v0)
/* 195FF4 80267714 0C016914 */ jal remove_effect
/* 195FF8 80267718 8E4400A8 */ lw $a0, 0xa8($s2)
/* 195FFC 8026771C AE4000A8 */ sw $zero, 0xa8($s2)
.L80267720:
/* 196000 80267720 1280000B */ beqz $s4, .L80267750
/* 196004 80267724 3C020001 */ lui $v0, 1
/* 196008 80267728 02621024 */ and $v0, $s3, $v0
/* 19600C 8026772C 10400008 */ beqz $v0, .L80267750
/* 196010 80267730 3C04BFFF */ lui $a0, 0xbfff
/* 196014 80267734 3C03800E */ lui $v1, 0x800e
/* 196018 80267738 2463C070 */ addiu $v1, $v1, -0x3f90
/* 19601C 8026773C A2800220 */ sb $zero, 0x220($s4)
/* 196020 80267740 8C620000 */ lw $v0, ($v1)
/* 196024 80267744 3484FFFF */ ori $a0, $a0, 0xffff
/* 196028 80267748 00441024 */ and $v0, $v0, $a0
/* 19602C 8026774C AC620000 */ sw $v0, ($v1)
.L80267750:
/* 196030 80267750 8FBF002C */ lw $ra, 0x2c($sp)
/* 196034 80267754 8FB40028 */ lw $s4, 0x28($sp)
/* 196038 80267758 8FB30024 */ lw $s3, 0x24($sp)
/* 19603C 8026775C 8FB20020 */ lw $s2, 0x20($sp)
/* 196040 80267760 8FB1001C */ lw $s1, 0x1c($sp)
/* 196044 80267764 8FB00018 */ lw $s0, 0x18($sp)
/* 196048 80267768 D7B80040 */ ldc1 $f24, 0x40($sp)
/* 19604C 8026776C D7B60038 */ ldc1 $f22, 0x38($sp)
/* 196050 80267770 D7B40030 */ ldc1 $f20, 0x30($sp)
/* 196054 80267774 03E00008 */ jr $ra
/* 196058 80267778 27BD0048 */ addiu $sp, $sp, 0x48