papermario/asm/nonmatchings/code_425590/func_802A91F8_425788.s

187 lines
9.7 KiB
ArmAsm
Raw Normal View History

2021-01-10 11:05:49 +01:00
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_802A91F8_425788
/* 425788 802A91F8 27BDFFE0 */ addiu $sp, $sp, -0x20
/* 42578C 802A91FC AFB10014 */ sw $s1, 0x14($sp)
/* 425790 802A9200 3C11802A */ lui $s1, %hi(D_8029FBE0)
/* 425794 802A9204 2631FBE0 */ addiu $s1, $s1, %lo(D_8029FBE0)
/* 425798 802A9208 AFBF0018 */ sw $ra, 0x18($sp)
/* 42579C 802A920C AFB00010 */ sw $s0, 0x10($sp)
/* 4257A0 802A9210 8623004C */ lh $v1, 0x4c($s1)
/* 4257A4 802A9214 3C10800E */ lui $s0, %hi(gBattleStatus)
/* 4257A8 802A9218 2610C070 */ addiu $s0, $s0, %lo(gBattleStatus)
/* 4257AC 802A921C 2C62000D */ sltiu $v0, $v1, 0xd
/* 4257B0 802A9220 1040009B */ beqz $v0, .L802A9490
/* 4257B4 802A9224 00031080 */ sll $v0, $v1, 2
/* 4257B8 802A9228 3C01802B */ lui $at, %hi(D_802A9580)
/* 4257BC 802A922C 00220821 */ addu $at, $at, $v0
/* 4257C0 802A9230 8C229580 */ lw $v0, %lo(D_802A9580)($at)
/* 4257C4 802A9234 00400008 */ jr $v0
/* 4257C8 802A9238 00000000 */ nop
/* 4257CC 802A923C 0C093EB1 */ jal set_popup_duration
/* 4257D0 802A9240 24040063 */ addiu $a0, $zero, 0x63
/* 4257D4 802A9244 82220061 */ lb $v0, 0x61($s1)
/* 4257D8 802A9248 8E300004 */ lw $s0, 4($s1)
/* 4257DC 802A924C 10400004 */ beqz $v0, .L802A9260
/* 4257E0 802A9250 0200202D */ daddu $a0, $s0, $zero
/* 4257E4 802A9254 0C05128B */ jal clear_icon_flags
/* 4257E8 802A9258 24050002 */ addiu $a1, $zero, 2
/* 4257EC 802A925C 0200202D */ daddu $a0, $s0, $zero
.L802A9260:
/* 4257F0 802A9260 0C0513AC */ jal icon_set_opacity
/* 4257F4 802A9264 240500FF */ addiu $a1, $zero, 0xff
/* 4257F8 802A9268 8E300008 */ lw $s0, 8($s1)
/* 4257FC 802A926C 240500FF */ addiu $a1, $zero, 0xff
/* 425800 802A9270 0C0513AC */ jal icon_set_opacity
/* 425804 802A9274 0200202D */ daddu $a0, $s0, $zero
/* 425808 802A9278 82220061 */ lb $v0, 0x61($s1)
/* 42580C 802A927C 10400003 */ beqz $v0, .L802A928C
/* 425810 802A9280 0200202D */ daddu $a0, $s0, $zero
/* 425814 802A9284 0C05128B */ jal clear_icon_flags
/* 425818 802A9288 24050002 */ addiu $a1, $zero, 2
.L802A928C:
/* 42581C 802A928C 24020001 */ addiu $v0, $zero, 1
/* 425820 802A9290 080AA524 */ j .L802A9490
/* 425824 802A9294 A622004C */ sh $v0, 0x4c($s1)
/* 425828 802A9298 0C093EB1 */ jal set_popup_duration
/* 42582C 802A929C 24040063 */ addiu $a0, $zero, 0x63
/* 425830 802A92A0 96220056 */ lhu $v0, 0x56($s1)
/* 425834 802A92A4 24420014 */ addiu $v0, $v0, 0x14
/* 425838 802A92A8 A6220056 */ sh $v0, 0x56($s1)
/* 42583C 802A92AC 00021400 */ sll $v0, $v0, 0x10
/* 425840 802A92B0 00021403 */ sra $v0, $v0, 0x10
/* 425844 802A92B4 28420033 */ slti $v0, $v0, 0x33
/* 425848 802A92B8 14400002 */ bnez $v0, .L802A92C4
/* 42584C 802A92BC 24020032 */ addiu $v0, $zero, 0x32
/* 425850 802A92C0 A6220056 */ sh $v0, 0x56($s1)
.L802A92C4:
/* 425854 802A92C4 8E240004 */ lw $a0, 4($s1)
/* 425858 802A92C8 86250056 */ lh $a1, 0x56($s1)
/* 42585C 802A92CC 0C051261 */ jal set_icon_render_pos
/* 425860 802A92D0 86260058 */ lh $a2, 0x58($s1)
/* 425864 802A92D4 8E240008 */ lw $a0, 8($s1)
/* 425868 802A92D8 86260058 */ lh $a2, 0x58($s1)
/* 42586C 802A92DC 86250056 */ lh $a1, 0x56($s1)
/* 425870 802A92E0 0C051261 */ jal set_icon_render_pos
/* 425874 802A92E4 24C6001C */ addiu $a2, $a2, 0x1c
/* 425878 802A92E8 080AA524 */ j .L802A9490
/* 42587C 802A92EC 00000000 */ nop
/* 425880 802A92F0 0C093EB1 */ jal set_popup_duration
/* 425884 802A92F4 24040063 */ addiu $a0, $zero, 0x63
/* 425888 802A92F8 8622004E */ lh $v0, 0x4e($s1)
/* 42588C 802A92FC 9623004E */ lhu $v1, 0x4e($s1)
/* 425890 802A9300 10400003 */ beqz $v0, .L802A9310
/* 425894 802A9304 2462FFFF */ addiu $v0, $v1, -1
/* 425898 802A9308 080AA524 */ j .L802A9490
/* 42589C 802A930C A622004E */ sh $v0, 0x4e($s1)
.L802A9310:
/* 4258A0 802A9310 8E240004 */ lw $a0, 4($s1)
/* 4258A4 802A9314 3C058011 */ lui $a1, %hi(D_80108B80)
/* 4258A8 802A9318 24A58B80 */ addiu $a1, $a1, %lo(D_80108B80)
/* 4258AC 802A931C 0C0511FF */ jal set_menu_icon_script
/* 4258B0 802A9320 00000000 */ nop
/* 4258B4 802A9324 96230052 */ lhu $v1, 0x52($s1)
/* 4258B8 802A9328 2402000B */ addiu $v0, $zero, 0xb
/* 4258BC 802A932C A6200044 */ sh $zero, 0x44($s1)
/* 4258C0 802A9330 A622004C */ sh $v0, 0x4c($s1)
/* 4258C4 802A9334 A6230054 */ sh $v1, 0x54($s1)
/* 4258C8 802A9338 0C093EB1 */ jal set_popup_duration
/* 4258CC 802A933C 24040063 */ addiu $a0, $zero, 0x63
/* 4258D0 802A9340 8622006A */ lh $v0, 0x6a($s1)
/* 4258D4 802A9344 1440000E */ bnez $v0, .L802A9380
/* 4258D8 802A9348 3C052AAA */ lui $a1, 0x2aaa
/* 4258DC 802A934C 8E020214 */ lw $v0, 0x214($s0)
/* 4258E0 802A9350 30428000 */ andi $v0, $v0, 0x8000
/* 4258E4 802A9354 10400025 */ beqz $v0, .L802A93EC
/* 4258E8 802A9358 3C0351EB */ lui $v1, 0x51eb
/* 4258EC 802A935C 86230050 */ lh $v1, 0x50($s1)
/* 4258F0 802A9360 8E020434 */ lw $v0, 0x434($s0)
/* 4258F4 802A9364 00031880 */ sll $v1, $v1, 2
/* 4258F8 802A9368 00621821 */ addu $v1, $v1, $v0
/* 4258FC 802A936C 96220044 */ lhu $v0, 0x44($s1)
/* 425900 802A9370 94630002 */ lhu $v1, 2($v1)
/* 425904 802A9374 00431021 */ addu $v0, $v0, $v1
/* 425908 802A9378 080AA4FA */ j .L802A93E8
/* 42590C 802A937C A6220044 */ sh $v0, 0x44($s1)
.L802A9380:
/* 425910 802A9380 86220050 */ lh $v0, 0x50($s1)
/* 425914 802A9384 8E030434 */ lw $v1, 0x434($s0)
/* 425918 802A9388 00021080 */ sll $v0, $v0, 2
/* 42591C 802A938C 00431021 */ addu $v0, $v0, $v1
/* 425920 802A9390 8C430000 */ lw $v1, ($v0)
/* 425924 802A9394 34A5AAAB */ ori $a1, $a1, 0xaaab
/* 425928 802A9398 00650018 */ mult $v1, $a1
/* 42592C 802A939C 96220044 */ lhu $v0, 0x44($s1)
/* 425930 802A93A0 00031FC3 */ sra $v1, $v1, 0x1f
/* 425934 802A93A4 00003810 */ mfhi $a3
/* 425938 802A93A8 00E31823 */ subu $v1, $a3, $v1
/* 42593C 802A93AC 00431021 */ addu $v0, $v0, $v1
/* 425940 802A93B0 A6220044 */ sh $v0, 0x44($s1)
/* 425944 802A93B4 86220050 */ lh $v0, 0x50($s1)
/* 425948 802A93B8 8E030434 */ lw $v1, 0x434($s0)
/* 42594C 802A93BC 00021080 */ sll $v0, $v0, 2
/* 425950 802A93C0 00431021 */ addu $v0, $v0, $v1
/* 425954 802A93C4 8C440000 */ lw $a0, ($v0)
/* 425958 802A93C8 00850018 */ mult $a0, $a1
/* 42595C 802A93CC 000427C3 */ sra $a0, $a0, 0x1f
/* 425960 802A93D0 00003810 */ mfhi $a3
/* 425964 802A93D4 0C00A67F */ jal rand_int
/* 425968 802A93D8 00E42023 */ subu $a0, $a3, $a0
/* 42596C 802A93DC 96230044 */ lhu $v1, 0x44($s1)
/* 425970 802A93E0 00621821 */ addu $v1, $v1, $v0
/* 425974 802A93E4 A6230044 */ sh $v1, 0x44($s1)
.L802A93E8:
/* 425978 802A93E8 3C0351EB */ lui $v1, 0x51eb
.L802A93EC:
/* 42597C 802A93EC 96240044 */ lhu $a0, 0x44($s1)
/* 425980 802A93F0 3463851F */ ori $v1, $v1, 0x851f
/* 425984 802A93F4 00042400 */ sll $a0, $a0, 0x10
/* 425988 802A93F8 00041403 */ sra $v0, $a0, 0x10
/* 42598C 802A93FC 00430018 */ mult $v0, $v1
/* 425990 802A9400 82230080 */ lb $v1, 0x80($s1)
/* 425994 802A9404 000427C3 */ sra $a0, $a0, 0x1f
/* 425998 802A9408 00031840 */ sll $v1, $v1, 1
/* 42599C 802A940C 02231821 */ addu $v1, $s1, $v1
/* 4259A0 802A9410 00003810 */ mfhi $a3
/* 4259A4 802A9414 00071143 */ sra $v0, $a3, 5
/* 4259A8 802A9418 00441023 */ subu $v0, $v0, $a0
/* 4259AC 802A941C A2020084 */ sb $v0, 0x84($s0)
/* 4259B0 802A9420 00021600 */ sll $v0, $v0, 0x18
/* 4259B4 802A9424 84630074 */ lh $v1, 0x74($v1)
/* 4259B8 802A9428 00021603 */ sra $v0, $v0, 0x18
/* 4259BC 802A942C 0043102A */ slt $v0, $v0, $v1
/* 4259C0 802A9430 50400001 */ beql $v0, $zero, .L802A9438
/* 4259C4 802A9434 A6200054 */ sh $zero, 0x54($s1)
.L802A9438:
/* 4259C8 802A9438 86220054 */ lh $v0, 0x54($s1)
/* 4259CC 802A943C 96230054 */ lhu $v1, 0x54($s1)
/* 4259D0 802A9440 1440000C */ bnez $v0, .L802A9474
/* 4259D4 802A9444 2462FFFF */ addiu $v0, $v1, -1
/* 4259D8 802A9448 0C093EB1 */ jal set_popup_duration
/* 4259DC 802A944C 0000202D */ daddu $a0, $zero, $zero
/* 4259E0 802A9450 24020005 */ addiu $v0, $zero, 5
/* 4259E4 802A9454 A6220054 */ sh $v0, 0x54($s1)
/* 4259E8 802A9458 2402000C */ addiu $v0, $zero, 0xc
/* 4259EC 802A945C 080AA524 */ j .L802A9490
/* 4259F0 802A9460 A622004C */ sh $v0, 0x4c($s1)
/* 4259F4 802A9464 86220054 */ lh $v0, 0x54($s1)
/* 4259F8 802A9468 96230054 */ lhu $v1, 0x54($s1)
/* 4259FC 802A946C 10400003 */ beqz $v0, .L802A947C
/* 425A00 802A9470 2462FFFF */ addiu $v0, $v1, -1
.L802A9474:
/* 425A04 802A9474 080AA524 */ j .L802A9490
/* 425A08 802A9478 A6220054 */ sh $v0, 0x54($s1)
.L802A947C:
/* 425A0C 802A947C 24020001 */ addiu $v0, $zero, 1
/* 425A10 802A9480 A2020081 */ sb $v0, 0x81($s0)
/* 425A14 802A9484 2402007F */ addiu $v0, $zero, 0x7f
/* 425A18 802A9488 0C09A327 */ jal func_80268C9C
/* 425A1C 802A948C A2020086 */ sb $v0, 0x86($s0)
.L802A9490:
/* 425A20 802A9490 8FBF0018 */ lw $ra, 0x18($sp)
/* 425A24 802A9494 8FB10014 */ lw $s1, 0x14($sp)
/* 425A28 802A9498 8FB00010 */ lw $s0, 0x10($sp)
/* 425A2C 802A949C 03E00008 */ jr $ra
/* 425A30 802A94A0 27BD0020 */ addiu $sp, $sp, 0x20