papermario/asm/nonmatchings/code_427A70/func_802A928C_427CFC.s
2021-01-13 00:42:27 +09:00

313 lines
16 KiB
ArmAsm
Generated

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A928C_427CFC
/* 427CFC 802A928C 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 427D00 802A9290 AFB10014 */ sw $s1, 0x14($sp)
/* 427D04 802A9294 3C11802A */ lui $s1, %hi(D_8029FBE0)
/* 427D08 802A9298 2631FBE0 */ addiu $s1, $s1, %lo(D_8029FBE0)
/* 427D0C 802A929C AFBF001C */ sw $ra, 0x1c($sp)
/* 427D10 802A92A0 AFB20018 */ sw $s2, 0x18($sp)
/* 427D14 802A92A4 AFB00010 */ sw $s0, 0x10($sp)
/* 427D18 802A92A8 8623004C */ lh $v1, 0x4c($s1)
/* 427D1C 802A92AC 3C12800E */ lui $s2, %hi(gBattleStatus)
/* 427D20 802A92B0 2652C070 */ addiu $s2, $s2, %lo(gBattleStatus)
/* 427D24 802A92B4 2C62000D */ sltiu $v0, $v1, 0xd
/* 427D28 802A92B8 10400106 */ beqz $v0, .L802A96D4
/* 427D2C 802A92BC 00031080 */ sll $v0, $v1, 2
/* 427D30 802A92C0 3C01802B */ lui $at, %hi(jtbl_802A9830_4282A0)
/* 427D34 802A92C4 00220821 */ addu $at, $at, $v0
/* 427D38 802A92C8 8C229830 */ lw $v0, %lo(jtbl_802A9830_4282A0)($at)
/* 427D3C 802A92CC 00400008 */ jr $v0
/* 427D40 802A92D0 00000000 */ nop
glabel L802A92D4_427D44
/* 427D44 802A92D4 0C093EB1 */ jal set_popup_duration
/* 427D48 802A92D8 24040063 */ addiu $a0, $zero, 0x63
/* 427D4C 802A92DC 8E300004 */ lw $s0, 4($s1)
/* 427D50 802A92E0 240500FF */ addiu $a1, $zero, 0xff
/* 427D54 802A92E4 0C0513AC */ jal icon_set_opacity
/* 427D58 802A92E8 0200202D */ daddu $a0, $s0, $zero
/* 427D5C 802A92EC 82220061 */ lb $v0, 0x61($s1)
/* 427D60 802A92F0 10400003 */ beqz $v0, .L802A9300
/* 427D64 802A92F4 0200202D */ daddu $a0, $s0, $zero
/* 427D68 802A92F8 0C05128B */ jal clear_icon_flags
/* 427D6C 802A92FC 24050002 */ addiu $a1, $zero, 2
.L802A9300:
/* 427D70 802A9300 8E300008 */ lw $s0, 8($s1)
/* 427D74 802A9304 240500FF */ addiu $a1, $zero, 0xff
/* 427D78 802A9308 0C0513AC */ jal icon_set_opacity
/* 427D7C 802A930C 0200202D */ daddu $a0, $s0, $zero
/* 427D80 802A9310 82220061 */ lb $v0, 0x61($s1)
/* 427D84 802A9314 10400003 */ beqz $v0, .L802A9324
/* 427D88 802A9318 0200202D */ daddu $a0, $s0, $zero
/* 427D8C 802A931C 0C05128B */ jal clear_icon_flags
/* 427D90 802A9320 24050002 */ addiu $a1, $zero, 2
.L802A9324:
/* 427D94 802A9324 24020001 */ addiu $v0, $zero, 1
/* 427D98 802A9328 080AA5B5 */ j .L802A96D4
/* 427D9C 802A932C A622004C */ sh $v0, 0x4c($s1)
glabel L802A9330_427DA0
/* 427DA0 802A9330 0C093EB1 */ jal set_popup_duration
/* 427DA4 802A9334 24040063 */ addiu $a0, $zero, 0x63
/* 427DA8 802A9338 96220056 */ lhu $v0, 0x56($s1)
/* 427DAC 802A933C 24420014 */ addiu $v0, $v0, 0x14
/* 427DB0 802A9340 A6220056 */ sh $v0, 0x56($s1)
/* 427DB4 802A9344 00021400 */ sll $v0, $v0, 0x10
/* 427DB8 802A9348 00021403 */ sra $v0, $v0, 0x10
/* 427DBC 802A934C 28420033 */ slti $v0, $v0, 0x33
/* 427DC0 802A9350 14400002 */ bnez $v0, .L802A935C
/* 427DC4 802A9354 24020032 */ addiu $v0, $zero, 0x32
/* 427DC8 802A9358 A6220056 */ sh $v0, 0x56($s1)
.L802A935C:
/* 427DCC 802A935C 8E240004 */ lw $a0, 4($s1)
/* 427DD0 802A9360 86250056 */ lh $a1, 0x56($s1)
/* 427DD4 802A9364 0C051261 */ jal set_icon_render_pos
/* 427DD8 802A9368 86260058 */ lh $a2, 0x58($s1)
/* 427DDC 802A936C 8E240008 */ lw $a0, 8($s1)
/* 427DE0 802A9370 86260058 */ lh $a2, 0x58($s1)
/* 427DE4 802A9374 86250056 */ lh $a1, 0x56($s1)
/* 427DE8 802A9378 0C051261 */ jal set_icon_render_pos
/* 427DEC 802A937C 24C6001C */ addiu $a2, $a2, 0x1c
/* 427DF0 802A9380 080AA5B5 */ j .L802A96D4
/* 427DF4 802A9384 00000000 */ nop
glabel L802A9388_427DF8
/* 427DF8 802A9388 0C093EB1 */ jal set_popup_duration
/* 427DFC 802A938C 24040063 */ addiu $a0, $zero, 0x63
/* 427E00 802A9390 8622004E */ lh $v0, 0x4e($s1)
/* 427E04 802A9394 9623004E */ lhu $v1, 0x4e($s1)
/* 427E08 802A9398 10400003 */ beqz $v0, .L802A93A8
/* 427E0C 802A939C 2462FFFF */ addiu $v0, $v1, -1
/* 427E10 802A93A0 080AA5B5 */ j .L802A96D4
/* 427E14 802A93A4 A622004E */ sh $v0, 0x4e($s1)
.L802A93A8:
/* 427E18 802A93A8 8E240004 */ lw $a0, 4($s1)
/* 427E1C 802A93AC 3C058011 */ lui $a1, %hi(D_80108B80)
/* 427E20 802A93B0 24A58B80 */ addiu $a1, $a1, %lo(D_80108B80)
/* 427E24 802A93B4 0C0511FF */ jal set_menu_icon_script
/* 427E28 802A93B8 00000000 */ nop
/* 427E2C 802A93BC 3C048000 */ lui $a0, 0x8000
/* 427E30 802A93C0 34840041 */ ori $a0, $a0, 0x41
/* 427E34 802A93C4 0000282D */ daddu $a1, $zero, $zero
/* 427E38 802A93C8 00A0302D */ daddu $a2, $a1, $zero
/* 427E3C 802A93CC 96220052 */ lhu $v0, 0x52($s1)
/* 427E40 802A93D0 00A0382D */ daddu $a3, $a1, $zero
/* 427E44 802A93D4 A6200044 */ sh $zero, 0x44($s1)
/* 427E48 802A93D8 0C0526AE */ jal _play_sound
/* 427E4C 802A93DC A6220054 */ sh $v0, 0x54($s1)
/* 427E50 802A93E0 2402000B */ addiu $v0, $zero, 0xb
/* 427E54 802A93E4 A622004C */ sh $v0, 0x4c($s1)
glabel L802A93E8_427E58
/* 427E58 802A93E8 0C093EB1 */ jal set_popup_duration
/* 427E5C 802A93EC 24040063 */ addiu $a0, $zero, 0x63
/* 427E60 802A93F0 86220068 */ lh $v0, 0x68($s1)
/* 427E64 802A93F4 14400021 */ bnez $v0, .L802A947C
/* 427E68 802A93F8 00000000 */ nop
/* 427E6C 802A93FC 82220080 */ lb $v0, 0x80($s1)
/* 427E70 802A9400 00021040 */ sll $v0, $v0, 1
/* 427E74 802A9404 02221021 */ addu $v0, $s1, $v0
/* 427E78 802A9408 84430074 */ lh $v1, 0x74($v0)
/* 427E7C 802A940C 86220044 */ lh $v0, 0x44($s1)
/* 427E80 802A9410 14600002 */ bnez $v1, .L802A941C
/* 427E84 802A9414 0043001A */ div $zero, $v0, $v1
/* 427E88 802A9418 0007000D */ break 7
.L802A941C:
/* 427E8C 802A941C 2401FFFF */ addiu $at, $zero, -1
/* 427E90 802A9420 14610004 */ bne $v1, $at, .L802A9434
/* 427E94 802A9424 3C018000 */ lui $at, 0x8000
/* 427E98 802A9428 14410002 */ bne $v0, $at, .L802A9434
/* 427E9C 802A942C 00000000 */ nop
/* 427EA0 802A9430 0006000D */ break 6
.L802A9434:
/* 427EA4 802A9434 00001012 */ mflo $v0
/* 427EA8 802A9438 3C036666 */ lui $v1, 0x6666
/* 427EAC 802A943C 34636667 */ ori $v1, $v1, 0x6667
/* 427EB0 802A9440 00430018 */ mult $v0, $v1
/* 427EB4 802A9444 000217C3 */ sra $v0, $v0, 0x1f
/* 427EB8 802A9448 00001810 */ mfhi $v1
/* 427EBC 802A944C 000318C3 */ sra $v1, $v1, 3
/* 427EC0 802A9450 00621823 */ subu $v1, $v1, $v0
/* 427EC4 802A9454 00031880 */ sll $v1, $v1, 2
/* 427EC8 802A9458 96220044 */ lhu $v0, 0x44($s1)
/* 427ECC 802A945C 3C01802B */ lui $at, %hi(D_802A9812)
/* 427ED0 802A9460 00230821 */ addu $at, $at, $v1
/* 427ED4 802A9464 94239812 */ lhu $v1, %lo(D_802A9812)($at)
/* 427ED8 802A9468 00431023 */ subu $v0, $v0, $v1
/* 427EDC 802A946C A6220044 */ sh $v0, 0x44($s1)
/* 427EE0 802A9470 00021400 */ sll $v0, $v0, 0x10
/* 427EE4 802A9474 04420001 */ bltzl $v0, .L802A947C
/* 427EE8 802A9478 A6200044 */ sh $zero, 0x44($s1)
.L802A947C:
/* 427EEC 802A947C 8E420214 */ lw $v0, 0x214($s2)
/* 427EF0 802A9480 30428000 */ andi $v0, $v0, 0x8000
/* 427EF4 802A9484 10400039 */ beqz $v0, .L802A956C
/* 427EF8 802A9488 24020001 */ addiu $v0, $zero, 1
/* 427EFC 802A948C 86230064 */ lh $v1, 0x64($s1)
/* 427F00 802A9490 10620018 */ beq $v1, $v0, .L802A94F4
/* 427F04 802A9494 28620002 */ slti $v0, $v1, 2
/* 427F08 802A9498 50400005 */ beql $v0, $zero, .L802A94B0
/* 427F0C 802A949C 24020002 */ addiu $v0, $zero, 2
/* 427F10 802A94A0 10600007 */ beqz $v1, .L802A94C0
/* 427F14 802A94A4 3C0451EB */ lui $a0, 0x51eb
/* 427F18 802A94A8 080AA55B */ j .L802A956C
/* 427F1C 802A94AC 00000000 */ nop
.L802A94B0:
/* 427F20 802A94B0 10620019 */ beq $v1, $v0, .L802A9518
/* 427F24 802A94B4 3C0451EB */ lui $a0, 0x51eb
/* 427F28 802A94B8 080AA55B */ j .L802A956C
/* 427F2C 802A94BC 00000000 */ nop
.L802A94C0:
/* 427F30 802A94C0 86220050 */ lh $v0, 0x50($s1)
/* 427F34 802A94C4 8E430434 */ lw $v1, 0x434($s2)
/* 427F38 802A94C8 00021080 */ sll $v0, $v0, 2
/* 427F3C 802A94CC 00431021 */ addu $v0, $v0, $v1
/* 427F40 802A94D0 8C430000 */ lw $v1, ($v0)
/* 427F44 802A94D4 3484851F */ ori $a0, $a0, 0x851f
/* 427F48 802A94D8 00031100 */ sll $v0, $v1, 4
/* 427F4C 802A94DC 00431023 */ subu $v0, $v0, $v1
/* 427F50 802A94E0 00021080 */ sll $v0, $v0, 2
/* 427F54 802A94E4 00431023 */ subu $v0, $v0, $v1
/* 427F58 802A94E8 00021080 */ sll $v0, $v0, 2
/* 427F5C 802A94EC 080AA552 */ j .L802A9548
/* 427F60 802A94F0 00431023 */ subu $v0, $v0, $v1
.L802A94F4:
/* 427F64 802A94F4 86220050 */ lh $v0, 0x50($s1)
/* 427F68 802A94F8 8E430434 */ lw $v1, 0x434($s2)
/* 427F6C 802A94FC 00021080 */ sll $v0, $v0, 2
/* 427F70 802A9500 00431021 */ addu $v0, $v0, $v1
/* 427F74 802A9504 8C420000 */ lw $v0, ($v0)
/* 427F78 802A9508 96230044 */ lhu $v1, 0x44($s1)
/* 427F7C 802A950C 000210C0 */ sll $v0, $v0, 3
/* 427F80 802A9510 080AA55A */ j .L802A9568
/* 427F84 802A9514 00621821 */ addu $v1, $v1, $v0
.L802A9518:
/* 427F88 802A9518 86220050 */ lh $v0, 0x50($s1)
/* 427F8C 802A951C 8E430434 */ lw $v1, 0x434($s2)
/* 427F90 802A9520 00021080 */ sll $v0, $v0, 2
/* 427F94 802A9524 00431021 */ addu $v0, $v0, $v1
/* 427F98 802A9528 8C430000 */ lw $v1, ($v0)
/* 427F9C 802A952C 3484851F */ ori $a0, $a0, 0x851f
/* 427FA0 802A9530 00031040 */ sll $v0, $v1, 1
/* 427FA4 802A9534 00431021 */ addu $v0, $v0, $v1
/* 427FA8 802A9538 000210C0 */ sll $v0, $v0, 3
/* 427FAC 802A953C 00431023 */ subu $v0, $v0, $v1
/* 427FB0 802A9540 000210C0 */ sll $v0, $v0, 3
/* 427FB4 802A9544 00431021 */ addu $v0, $v0, $v1
.L802A9548:
/* 427FB8 802A9548 00021080 */ sll $v0, $v0, 2
/* 427FBC 802A954C 00440018 */ mult $v0, $a0
/* 427FC0 802A9550 000217C3 */ sra $v0, $v0, 0x1f
/* 427FC4 802A9554 96230044 */ lhu $v1, 0x44($s1)
/* 427FC8 802A9558 00004810 */ mfhi $t1
/* 427FCC 802A955C 00092143 */ sra $a0, $t1, 5
/* 427FD0 802A9560 00822023 */ subu $a0, $a0, $v0
/* 427FD4 802A9564 00641821 */ addu $v1, $v1, $a0
.L802A9568:
/* 427FD8 802A9568 A6230044 */ sh $v1, 0x44($s1)
.L802A956C:
/* 427FDC 802A956C 86220044 */ lh $v0, 0x44($s1)
/* 427FE0 802A9570 28422711 */ slti $v0, $v0, 0x2711
/* 427FE4 802A9574 14400010 */ bnez $v0, .L802A95B8
/* 427FE8 802A9578 3C1051EB */ lui $s0, 0x51eb
/* 427FEC 802A957C 8E30000C */ lw $s0, 0xc($s1)
/* 427FF0 802A9580 86250056 */ lh $a1, 0x56($s1)
/* 427FF4 802A9584 86260058 */ lh $a2, 0x58($s1)
/* 427FF8 802A9588 24022710 */ addiu $v0, $zero, 0x2710
/* 427FFC 802A958C A6220044 */ sh $v0, 0x44($s1)
/* 428000 802A9590 24020001 */ addiu $v0, $zero, 1
/* 428004 802A9594 A6220068 */ sh $v0, 0x68($s1)
/* 428008 802A9598 0200202D */ daddu $a0, $s0, $zero
/* 42800C 802A959C 24A50032 */ addiu $a1, $a1, 0x32
/* 428010 802A95A0 0C051261 */ jal set_icon_render_pos
/* 428014 802A95A4 24C6001C */ addiu $a2, $a2, 0x1c
/* 428018 802A95A8 0200202D */ daddu $a0, $s0, $zero
/* 42801C 802A95AC 0C05128B */ jal clear_icon_flags
/* 428020 802A95B0 24050002 */ addiu $a1, $zero, 2
/* 428024 802A95B4 3C1051EB */ lui $s0, 0x51eb
.L802A95B8:
/* 428028 802A95B8 3610851F */ ori $s0, $s0, 0x851f
/* 42802C 802A95BC 96230044 */ lhu $v1, 0x44($s1)
/* 428030 802A95C0 3C048000 */ lui $a0, 0x8000
/* 428034 802A95C4 00031C00 */ sll $v1, $v1, 0x10
/* 428038 802A95C8 00031403 */ sra $v0, $v1, 0x10
/* 42803C 802A95CC 00500018 */ mult $v0, $s0
/* 428040 802A95D0 34840041 */ ori $a0, $a0, 0x41
/* 428044 802A95D4 0000282D */ daddu $a1, $zero, $zero
/* 428048 802A95D8 00A0302D */ daddu $a2, $a1, $zero
/* 42804C 802A95DC 00031FC3 */ sra $v1, $v1, 0x1f
/* 428050 802A95E0 00004810 */ mfhi $t1
/* 428054 802A95E4 00094143 */ sra $t0, $t1, 5
/* 428058 802A95E8 01034023 */ subu $t0, $t0, $v1
/* 42805C 802A95EC 00081600 */ sll $v0, $t0, 0x18
/* 428060 802A95F0 00021603 */ sra $v0, $v0, 0x18
/* 428064 802A95F4 00023840 */ sll $a3, $v0, 1
/* 428068 802A95F8 00E23821 */ addu $a3, $a3, $v0
/* 42806C 802A95FC 00073880 */ sll $a3, $a3, 2
/* 428070 802A9600 0C0526F9 */ jal func_80149BE4
/* 428074 802A9604 A2480084 */ sb $t0, 0x84($s2)
/* 428078 802A9608 86220054 */ lh $v0, 0x54($s1)
/* 42807C 802A960C 96230054 */ lhu $v1, 0x54($s1)
/* 428080 802A9610 1440002C */ bnez $v0, .L802A96C4
/* 428084 802A9614 2462FFFF */ addiu $v0, $v1, -1
/* 428088 802A9618 96220044 */ lhu $v0, 0x44($s1)
/* 42808C 802A961C 00021C00 */ sll $v1, $v0, 0x10
/* 428090 802A9620 00031403 */ sra $v0, $v1, 0x10
/* 428094 802A9624 14400003 */ bnez $v0, .L802A9634
/* 428098 802A9628 00500018 */ mult $v0, $s0
/* 42809C 802A962C 080AA591 */ j .L802A9644
/* 4280A0 802A9630 2402FFFF */ addiu $v0, $zero, -1
.L802A9634:
/* 4280A4 802A9634 00031FC3 */ sra $v1, $v1, 0x1f
/* 4280A8 802A9638 00004810 */ mfhi $t1
/* 4280AC 802A963C 00091143 */ sra $v0, $t1, 5
/* 4280B0 802A9640 00431023 */ subu $v0, $v0, $v1
.L802A9644:
/* 4280B4 802A9644 A2420081 */ sb $v0, 0x81($s2)
/* 4280B8 802A9648 82220080 */ lb $v0, 0x80($s1)
/* 4280BC 802A964C 2442FFFF */ addiu $v0, $v0, -1
/* 4280C0 802A9650 00021040 */ sll $v0, $v0, 1
/* 4280C4 802A9654 02221021 */ addu $v0, $s1, $v0
/* 4280C8 802A9658 84430074 */ lh $v1, 0x74($v0)
/* 4280CC 802A965C 82420081 */ lb $v0, 0x81($s2)
/* 4280D0 802A9660 0062102A */ slt $v0, $v1, $v0
/* 4280D4 802A9664 14400002 */ bnez $v0, .L802A9670
/* 4280D8 802A9668 24020001 */ addiu $v0, $zero, 1
/* 4280DC 802A966C 2402FFFE */ addiu $v0, $zero, -2
.L802A9670:
/* 4280E0 802A9670 A2420086 */ sb $v0, 0x86($s2)
/* 4280E4 802A9674 82430081 */ lb $v1, 0x81($s2)
/* 4280E8 802A9678 24020064 */ addiu $v0, $zero, 0x64
/* 4280EC 802A967C 14620004 */ bne $v1, $v0, .L802A9690
/* 4280F0 802A9680 3C048000 */ lui $a0, 0x8000
/* 4280F4 802A9684 0C09A458 */ jal func_80269160
/* 4280F8 802A9688 00000000 */ nop
/* 4280FC 802A968C 3C048000 */ lui $a0, 0x8000
.L802A9690:
/* 428100 802A9690 0C05271B */ jal stop_sound
/* 428104 802A9694 34840041 */ ori $a0, $a0, 0x41
/* 428108 802A9698 0C093EB1 */ jal set_popup_duration
/* 42810C 802A969C 0000202D */ daddu $a0, $zero, $zero
/* 428110 802A96A0 24020005 */ addiu $v0, $zero, 5
/* 428114 802A96A4 A6220054 */ sh $v0, 0x54($s1)
/* 428118 802A96A8 2402000C */ addiu $v0, $zero, 0xc
/* 42811C 802A96AC 080AA5B5 */ j .L802A96D4
/* 428120 802A96B0 A622004C */ sh $v0, 0x4c($s1)
glabel L802A96B4_428124
/* 428124 802A96B4 86220054 */ lh $v0, 0x54($s1)
/* 428128 802A96B8 96230054 */ lhu $v1, 0x54($s1)
/* 42812C 802A96BC 10400003 */ beqz $v0, .L802A96CC
/* 428130 802A96C0 2462FFFF */ addiu $v0, $v1, -1
.L802A96C4:
/* 428134 802A96C4 080AA5B5 */ j .L802A96D4
/* 428138 802A96C8 A6220054 */ sh $v0, 0x54($s1)
.L802A96CC:
/* 42813C 802A96CC 0C09A327 */ jal func_80268C9C
/* 428140 802A96D0 00000000 */ nop
.L802A96D4:
glabel L802A96D4_428144
/* 428144 802A96D4 8FBF001C */ lw $ra, 0x1c($sp)
/* 428148 802A96D8 8FB20018 */ lw $s2, 0x18($sp)
/* 42814C 802A96DC 8FB10014 */ lw $s1, 0x14($sp)
/* 428150 802A96E0 8FB00010 */ lw $s0, 0x10($sp)
/* 428154 802A96E4 03E00008 */ jr $ra
/* 428158 802A96E8 27BD0020 */ addiu $sp, $sp, 0x20