mirror of
https://github.com/pmret/papermario.git
synced 2024-11-18 17:02:46 +01:00
200 lines
10 KiB
ArmAsm
200 lines
10 KiB
ArmAsm
.set noat # allow manual use of $at
|
|
.set noreorder # don't insert nops after branches
|
|
|
|
glabel update_enemy_change_turn
|
|
/* 175B8C 802472AC 27BDFFE0 */ addiu $sp, $sp, -0x20
|
|
/* 175B90 802472B0 AFB10014 */ sw $s1, 0x14($sp)
|
|
/* 175B94 802472B4 3C11800E */ lui $s1, %hi(gBattleStatus)
|
|
/* 175B98 802472B8 2631C070 */ addiu $s1, $s1, %lo(gBattleStatus)
|
|
/* 175B9C 802472BC AFBF0018 */ sw $ra, 0x18($sp)
|
|
/* 175BA0 802472C0 AFB00010 */ sw $s0, 0x10($sp)
|
|
/* 175BA4 802472C4 8E2A00D8 */ lw $t2, 0xd8($s1)
|
|
/* 175BA8 802472C8 3C03800E */ lui $v1, %hi(gBattleStatus+0x46C)
|
|
/* 175BAC 802472CC 8C63C4DC */ lw $v1, %lo(gBattleStatus+0x46C)($v1)
|
|
/* 175BB0 802472D0 8E2700DC */ lw $a3, 0xdc($s1)
|
|
/* 175BB4 802472D4 0460009F */ bltz $v1, .L80247554
|
|
/* 175BB8 802472D8 28620002 */ slti $v0, $v1, 2
|
|
/* 175BBC 802472DC 14400005 */ bnez $v0, .L802472F4
|
|
/* 175BC0 802472E0 24020002 */ addiu $v0, $zero, 2
|
|
/* 175BC4 802472E4 10620080 */ beq $v1, $v0, .L802474E8
|
|
/* 175BC8 802472E8 00000000 */ nop
|
|
/* 175BCC 802472EC 08091D55 */ j .L80247554
|
|
/* 175BD0 802472F0 00000000 */ nop
|
|
.L802472F4:
|
|
/* 175BD4 802472F4 82240170 */ lb $a0, 0x170($s1)
|
|
/* 175BD8 802472F8 82220171 */ lb $v0, 0x171($s1)
|
|
/* 175BDC 802472FC 0082102A */ slt $v0, $a0, $v0
|
|
/* 175BE0 80247300 14400004 */ bnez $v0, .L80247314
|
|
/* 175BE4 80247304 3C050020 */ lui $a1, 0x20
|
|
/* 175BE8 80247308 A2200170 */ sb $zero, 0x170($s1)
|
|
/* 175BEC 8024730C 08091D53 */ j .L8024754C
|
|
/* 175BF0 80247310 24040006 */ addiu $a0, $zero, 6
|
|
.L80247314:
|
|
/* 175BF4 80247314 34A54000 */ ori $a1, $a1, 0x4000
|
|
/* 175BF8 80247318 00041040 */ sll $v0, $a0, 1
|
|
.L8024731C:
|
|
/* 175BFC 8024731C 02221021 */ addu $v0, $s1, $v0
|
|
/* 175C00 80247320 84430140 */ lh $v1, 0x140($v0)
|
|
/* 175C04 80247324 94420140 */ lhu $v0, 0x140($v0)
|
|
/* 175C08 80247328 0460000A */ bltz $v1, .L80247354
|
|
/* 175C0C 8024732C 304200FF */ andi $v0, $v0, 0xff
|
|
/* 175C10 80247330 00021080 */ sll $v0, $v0, 2
|
|
/* 175C14 80247334 02221021 */ addu $v0, $s1, $v0
|
|
/* 175C18 80247338 8C5000E0 */ lw $s0, 0xe0($v0)
|
|
/* 175C1C 8024733C 12000005 */ beqz $s0, .L80247354
|
|
/* 175C20 80247340 00000000 */ nop
|
|
/* 175C24 80247344 8E020000 */ lw $v0, ($s0)
|
|
/* 175C28 80247348 00451024 */ and $v0, $v0, $a1
|
|
/* 175C2C 8024734C 1040000B */ beqz $v0, .L8024737C
|
|
/* 175C30 80247350 00041040 */ sll $v0, $a0, 1
|
|
.L80247354:
|
|
/* 175C34 80247354 82220171 */ lb $v0, 0x171($s1)
|
|
/* 175C38 80247358 24840001 */ addiu $a0, $a0, 1
|
|
/* 175C3C 8024735C 0082102A */ slt $v0, $a0, $v0
|
|
/* 175C40 80247360 50400001 */ beql $v0, $zero, .L80247368
|
|
/* 175C44 80247364 0000202D */ daddu $a0, $zero, $zero
|
|
.L80247368:
|
|
/* 175C48 80247368 1480FFEC */ bnez $a0, .L8024731C
|
|
/* 175C4C 8024736C 00041040 */ sll $v0, $a0, 1
|
|
/* 175C50 80247370 A2200170 */ sb $zero, 0x170($s1)
|
|
/* 175C54 80247374 08091D53 */ j .L8024754C
|
|
/* 175C58 80247378 24040006 */ addiu $a0, $zero, 6
|
|
.L8024737C:
|
|
/* 175C5C 8024737C 02221021 */ addu $v0, $s1, $v0
|
|
/* 175C60 80247380 94420140 */ lhu $v0, 0x140($v0)
|
|
/* 175C64 80247384 24840001 */ addiu $a0, $a0, 1
|
|
/* 175C68 80247388 AE300174 */ sw $s0, 0x174($s1)
|
|
/* 175C6C 8024738C A2240170 */ sb $a0, 0x170($s1)
|
|
/* 175C70 80247390 A6220172 */ sh $v0, 0x172($s1)
|
|
/* 175C74 80247394 82040210 */ lb $a0, 0x210($s0)
|
|
/* 175C78 80247398 38820006 */ xori $v0, $a0, 6
|
|
/* 175C7C 8024739C 2C430001 */ sltiu $v1, $v0, 1
|
|
/* 175C80 802473A0 24020003 */ addiu $v0, $zero, 3
|
|
/* 175C84 802473A4 50820001 */ beql $a0, $v0, .L802473AC
|
|
/* 175C88 802473A8 24030001 */ addiu $v1, $zero, 1
|
|
.L802473AC:
|
|
/* 175C8C 802473AC 24020004 */ addiu $v0, $zero, 4
|
|
/* 175C90 802473B0 50820001 */ beql $a0, $v0, .L802473B8
|
|
/* 175C94 802473B4 24030001 */ addiu $v1, $zero, 1
|
|
.L802473B8:
|
|
/* 175C98 802473B8 24020005 */ addiu $v0, $zero, 5
|
|
/* 175C9C 802473BC 50820001 */ beql $a0, $v0, .L802473C4
|
|
/* 175CA0 802473C0 24030001 */ addiu $v1, $zero, 1
|
|
.L802473C4:
|
|
/* 175CA4 802473C4 24020007 */ addiu $v0, $zero, 7
|
|
/* 175CA8 802473C8 50820001 */ beql $a0, $v0, .L802473D0
|
|
/* 175CAC 802473CC 24030001 */ addiu $v1, $zero, 1
|
|
.L802473D0:
|
|
/* 175CB0 802473D0 24020008 */ addiu $v0, $zero, 8
|
|
/* 175CB4 802473D4 50820001 */ beql $a0, $v0, .L802473DC
|
|
/* 175CB8 802473D8 24030001 */ addiu $v1, $zero, 1
|
|
.L802473DC:
|
|
/* 175CBC 802473DC 82020214 */ lb $v0, 0x214($s0)
|
|
/* 175CC0 802473E0 240B000C */ addiu $t3, $zero, 0xc
|
|
/* 175CC4 802473E4 504B0001 */ beql $v0, $t3, .L802473EC
|
|
/* 175CC8 802473E8 24030001 */ addiu $v1, $zero, 1
|
|
.L802473EC:
|
|
/* 175CCC 802473EC 8E020000 */ lw $v0, ($s0)
|
|
/* 175CD0 802473F0 3C090001 */ lui $t1, 1
|
|
/* 175CD4 802473F4 00491024 */ and $v0, $v0, $t1
|
|
/* 175CD8 802473F8 54400001 */ bnel $v0, $zero, .L80247400
|
|
/* 175CDC 802473FC 24030001 */ addiu $v1, $zero, 1
|
|
.L80247400:
|
|
/* 175CE0 80247400 10600005 */ beqz $v1, .L80247418
|
|
/* 175CE4 80247404 3C03FFFB */ lui $v1, 0xfffb
|
|
/* 175CE8 80247408 3C01800E */ lui $at, %hi(gBattleStatus+0x46C)
|
|
/* 175CEC 8024740C AC20C4DC */ sw $zero, %lo(gBattleStatus+0x46C)($at)
|
|
/* 175CF0 80247410 08091D55 */ j .L80247554
|
|
/* 175CF4 80247414 00000000 */ nop
|
|
.L80247418:
|
|
/* 175CF8 80247418 3463FFFF */ ori $v1, $v1, 0xffff
|
|
/* 175CFC 8024741C 3C04FFF7 */ lui $a0, 0xfff7
|
|
/* 175D00 80247420 3484FFFF */ ori $a0, $a0, 0xffff
|
|
/* 175D04 80247424 3C06F7FF */ lui $a2, 0xf7ff
|
|
/* 175D08 80247428 3C05800E */ lui $a1, %hi(gBattleStatus)
|
|
/* 175D0C 8024742C 24A5C070 */ addiu $a1, $a1, %lo(gBattleStatus)
|
|
/* 175D10 80247430 2408FFFD */ addiu $t0, $zero, -3
|
|
/* 175D14 80247434 A220008C */ sb $zero, 0x8c($s1)
|
|
/* 175D18 80247438 8CA20000 */ lw $v0, ($a1)
|
|
/* 175D1C 8024743C 34C6FFFF */ ori $a2, $a2, 0xffff
|
|
/* 175D20 80247440 00481024 */ and $v0, $v0, $t0
|
|
/* 175D24 80247444 00431024 */ and $v0, $v0, $v1
|
|
/* 175D28 80247448 2403EFFF */ addiu $v1, $zero, -0x1001
|
|
/* 175D2C 8024744C 00431024 */ and $v0, $v0, $v1
|
|
/* 175D30 80247450 00441024 */ and $v0, $v0, $a0
|
|
/* 175D34 80247454 ACA20000 */ sw $v0, ($a1)
|
|
/* 175D38 80247458 8D420000 */ lw $v0, ($t2)
|
|
/* 175D3C 8024745C 3C030400 */ lui $v1, 0x400
|
|
/* 175D40 80247460 00461024 */ and $v0, $v0, $a2
|
|
/* 175D44 80247464 00431025 */ or $v0, $v0, $v1
|
|
/* 175D48 80247468 10E00005 */ beqz $a3, .L80247480
|
|
/* 175D4C 8024746C AD420000 */ sw $v0, ($t2)
|
|
/* 175D50 80247470 8CE20000 */ lw $v0, ($a3)
|
|
/* 175D54 80247474 00461024 */ and $v0, $v0, $a2
|
|
/* 175D58 80247478 00431025 */ or $v0, $v0, $v1
|
|
/* 175D5C 8024747C ACE20000 */ sw $v0, ($a3)
|
|
.L80247480:
|
|
/* 175D60 80247480 8CA20004 */ lw $v0, 4($a1)
|
|
/* 175D64 80247484 2403FFFB */ addiu $v1, $zero, -5
|
|
/* 175D68 80247488 00481024 */ and $v0, $v0, $t0
|
|
/* 175D6C 8024748C 00431024 */ and $v0, $v0, $v1
|
|
/* 175D70 80247490 00491025 */ or $v0, $v0, $t1
|
|
/* 175D74 80247494 ACA20004 */ sw $v0, 4($a1)
|
|
/* 175D78 80247498 92020134 */ lbu $v0, 0x134($s0)
|
|
/* 175D7C 8024749C 8E0301CC */ lw $v1, 0x1cc($s0)
|
|
/* 175D80 802474A0 3C01802A */ lui $at, %hi(D_8029F244)
|
|
/* 175D84 802474A4 A022F244 */ sb $v0, %lo(D_8029F244)($at)
|
|
/* 175D88 802474A8 1060000A */ beqz $v1, .L802474D4
|
|
/* 175D8C 802474AC 2405000A */ addiu $a1, $zero, 0xa
|
|
/* 175D90 802474B0 A22B01A7 */ sb $t3, 0x1a7($s1)
|
|
/* 175D94 802474B4 8E0401CC */ lw $a0, 0x1cc($s0)
|
|
/* 175D98 802474B8 0C0B0CF8 */ jal start_script
|
|
/* 175D9C 802474BC 0000302D */ daddu $a2, $zero, $zero
|
|
/* 175DA0 802474C0 AE0201DC */ sw $v0, 0x1dc($s0)
|
|
/* 175DA4 802474C4 8C430144 */ lw $v1, 0x144($v0)
|
|
/* 175DA8 802474C8 AE0301EC */ sw $v1, 0x1ec($s0)
|
|
/* 175DAC 802474CC 86230172 */ lh $v1, 0x172($s1)
|
|
/* 175DB0 802474D0 AC430148 */ sw $v1, 0x148($v0)
|
|
.L802474D4:
|
|
/* 175DB4 802474D4 24020002 */ addiu $v0, $zero, 2
|
|
/* 175DB8 802474D8 3C01800E */ lui $at, %hi(gBattleStatus+0x46C)
|
|
/* 175DBC 802474DC AC22C4DC */ sw $v0, %lo(gBattleStatus+0x46C)($at)
|
|
/* 175DC0 802474E0 08091D55 */ j .L80247554
|
|
/* 175DC4 802474E4 00000000 */ nop
|
|
.L802474E8:
|
|
/* 175DC8 802474E8 8222008C */ lb $v0, 0x8c($s1)
|
|
/* 175DCC 802474EC 14400019 */ bnez $v0, .L80247554
|
|
/* 175DD0 802474F0 00000000 */ nop
|
|
/* 175DD4 802474F4 0C09A75B */ jal get_actor
|
|
/* 175DD8 802474F8 86240172 */ lh $a0, 0x172($s1)
|
|
/* 175DDC 802474FC 0040802D */ daddu $s0, $v0, $zero
|
|
/* 175DE0 80247500 12000012 */ beqz $s0, .L8024754C
|
|
/* 175DE4 80247504 24040014 */ addiu $a0, $zero, 0x14
|
|
/* 175DE8 80247508 92030134 */ lbu $v1, 0x134($s0)
|
|
/* 175DEC 8024750C 3C02802A */ lui $v0, %hi(D_8029F244)
|
|
/* 175DF0 80247510 9042F244 */ lbu $v0, %lo(D_8029F244)($v0)
|
|
/* 175DF4 80247514 1462000D */ bne $v1, $v0, .L8024754C
|
|
/* 175DF8 80247518 00000000 */ nop
|
|
/* 175DFC 8024751C 8E0201CC */ lw $v0, 0x1cc($s0)
|
|
/* 175E00 80247520 10400005 */ beqz $v0, .L80247538
|
|
/* 175E04 80247524 00000000 */ nop
|
|
/* 175E08 80247528 0C0B1059 */ jal does_script_exist
|
|
/* 175E0C 8024752C 8E0401EC */ lw $a0, 0x1ec($s0)
|
|
/* 175E10 80247530 14400008 */ bnez $v0, .L80247554
|
|
/* 175E14 80247534 00000000 */ nop
|
|
.L80247538:
|
|
/* 175E18 80247538 82220094 */ lb $v0, 0x94($s1)
|
|
/* 175E1C 8024753C 04410003 */ bgez $v0, .L8024754C
|
|
/* 175E20 80247540 24040015 */ addiu $a0, $zero, 0x15
|
|
/* 175E24 80247544 A2200094 */ sb $zero, 0x94($s1)
|
|
/* 175E28 80247548 24040006 */ addiu $a0, $zero, 6
|
|
.L8024754C:
|
|
/* 175E2C 8024754C 0C090464 */ jal func_80241190
|
|
/* 175E30 80247550 00000000 */ nop
|
|
.L80247554:
|
|
/* 175E34 80247554 8FBF0018 */ lw $ra, 0x18($sp)
|
|
/* 175E38 80247558 8FB10014 */ lw $s1, 0x14($sp)
|
|
/* 175E3C 8024755C 8FB00010 */ lw $s0, 0x10($sp)
|
|
/* 175E40 80247560 03E00008 */ jr $ra
|
|
/* 175E44 80247564 27BD0020 */ addiu $sp, $sp, 0x20
|