papermario/asm/nonmatchings/code_3278F0/func_E0002300.s
Ethan Roseman a8e550dd9a yee
2020-10-17 22:27:25 -04:00

282 lines
15 KiB
ArmAsm

.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel func_E0002300
/* 327BF0 E0002300 27BDFF68 */ addiu $sp, $sp, -0x98
/* 327BF4 E0002304 3C08DB06 */ lui $t0, 0xdb06
/* 327BF8 E0002308 35080024 */ ori $t0, $t0, 0x24
/* 327BFC E000230C AFB50074 */ sw $s5, 0x74($sp)
/* 327C00 E0002310 3C15800A */ lui $s5, 0x800a
/* 327C04 E0002314 26B5A66C */ addiu $s5, $s5, -0x5994
/* 327C08 E0002318 3C02E700 */ lui $v0, 0xe700
/* 327C0C E000231C AFBF0084 */ sw $ra, 0x84($sp)
/* 327C10 E0002320 AFBE0080 */ sw $fp, 0x80($sp)
/* 327C14 E0002324 AFB7007C */ sw $s7, 0x7c($sp)
/* 327C18 E0002328 AFB60078 */ sw $s6, 0x78($sp)
/* 327C1C E000232C AFB40070 */ sw $s4, 0x70($sp)
/* 327C20 E0002330 AFB3006C */ sw $s3, 0x6c($sp)
/* 327C24 E0002334 AFB20068 */ sw $s2, 0x68($sp)
/* 327C28 E0002338 AFB10064 */ sw $s1, 0x64($sp)
/* 327C2C E000233C AFB00060 */ sw $s0, 0x60($sp)
/* 327C30 E0002340 F7B60090 */ sdc1 $f22, 0x90($sp)
/* 327C34 E0002344 F7B40088 */ sdc1 $f20, 0x88($sp)
/* 327C38 E0002348 AFA40098 */ sw $a0, 0x98($sp)
/* 327C3C E000234C 8EA60000 */ lw $a2, ($s5)
/* 327C40 E0002350 8FA90098 */ lw $t1, 0x98($sp)
/* 327C44 E0002354 4480A000 */ mtc1 $zero, $f20
/* 327C48 E0002358 3C013F80 */ lui $at, 0x3f80
/* 327C4C E000235C 44810000 */ mtc1 $at, $f0
/* 327C50 E0002360 00C0182D */ daddu $v1, $a2, $zero
/* 327C54 E0002364 8D34000C */ lw $s4, 0xc($t1)
/* 327C58 E0002368 24C60008 */ addiu $a2, $a2, 8
/* 327C5C E000236C AC620000 */ sw $v0, ($v1)
/* 327C60 E0002370 AC600004 */ sw $zero, 4($v1)
/* 327C64 E0002374 ACC80000 */ sw $t0, ($a2)
/* 327C68 E0002378 3C088000 */ lui $t0, 0x8000
/* 327C6C E000237C 4405A000 */ mfc1 $a1, $f20
/* 327C70 E0002380 8D220010 */ lw $v0, 0x10($t1)
/* 327C74 E0002384 4407A000 */ mfc1 $a3, $f20
/* 327C78 E0002388 8C42001C */ lw $v0, 0x1c($v0)
/* 327C7C E000238C 3C038007 */ lui $v1, %hi(gCurrentCameraID)
/* 327C80 E0002390 8C637410 */ lw $v1, %lo(gCurrentCameraID)($v1)
/* 327C84 E0002394 00481021 */ addu $v0, $v0, $t0
/* 327C88 E0002398 ACC20004 */ sw $v0, 4($a2)
/* 327C8C E000239C 00031080 */ sll $v0, $v1, 2
/* 327C90 E00023A0 00431021 */ addu $v0, $v0, $v1
/* 327C94 E00023A4 00021080 */ sll $v0, $v0, 2
/* 327C98 E00023A8 00431023 */ subu $v0, $v0, $v1
/* 327C9C E00023AC 000218C0 */ sll $v1, $v0, 3
/* 327CA0 E00023B0 00431021 */ addu $v0, $v0, $v1
/* 327CA4 E00023B4 000210C0 */ sll $v0, $v0, 3
/* 327CA8 E00023B8 3C01800B */ lui $at, 0x800b
/* 327CAC E00023BC 00220821 */ addu $at, $at, $v0
/* 327CB0 E00023C0 C4221DEC */ lwc1 $f2, 0x1dec($at)
/* 327CB4 E00023C4 E7A00010 */ swc1 $f0, 0x10($sp)
/* 327CB8 E00023C8 C680000C */ lwc1 $f0, 0xc($s4)
/* 327CBC E00023CC 27A40020 */ addiu $a0, $sp, 0x20
/* 327CC0 E00023D0 AEA60000 */ sw $a2, ($s5)
/* 327CC4 E00023D4 24C60008 */ addiu $a2, $a2, 8
/* 327CC8 E00023D8 E7A00014 */ swc1 $f0, 0x14($sp)
/* 327CCC E00023DC C6800010 */ lwc1 $f0, 0x10($s4)
/* 327CD0 E00023E0 46001087 */ neg.s $f2, $f2
/* 327CD4 E00023E4 AEA60000 */ sw $a2, ($s5)
/* 327CD8 E00023E8 44061000 */ mfc1 $a2, $f2
/* 327CDC E00023EC 3C100001 */ lui $s0, 1
/* 327CE0 E00023F0 E7A00018 */ swc1 $f0, 0x18($sp)
/* 327CE4 E00023F4 C6800014 */ lwc1 $f0, 0x14($s4)
/* 327CE8 E00023F8 36101630 */ ori $s0, $s0, 0x1630
/* 327CEC E00023FC 0C080180 */ jal func_E0200600
/* 327CF0 E0002400 E7A0001C */ swc1 $f0, 0x1c($sp)
/* 327CF4 E0002404 27A40020 */ addiu $a0, $sp, 0x20
/* 327CF8 E0002408 3C118007 */ lui $s1, 0x8007
/* 327CFC E000240C 263141F0 */ addiu $s1, $s1, 0x41f0
/* 327D00 E0002410 3C13800A */ lui $s3, 0x800a
/* 327D04 E0002414 2673A674 */ addiu $s3, $s3, -0x598c
/* 327D08 E0002418 96250000 */ lhu $a1, ($s1)
/* 327D0C E000241C 8E620000 */ lw $v0, ($s3)
/* 327D10 E0002420 00052980 */ sll $a1, $a1, 6
/* 327D14 E0002424 00B02821 */ addu $a1, $a1, $s0
/* 327D18 E0002428 0C080118 */ jal func_E0200460
/* 327D1C E000242C 00452821 */ addu $a1, $v0, $a1
/* 327D20 E0002430 8EA20000 */ lw $v0, ($s5)
/* 327D24 E0002434 0040282D */ daddu $a1, $v0, $zero
/* 327D28 E0002438 24420008 */ addiu $v0, $v0, 8
/* 327D2C E000243C AEA20000 */ sw $v0, ($s5)
/* 327D30 E0002440 96240000 */ lhu $a0, ($s1)
/* 327D34 E0002444 3C02DA38 */ lui $v0, 0xda38
/* 327D38 E0002448 ACA20000 */ sw $v0, ($a1)
/* 327D3C E000244C 8E630000 */ lw $v1, ($s3)
/* 327D40 E0002450 3082FFFF */ andi $v0, $a0, 0xffff
/* 327D44 E0002454 00021180 */ sll $v0, $v0, 6
/* 327D48 E0002458 00501021 */ addu $v0, $v0, $s0
/* 327D4C E000245C 00621821 */ addu $v1, $v1, $v0
/* 327D50 E0002460 ACA30004 */ sw $v1, 4($a1)
/* 327D54 E0002464 8FA90098 */ lw $t1, 0x98($sp)
/* 327D58 E0002468 0000902D */ daddu $s2, $zero, $zero
/* 327D5C E000246C 8D220008 */ lw $v0, 8($t1)
/* 327D60 E0002470 24840001 */ addiu $a0, $a0, 1
/* 327D64 E0002474 18400092 */ blez $v0, .LE00026C0
/* 327D68 E0002478 A6240000 */ sh $a0, ($s1)
/* 327D6C E000247C 4600A586 */ mov.s $f22, $f20
/* 327D70 E0002480 0260F02D */ daddu $fp, $s3, $zero
/* 327D74 E0002484 0220B82D */ daddu $s7, $s1, $zero
/* 327D78 E0002488 3C160001 */ lui $s6, 1
/* 327D7C E000248C 36D61630 */ ori $s6, $s6, 0x1630
/* 327D80 E0002490 02A0982D */ daddu $s3, $s5, $zero
/* 327D84 E0002494 3C15E000 */ lui $s5, 0xe000
/* 327D88 E0002498 26B52800 */ addiu $s5, $s5, 0x2800
/* 327D8C E000249C 3C0140E0 */ lui $at, 0x40e0
/* 327D90 E00024A0 4481A000 */ mtc1 $at, $f20
/* 327D94 E00024A4 26900004 */ addiu $s0, $s4, 4
.LE00024A8:
/* 327D98 E00024A8 8603FFFE */ lh $v1, -2($s0)
/* 327D9C E00024AC 0462007E */ bltzl $v1, .LE00026A8
/* 327DA0 E00024B0 26520001 */ addiu $s2, $s2, 1
/* 327DA4 E00024B4 8E020004 */ lw $v0, 4($s0)
/* 327DA8 E00024B8 0443007B */ bgezl $v0, .LE00026A8
/* 327DAC E00024BC 26520001 */ addiu $s2, $s2, 1
/* 327DB0 E00024C0 0060882D */ daddu $s1, $v1, $zero
/* 327DB4 E00024C4 2A220011 */ slti $v0, $s1, 0x11
/* 327DB8 E00024C8 50400001 */ beql $v0, $zero, .LE00024D0
/* 327DBC E00024CC 24110010 */ addiu $s1, $zero, 0x10
.LE00024D0:
/* 327DC0 E00024D0 00121080 */ sll $v0, $s2, 2
/* 327DC4 E00024D4 3C01E000 */ lui $at, 0xe000
/* 327DC8 E00024D8 00220821 */ addu $at, $at, $v0
/* 327DCC E00024DC C42027B0 */ lwc1 $f0, 0x27b0($at)
/* 327DD0 E00024E0 4405B000 */ mfc1 $a1, $f22
/* 327DD4 E00024E4 4406B000 */ mfc1 $a2, $f22
/* 327DD8 E00024E8 E7A00010 */ swc1 $f0, 0x10($sp)
/* 327DDC E00024EC C6000014 */ lwc1 $f0, 0x14($s0)
/* 327DE0 E00024F0 E7A00014 */ swc1 $f0, 0x14($sp)
/* 327DE4 E00024F4 C6000018 */ lwc1 $f0, 0x18($s0)
/* 327DE8 E00024F8 E7B6001C */ swc1 $f22, 0x1c($sp)
/* 327DEC E00024FC E7A00018 */ swc1 $f0, 0x18($sp)
/* 327DF0 E0002500 3C07E000 */ lui $a3, 0xe000
/* 327DF4 E0002504 00E23821 */ addu $a3, $a3, $v0
/* 327DF8 E0002508 8CE727D8 */ lw $a3, 0x27d8($a3)
/* 327DFC E000250C 0C080180 */ jal func_E0200600
/* 327E00 E0002510 27A40020 */ addiu $a0, $sp, 0x20
/* 327E04 E0002514 27A40020 */ addiu $a0, $sp, 0x20
/* 327E08 E0002518 96E50000 */ lhu $a1, ($s7)
/* 327E0C E000251C 8FC20000 */ lw $v0, ($fp)
/* 327E10 E0002520 00052980 */ sll $a1, $a1, 6
/* 327E14 E0002524 00B62821 */ addu $a1, $a1, $s6
/* 327E18 E0002528 0C080118 */ jal func_E0200460
/* 327E1C E000252C 00452821 */ addu $a1, $v0, $a1
/* 327E20 E0002530 8E620000 */ lw $v0, ($s3)
/* 327E24 E0002534 0040282D */ daddu $a1, $v0, $zero
/* 327E28 E0002538 24420008 */ addiu $v0, $v0, 8
/* 327E2C E000253C AE620000 */ sw $v0, ($s3)
/* 327E30 E0002540 96E40000 */ lhu $a0, ($s7)
/* 327E34 E0002544 3C02DA38 */ lui $v0, 0xda38
/* 327E38 E0002548 ACA20000 */ sw $v0, ($a1)
/* 327E3C E000254C 8FC30000 */ lw $v1, ($fp)
/* 327E40 E0002550 3082FFFF */ andi $v0, $a0, 0xffff
/* 327E44 E0002554 00021180 */ sll $v0, $v0, 6
/* 327E48 E0002558 00561021 */ addu $v0, $v0, $s6
/* 327E4C E000255C 00621821 */ addu $v1, $v1, $v0
/* 327E50 E0002560 ACA30004 */ sw $v1, 4($a1)
/* 327E54 E0002564 86820000 */ lh $v0, ($s4)
/* 327E58 E0002568 24840001 */ addiu $a0, $a0, 1
/* 327E5C E000256C A6E40000 */ sh $a0, ($s7)
/* 327E60 E0002570 86030000 */ lh $v1, ($s0)
/* 327E64 E0002574 2442FFFF */ addiu $v0, $v0, -1
/* 327E68 E0002578 44826000 */ mtc1 $v0, $f12
/* 327E6C E000257C 00000000 */ nop
/* 327E70 E0002580 46806320 */ cvt.s.w $f12, $f12
/* 327E74 E0002584 44831000 */ mtc1 $v1, $f2
/* 327E78 E0002588 00000000 */ nop
/* 327E7C E000258C 468010A0 */ cvt.s.w $f2, $f2
/* 327E80 E0002590 460C103E */ c.le.s $f2, $f12
/* 327E84 E0002594 00000000 */ nop
/* 327E88 E0002598 45000004 */ bc1f .LE00025AC
/* 327E8C E000259C 240700FF */ addiu $a3, $zero, 0xff
/* 327E90 E00025A0 8EA80018 */ lw $t0, 0x18($s5)
/* 327E94 E00025A4 0800098B */ j .LE000262C
/* 327E98 E00025A8 3C06D838 */ lui $a2, 0xd838
.LE00025AC:
/* 327E9C E00025AC 46146302 */ mul.s $f12, $f12, $f20
/* 327EA0 E00025B0 00000000 */ nop
/* 327EA4 E00025B4 3C0142B4 */ lui $at, 0x42b4
/* 327EA8 E00025B8 44810000 */ mtc1 $at, $f0
/* 327EAC E00025BC 46026303 */ div.s $f12, $f12, $f2
/* 327EB0 E00025C0 46006302 */ mul.s $f12, $f12, $f0
/* 327EB4 E00025C4 00000000 */ nop
/* 327EB8 E00025C8 0C080140 */ jal func_E0200500
/* 327EBC E00025CC 46146303 */ div.s $f12, $f12, $f20
/* 327EC0 E00025D0 46140082 */ mul.s $f2, $f0, $f20
/* 327EC4 E00025D4 00000000 */ nop
/* 327EC8 E00025D8 3C01437F */ lui $at, 0x437f
/* 327ECC E00025DC 44810000 */ mtc1 $at, $f0
/* 327ED0 E00025E0 00000000 */ nop
/* 327ED4 E00025E4 46001002 */ mul.s $f0, $f2, $f0
/* 327ED8 E00025E8 00000000 */ nop
/* 327EDC E00025EC 4600010D */ trunc.w.s $f4, $f0
/* 327EE0 E00025F0 44032000 */ mfc1 $v1, $f4
/* 327EE4 E00025F4 00000000 */ nop
/* 327EE8 E00025F8 04610002 */ bgez $v1, .LE0002604
/* 327EEC E00025FC 0060102D */ daddu $v0, $v1, $zero
/* 327EF0 E0002600 246200FF */ addiu $v0, $v1, 0xff
.LE0002604:
/* 327EF4 E0002604 00023A03 */ sra $a3, $v0, 8
/* 327EF8 E0002608 00071200 */ sll $v0, $a3, 8
/* 327EFC E000260C 00623823 */ subu $a3, $v1, $v0
/* 327F00 E0002610 4600110D */ trunc.w.s $f4, $f2
/* 327F04 E0002614 44022000 */ mfc1 $v0, $f4
/* 327F08 E0002618 00000000 */ nop
/* 327F0C E000261C 00021080 */ sll $v0, $v0, 2
/* 327F10 E0002620 00551021 */ addu $v0, $v0, $s5
/* 327F14 E0002624 8C480000 */ lw $t0, ($v0)
/* 327F18 E0002628 3C06D838 */ lui $a2, 0xd838
.LE000262C:
/* 327F1C E000262C 34C60002 */ ori $a2, $a2, 2
/* 327F20 E0002630 3C02FA00 */ lui $v0, 0xfa00
/* 327F24 E0002634 001118C0 */ sll $v1, $s1, 3
/* 327F28 E0002638 8E640000 */ lw $a0, ($s3)
/* 327F2C E000263C 00711823 */ subu $v1, $v1, $s1
/* 327F30 E0002640 0080282D */ daddu $a1, $a0, $zero
/* 327F34 E0002644 24840008 */ addiu $a0, $a0, 8
/* 327F38 E0002648 AE640000 */ sw $a0, ($s3)
/* 327F3C E000264C ACA20000 */ sw $v0, ($a1)
/* 327F40 E0002650 00031100 */ sll $v0, $v1, 4
/* 327F44 E0002654 00431023 */ subu $v0, $v0, $v1
/* 327F48 E0002658 000210C2 */ srl $v0, $v0, 3
/* 327F4C E000265C 304200FF */ andi $v0, $v0, 0xff
/* 327F50 E0002660 ACA20004 */ sw $v0, 4($a1)
/* 327F54 E0002664 24820008 */ addiu $v0, $a0, 8
/* 327F58 E0002668 AE620000 */ sw $v0, ($s3)
/* 327F5C E000266C 3C02FB00 */ lui $v0, 0xfb00
/* 327F60 E0002670 AC820000 */ sw $v0, ($a0)
/* 327F64 E0002674 30E200FF */ andi $v0, $a3, 0xff
/* 327F68 E0002678 AC820004 */ sw $v0, 4($a0)
/* 327F6C E000267C 24820010 */ addiu $v0, $a0, 0x10
/* 327F70 E0002680 AE620000 */ sw $v0, ($s3)
/* 327F74 E0002684 3C02DE00 */ lui $v0, 0xde00
/* 327F78 E0002688 AC820008 */ sw $v0, 8($a0)
/* 327F7C E000268C 24820018 */ addiu $v0, $a0, 0x18
/* 327F80 E0002690 AC88000C */ sw $t0, 0xc($a0)
/* 327F84 E0002694 AE620000 */ sw $v0, ($s3)
/* 327F88 E0002698 24020040 */ addiu $v0, $zero, 0x40
/* 327F8C E000269C AC860010 */ sw $a2, 0x10($a0)
/* 327F90 E00026A0 AC820014 */ sw $v0, 0x14($a0)
/* 327F94 E00026A4 26520001 */ addiu $s2, $s2, 1
.LE00026A8:
/* 327F98 E00026A8 8FA90098 */ lw $t1, 0x98($sp)
/* 327F9C E00026AC 2610002C */ addiu $s0, $s0, 0x2c
/* 327FA0 E00026B0 8D220008 */ lw $v0, 8($t1)
/* 327FA4 E00026B4 0242102A */ slt $v0, $s2, $v0
/* 327FA8 E00026B8 1440FF7B */ bnez $v0, .LE00024A8
/* 327FAC E00026BC 2694002C */ addiu $s4, $s4, 0x2c
.LE00026C0:
/* 327FB0 E00026C0 3C03D838 */ lui $v1, 0xd838
/* 327FB4 E00026C4 3C04800A */ lui $a0, 0x800a
/* 327FB8 E00026C8 2484A66C */ addiu $a0, $a0, -0x5994
/* 327FBC E00026CC 8C820000 */ lw $v0, ($a0)
/* 327FC0 E00026D0 34630002 */ ori $v1, $v1, 2
/* 327FC4 E00026D4 0040282D */ daddu $a1, $v0, $zero
/* 327FC8 E00026D8 24420008 */ addiu $v0, $v0, 8
/* 327FCC E00026DC AC820000 */ sw $v0, ($a0)
/* 327FD0 E00026E0 ACA30000 */ sw $v1, ($a1)
/* 327FD4 E00026E4 24030040 */ addiu $v1, $zero, 0x40
/* 327FD8 E00026E8 ACA30004 */ sw $v1, 4($a1)
/* 327FDC E00026EC 24430008 */ addiu $v1, $v0, 8
/* 327FE0 E00026F0 AC830000 */ sw $v1, ($a0)
/* 327FE4 E00026F4 3C03E700 */ lui $v1, 0xe700
/* 327FE8 E00026F8 AC430000 */ sw $v1, ($v0)
/* 327FEC E00026FC AC400004 */ sw $zero, 4($v0)
/* 327FF0 E0002700 8FBF0084 */ lw $ra, 0x84($sp)
/* 327FF4 E0002704 8FBE0080 */ lw $fp, 0x80($sp)
/* 327FF8 E0002708 8FB7007C */ lw $s7, 0x7c($sp)
/* 327FFC E000270C 8FB60078 */ lw $s6, 0x78($sp)
/* 328000 E0002710 8FB50074 */ lw $s5, 0x74($sp)
/* 328004 E0002714 8FB40070 */ lw $s4, 0x70($sp)
/* 328008 E0002718 8FB3006C */ lw $s3, 0x6c($sp)
/* 32800C E000271C 8FB20068 */ lw $s2, 0x68($sp)
/* 328010 E0002720 8FB10064 */ lw $s1, 0x64($sp)
/* 328014 E0002724 8FB00060 */ lw $s0, 0x60($sp)
/* 328018 E0002728 D7B60090 */ ldc1 $f22, 0x90($sp)
/* 32801C E000272C D7B40088 */ ldc1 $f20, 0x88($sp)
/* 328020 E0002730 03E00008 */ jr $ra
/* 328024 E0002734 27BD0098 */ addiu $sp, $sp, 0x98