papermario/asm/nonmatchings/code_17FEB0/ItemAfflictEnemy.s
2020-10-14 23:49:49 -04:00

153 lines
7.8 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel ItemAfflictEnemy
/* 181204 80252924 27BDFFD8 */ addiu $sp, $sp, -0x28
/* 181208 80252928 AFB20018 */ sw $s2, 0x18($sp)
/* 18120C 8025292C 0080902D */ daddu $s2, $a0, $zero
/* 181210 80252930 AFBF0020 */ sw $ra, 0x20($sp)
/* 181214 80252934 AFB3001C */ sw $s3, 0x1c($sp)
/* 181218 80252938 AFB10014 */ sw $s1, 0x14($sp)
/* 18121C 8025293C AFB00010 */ sw $s0, 0x10($sp)
/* 181220 80252940 8E50000C */ lw $s0, 0xc($s2)
/* 181224 80252944 3C11800E */ lui $s1, %hi(gBattleStatus)
/* 181228 80252948 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
/* 18122C 8025294C 8E130000 */ lw $s3, ($s0)
/* 181230 80252950 26100004 */ addiu $s0, $s0, 4
/* 181234 80252954 8E020000 */ lw $v0, ($s0)
/* 181238 80252958 26100004 */ addiu $s0, $s0, 4
/* 18123C 8025295C AE20018C */ sw $zero, 0x18c($s1)
/* 181240 80252960 AE220188 */ sw $v0, 0x188($s1)
/* 181244 80252964 8E020000 */ lw $v0, ($s0)
/* 181248 80252968 26100004 */ addiu $s0, $s0, 4
/* 18124C 8025296C AE220190 */ sw $v0, 0x190($s1)
/* 181250 80252970 8E050000 */ lw $a1, ($s0)
/* 181254 80252974 0C0B1EAF */ jal get_variable
/* 181258 80252978 26100004 */ addiu $s0, $s0, 4
/* 18125C 8025297C 8E230190 */ lw $v1, 0x190($s1)
/* 181260 80252980 0240202D */ daddu $a0, $s2, $zero
/* 181264 80252984 00621825 */ or $v1, $v1, $v0
/* 181268 80252988 AE230190 */ sw $v1, 0x190($s1)
/* 18126C 8025298C 8E050000 */ lw $a1, ($s0)
/* 181270 80252990 0C0B1EAF */ jal get_variable
/* 181274 80252994 26100004 */ addiu $s0, $s0, 4
/* 181278 80252998 A622017E */ sh $v0, 0x17e($s1)
/* 18127C 8025299C 8E100000 */ lw $s0, ($s0)
/* 181280 802529A0 24020030 */ addiu $v0, $zero, 0x30
/* 181284 802529A4 32030030 */ andi $v1, $s0, 0x30
/* 181288 802529A8 54620004 */ bnel $v1, $v0, .L802529BC
/* 18128C 802529AC 32020010 */ andi $v0, $s0, 0x10
/* 181290 802529B0 8E220000 */ lw $v0, ($s1)
/* 181294 802529B4 08094A7F */ j .L802529FC
/* 181298 802529B8 34420030 */ ori $v0, $v0, 0x30
.L802529BC:
/* 18129C 802529BC 10400004 */ beqz $v0, .L802529D0
/* 1812A0 802529C0 2403FFDF */ addiu $v1, $zero, -0x21
/* 1812A4 802529C4 8E220000 */ lw $v0, ($s1)
/* 1812A8 802529C8 08094A7E */ j .L802529F8
/* 1812AC 802529CC 34420010 */ ori $v0, $v0, 0x10
.L802529D0:
/* 1812B0 802529D0 32020020 */ andi $v0, $s0, 0x20
/* 1812B4 802529D4 10400005 */ beqz $v0, .L802529EC
/* 1812B8 802529D8 2403FFEF */ addiu $v1, $zero, -0x11
/* 1812BC 802529DC 8E220000 */ lw $v0, ($s1)
/* 1812C0 802529E0 00431024 */ and $v0, $v0, $v1
/* 1812C4 802529E4 08094A7F */ j .L802529FC
/* 1812C8 802529E8 34420020 */ ori $v0, $v0, 0x20
.L802529EC:
/* 1812CC 802529EC 8E220000 */ lw $v0, ($s1)
/* 1812D0 802529F0 00431024 */ and $v0, $v0, $v1
/* 1812D4 802529F4 2403FFDF */ addiu $v1, $zero, -0x21
.L802529F8:
/* 1812D8 802529F8 00431024 */ and $v0, $v0, $v1
.L802529FC:
/* 1812DC 802529FC AE220000 */ sw $v0, ($s1)
/* 1812E0 80252A00 32020040 */ andi $v0, $s0, 0x40
/* 1812E4 80252A04 10400007 */ beqz $v0, .L80252A24
/* 1812E8 80252A08 2404FFBF */ addiu $a0, $zero, -0x41
/* 1812EC 80252A0C 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 1812F0 80252A10 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 1812F4 80252A14 8C620000 */ lw $v0, ($v1)
/* 1812F8 80252A18 34420040 */ ori $v0, $v0, 0x40
/* 1812FC 80252A1C 08094A8E */ j .L80252A38
/* 181300 80252A20 AC620000 */ sw $v0, ($v1)
.L80252A24:
/* 181304 80252A24 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181308 80252A28 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 18130C 80252A2C 8C430000 */ lw $v1, ($v0)
/* 181310 80252A30 00641824 */ and $v1, $v1, $a0
/* 181314 80252A34 AC430000 */ sw $v1, ($v0)
.L80252A38:
/* 181318 80252A38 32020200 */ andi $v0, $s0, 0x200
/* 18131C 80252A3C 10400007 */ beqz $v0, .L80252A5C
/* 181320 80252A40 2404FDFF */ addiu $a0, $zero, -0x201
/* 181324 80252A44 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181328 80252A48 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 18132C 80252A4C 8C620000 */ lw $v0, ($v1)
/* 181330 80252A50 34420200 */ ori $v0, $v0, 0x200
/* 181334 80252A54 08094A9C */ j .L80252A70
/* 181338 80252A58 AC620000 */ sw $v0, ($v1)
.L80252A5C:
/* 18133C 80252A5C 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181340 80252A60 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 181344 80252A64 8C430000 */ lw $v1, ($v0)
/* 181348 80252A68 00641824 */ and $v1, $v1, $a0
/* 18134C 80252A6C AC430000 */ sw $v1, ($v0)
.L80252A70:
/* 181350 80252A70 32020080 */ andi $v0, $s0, 0x80
/* 181354 80252A74 10400007 */ beqz $v0, .L80252A94
/* 181358 80252A78 2404FF7F */ addiu $a0, $zero, -0x81
/* 18135C 80252A7C 3C03800E */ lui $v1, %hi(gBattleStatus)
/* 181360 80252A80 2463C070 */ addiu $v1, $v1, %lo(gBattleStatus)
/* 181364 80252A84 8C620000 */ lw $v0, ($v1)
/* 181368 80252A88 34420080 */ ori $v0, $v0, 0x80
/* 18136C 80252A8C 08094AAA */ j .L80252AA8
/* 181370 80252A90 AC620000 */ sw $v0, ($v1)
.L80252A94:
/* 181374 80252A94 3C02800E */ lui $v0, %hi(gBattleStatus)
/* 181378 80252A98 2442C070 */ addiu $v0, $v0, %lo(gBattleStatus)
/* 18137C 80252A9C 8C430000 */ lw $v1, ($v0)
/* 181380 80252AA0 00641824 */ and $v1, $v1, $a0
/* 181384 80252AA4 AC430000 */ sw $v1, ($v0)
.L80252AA8:
/* 181388 80252AA8 0C09A75B */ jal get_actor
/* 18138C 80252AAC 8E440148 */ lw $a0, 0x148($s2)
/* 181390 80252AB0 94430428 */ lhu $v1, 0x428($v0)
/* 181394 80252AB4 A62301A0 */ sh $v1, 0x1a0($s1)
/* 181398 80252AB8 92230193 */ lbu $v1, 0x193($s1)
/* 18139C 80252ABC 90420426 */ lbu $v0, 0x426($v0)
/* 1813A0 80252AC0 A2230194 */ sb $v1, 0x194($s1)
/* 1813A4 80252AC4 306300FF */ andi $v1, $v1, 0xff
/* 1813A8 80252AC8 A22201A2 */ sb $v0, 0x1a2($s1)
/* 1813AC 80252ACC 240200FF */ addiu $v0, $zero, 0xff
/* 1813B0 80252AD0 50620001 */ beql $v1, $v0, .L80252AD8
/* 1813B4 80252AD4 A2200194 */ sb $zero, 0x194($s1)
.L80252AD8:
/* 1813B8 80252AD8 8E220190 */ lw $v0, 0x190($s1)
/* 1813BC 80252ADC 30420F00 */ andi $v0, $v0, 0xf00
/* 1813C0 80252AE0 00021203 */ sra $v0, $v0, 8
/* 1813C4 80252AE4 0C0945BA */ jal calc_item_damage_enemy
/* 1813C8 80252AE8 A2220195 */ sb $v0, 0x195($s1)
/* 1813CC 80252AEC 0440000B */ bltz $v0, .L80252B1C
/* 1813D0 80252AF0 0240202D */ daddu $a0, $s2, $zero
/* 1813D4 80252AF4 0260282D */ daddu $a1, $s3, $zero
/* 1813D8 80252AF8 0C0B2026 */ jal set_variable
/* 1813DC 80252AFC 0040302D */ daddu $a2, $v0, $zero
/* 1813E0 80252B00 0C0B1069 */ jal does_script_exist_by_ref
/* 1813E4 80252B04 0240202D */ daddu $a0, $s2, $zero
/* 1813E8 80252B08 0040182D */ daddu $v1, $v0, $zero
/* 1813EC 80252B0C 10600004 */ beqz $v1, .L80252B20
/* 1813F0 80252B10 240200FF */ addiu $v0, $zero, 0xff
/* 1813F4 80252B14 08094AC8 */ j .L80252B20
/* 1813F8 80252B18 24020002 */ addiu $v0, $zero, 2
.L80252B1C:
/* 1813FC 80252B1C 240200FF */ addiu $v0, $zero, 0xff
.L80252B20:
/* 181400 80252B20 8FBF0020 */ lw $ra, 0x20($sp)
/* 181404 80252B24 8FB3001C */ lw $s3, 0x1c($sp)
/* 181408 80252B28 8FB20018 */ lw $s2, 0x18($sp)
/* 18140C 80252B2C 8FB10014 */ lw $s1, 0x14($sp)
/* 181410 80252B30 8FB00010 */ lw $s0, 0x10($sp)
/* 181414 80252B34 03E00008 */ jr $ra
/* 181418 80252B38 27BD0028 */ addiu $sp, $sp, 0x28