papermario/asm/nonmatchings/code_17FEB0/func_80252B3C.s

148 lines
7.5 KiB
ArmAsm
Raw Normal View History

2020-09-24 05:16:13 +02:00
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_80252B3C
/* 18141C 80252B3C 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 181420 80252B40 AFB20018 */ sw $s2, 0x18($sp)
/* 181424 80252B44 0080902D */ daddu $s2, $a0, $zero
/* 181428 80252B48 AFBF0020 */ sw $ra, 0x20($sp)
/* 18142C 80252B4C AFB3001C */ sw $s3, 0x1c($sp)
/* 181430 80252B50 AFB10014 */ sw $s1, 0x14($sp)
/* 181434 80252B54 AFB00010 */ sw $s0, 0x10($sp)
/* 181438 80252B58 8E50000C */ lw $s0, 0xc($s2)
2020-09-28 03:13:56 +02:00
/* 18143C 80252B5C 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 181440 80252B60 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
2020-09-24 05:16:13 +02:00
/* 181444 80252B64 8E130000 */ lw $s3, ($s0)
/* 181448 80252B68 26100004 */ addiu $s0, $s0, 4
/* 18144C 80252B6C 8E020000 */ lw $v0, ($s0)
/* 181450 80252B70 26100004 */ addiu $s0, $s0, 4
/* 181454 80252B74 AE20018C */ sw $zero, 0x18c($s1)
/* 181458 80252B78 AE220188 */ sw $v0, 0x188($s1)
/* 18145C 80252B7C 8E050000 */ lw $a1, ($s0)
/* 181460 80252B80 0C0B1EAF */ jal get_variable
/* 181464 80252B84 26100004 */ addiu $s0, $s0, 4
/* 181468 80252B88 AE220190 */ sw $v0, 0x190($s1)
/* 18146C 80252B8C 8E050000 */ lw $a1, ($s0)
/* 181470 80252B90 26100004 */ addiu $s0, $s0, 4
/* 181474 80252B94 0C0B1EAF */ jal get_variable
/* 181478 80252B98 0240202D */ daddu $a0, $s2, $zero
/* 18147C 80252B9C A622017E */ sh $v0, 0x17e($s1)
/* 181480 80252BA0 8E100000 */ lw $s0, ($s0)
/* 181484 80252BA4 24020030 */ addiu $v0, $zero, 0x30
/* 181488 80252BA8 32030030 */ andi $v1, $s0, 0x30
/* 18148C 80252BAC 54620004 */ bnel $v1, $v0, .L80252BC0
/* 181490 80252BB0 32020010 */ andi $v0, $s0, 0x10
/* 181494 80252BB4 8E220000 */ lw $v0, ($s1)
/* 181498 80252BB8 08094B00 */ j .L80252C00
/* 18149C 80252BBC 34420030 */ ori $v0, $v0, 0x30
.L80252BC0:
/* 1814A0 80252BC0 10400004 */ beqz $v0, .L80252BD4
/* 1814A4 80252BC4 2403FFDF */ addiu $v1, $zero, -0x21
/* 1814A8 80252BC8 8E220000 */ lw $v0, ($s1)
/* 1814AC 80252BCC 08094AFF */ j .L80252BFC
/* 1814B0 80252BD0 34420010 */ ori $v0, $v0, 0x10
.L80252BD4:
/* 1814B4 80252BD4 32020020 */ andi $v0, $s0, 0x20
/* 1814B8 80252BD8 10400005 */ beqz $v0, .L80252BF0
/* 1814BC 80252BDC 2403FFEF */ addiu $v1, $zero, -0x11
/* 1814C0 80252BE0 8E220000 */ lw $v0, ($s1)
/* 1814C4 80252BE4 00431024 */ and $v0, $v0, $v1
/* 1814C8 80252BE8 08094B00 */ j .L80252C00
/* 1814CC 80252BEC 34420020 */ ori $v0, $v0, 0x20
.L80252BF0:
/* 1814D0 80252BF0 8E220000 */ lw $v0, ($s1)
/* 1814D4 80252BF4 00431024 */ and $v0, $v0, $v1
/* 1814D8 80252BF8 2403FFDF */ addiu $v1, $zero, -0x21
.L80252BFC:
/* 1814DC 80252BFC 00431024 */ and $v0, $v0, $v1
.L80252C00:
/* 1814E0 80252C00 AE220000 */ sw $v0, ($s1)
/* 1814E4 80252C04 32020040 */ andi $v0, $s0, 0x40
/* 1814E8 80252C08 10400007 */ beqz $v0, .L80252C28
/* 1814EC 80252C0C 2404FFBF */ addiu $a0, $zero, -0x41
2020-09-28 03:13:56 +02:00
/* 1814F0 80252C10 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1814F4 80252C14 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
2020-09-24 05:16:13 +02:00
/* 1814F8 80252C18 8C620000 */ lw $v0, ($v1)
/* 1814FC 80252C1C 34420040 */ ori $v0, $v0, 0x40
/* 181500 80252C20 08094B0F */ j .L80252C3C
/* 181504 80252C24 AC620000 */ sw $v0, ($v1)
.L80252C28:
2020-09-28 03:13:56 +02:00
/* 181508 80252C28 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 18150C 80252C2C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
2020-09-24 05:16:13 +02:00
/* 181510 80252C30 8C430000 */ lw $v1, ($v0)
/* 181514 80252C34 00641824 */ and $v1, $v1, $a0
/* 181518 80252C38 AC430000 */ sw $v1, ($v0)
.L80252C3C:
/* 18151C 80252C3C 32020200 */ andi $v0, $s0, 0x200
/* 181520 80252C40 10400007 */ beqz $v0, .L80252C60
/* 181524 80252C44 2404FDFF */ addiu $a0, $zero, -0x201
2020-09-28 03:13:56 +02:00
/* 181528 80252C48 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 18152C 80252C4C 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
2020-09-24 05:16:13 +02:00
/* 181530 80252C50 8C620000 */ lw $v0, ($v1)
/* 181534 80252C54 34420200 */ ori $v0, $v0, 0x200
/* 181538 80252C58 08094B1D */ j .L80252C74
/* 18153C 80252C5C AC620000 */ sw $v0, ($v1)
.L80252C60:
2020-09-28 03:13:56 +02:00
/* 181540 80252C60 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181544 80252C64 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
2020-09-24 05:16:13 +02:00
/* 181548 80252C68 8C430000 */ lw $v1, ($v0)
/* 18154C 80252C6C 00641824 */ and $v1, $v1, $a0
/* 181550 80252C70 AC430000 */ sw $v1, ($v0)
.L80252C74:
/* 181554 80252C74 32020080 */ andi $v0, $s0, 0x80
/* 181558 80252C78 10400007 */ beqz $v0, .L80252C98
/* 18155C 80252C7C 2404FF7F */ addiu $a0, $zero, -0x81
2020-09-28 03:13:56 +02:00
/* 181560 80252C80 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181564 80252C84 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
2020-09-24 05:16:13 +02:00
/* 181568 80252C88 8C620000 */ lw $v0, ($v1)
/* 18156C 80252C8C 34420080 */ ori $v0, $v0, 0x80
/* 181570 80252C90 08094B2B */ j .L80252CAC
/* 181574 80252C94 AC620000 */ sw $v0, ($v1)
.L80252C98:
2020-09-28 03:13:56 +02:00
/* 181578 80252C98 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 18157C 80252C9C 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
2020-09-24 05:16:13 +02:00
/* 181580 80252CA0 8C430000 */ lw $v1, ($v0)
/* 181584 80252CA4 00641824 */ and $v1, $v1, $a0
/* 181588 80252CA8 AC430000 */ sw $v1, ($v0)
.L80252CAC:
/* 18158C 80252CAC 0C09A75B */ jal get_actor
/* 181590 80252CB0 8E440148 */ lw $a0, 0x148($s2)
/* 181594 80252CB4 94430428 */ lhu $v1, 0x428($v0)
/* 181598 80252CB8 A62301A0 */ sh $v1, 0x1a0($s1)
/* 18159C 80252CBC 92230193 */ lbu $v1, 0x193($s1)
/* 1815A0 80252CC0 90420426 */ lbu $v0, 0x426($v0)
/* 1815A4 80252CC4 A2230194 */ sb $v1, 0x194($s1)
/* 1815A8 80252CC8 306300FF */ andi $v1, $v1, 0xff
/* 1815AC 80252CCC A22201A2 */ sb $v0, 0x1a2($s1)
/* 1815B0 80252CD0 240200FF */ addiu $v0, $zero, 0xff
/* 1815B4 80252CD4 50620001 */ beql $v1, $v0, .L80252CDC
/* 1815B8 80252CD8 A2200194 */ sb $zero, 0x194($s1)
.L80252CDC:
/* 1815BC 80252CDC 8E220190 */ lw $v0, 0x190($s1)
/* 1815C0 80252CE0 30420F00 */ andi $v0, $v0, 0xf00
/* 1815C4 80252CE4 00021203 */ sra $v0, $v0, 8
/* 1815C8 80252CE8 0C0945BA */ jal calc_item_damage_enemy
/* 1815CC 80252CEC A2220195 */ sb $v0, 0x195($s1)
/* 1815D0 80252CF0 0440000B */ bltz $v0, .L80252D20
/* 1815D4 80252CF4 0240202D */ daddu $a0, $s2, $zero
/* 1815D8 80252CF8 0260282D */ daddu $a1, $s3, $zero
/* 1815DC 80252CFC 0C0B2026 */ jal set_variable
/* 1815E0 80252D00 0040302D */ daddu $a2, $v0, $zero
/* 1815E4 80252D04 0C0B1069 */ jal does_script_exist_by_ref
/* 1815E8 80252D08 0240202D */ daddu $a0, $s2, $zero
/* 1815EC 80252D0C 0040182D */ daddu $v1, $v0, $zero
/* 1815F0 80252D10 10600004 */ beqz $v1, .L80252D24
/* 1815F4 80252D14 240200FF */ addiu $v0, $zero, 0xff
/* 1815F8 80252D18 08094B49 */ j .L80252D24
/* 1815FC 80252D1C 24020002 */ addiu $v0, $zero, 2
.L80252D20:
/* 181600 80252D20 240200FF */ addiu $v0, $zero, 0xff
.L80252D24:
/* 181604 80252D24 8FBF0020 */ lw $ra, 0x20($sp)
/* 181608 80252D28 8FB3001C */ lw $s3, 0x1c($sp)
/* 18160C 80252D2C 8FB20018 */ lw $s2, 0x18($sp)
/* 181610 80252D30 8FB10014 */ lw $s1, 0x14($sp)
/* 181614 80252D34 8FB00010 */ lw $s0, 0x10($sp)
/* 181618 80252D38 03E00008 */ jr $ra
/* 18161C 80252D3C 27BD0028 */ addiu $sp, $sp, 0x28