1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 05:19:36 +00:00
oot/asm/sys_math.s
2020-03-17 00:31:30 -04:00

193 lines
8.5 KiB
ArmAsm

.include "macro.inc"
# assembler directives
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
.set gp=64 # allow use of 64-bit general purposee registers
.section .text
.align 4
glabel func_800CA540
/* B416E0 800CA540 4600610D */ trunc.w.s $f4, $f12
/* B416E4 800CA544 3C013F80 */ li $at, 0x3F800000 # 0.000000
/* B416E8 800CA548 44811000 */ mtc1 $at, $f2
/* B416EC 800CA54C 44032000 */ mfc1 $v1, $f4
/* B416F0 800CA550 00000000 */ nop
/* B416F4 800CA554 28610002 */ slti $at, $v1, 2
/* B416F8 800CA558 14200036 */ bnez $at, .L800CA634
/* B416FC 800CA55C 00601025 */ move $v0, $v1
/* B41700 800CA560 2465FFFF */ addiu $a1, $v1, -1
/* B41704 800CA564 30A50003 */ andi $a1, $a1, 3
/* B41708 800CA568 00052823 */ negu $a1, $a1
/* B4170C 800CA56C 10A00009 */ beqz $a1, .L800CA594
/* B41710 800CA570 00A32021 */ addu $a0, $a1, $v1
/* B41714 800CA574 44823000 */ mtc1 $v0, $f6
.L800CA578:
/* B41718 800CA578 2442FFFF */ addiu $v0, $v0, -1
/* B4171C 800CA57C 46803220 */ cvt.s.w $f8, $f6
/* B41720 800CA580 46081082 */ mul.s $f2, $f2, $f8
/* B41724 800CA584 5482FFFC */ bnel $a0, $v0, .L800CA578
/* B41728 800CA588 44823000 */ mtc1 $v0, $f6
/* B4172C 800CA58C 24030001 */ li $v1, 1
/* B41730 800CA590 10430028 */ beq $v0, $v1, .L800CA634
.L800CA594:
/* B41734 800CA594 24030001 */ li $v1, 1
/* B41738 800CA598 44825000 */ mtc1 $v0, $f10
/* B4173C 800CA59C 24630004 */ addiu $v1, $v1, 4
/* B41740 800CA5A0 10430013 */ beq $v0, $v1, .L800CA5F0
/* B41744 800CA5A4 468054A0 */ cvt.s.w $f18, $f10
.L800CA5A8:
/* B41748 800CA5A8 46121082 */ mul.s $f2, $f2, $f18
/* B4174C 800CA5AC 244FFFFF */ addiu $t7, $v0, -1
/* B41750 800CA5B0 448F8000 */ mtc1 $t7, $f16
/* B41754 800CA5B4 2458FFFE */ addiu $t8, $v0, -2
/* B41758 800CA5B8 44987000 */ mtc1 $t8, $f14
/* B4175C 800CA5BC 2459FFFD */ addiu $t9, $v0, -3
/* B41760 800CA5C0 46808420 */ cvt.s.w $f16, $f16
/* B41764 800CA5C4 44996000 */ mtc1 $t9, $f12
/* B41768 800CA5C8 2442FFFC */ addiu $v0, $v0, -4
/* B4176C 800CA5CC 44825000 */ mtc1 $v0, $f10
/* B41770 800CA5D0 468073A0 */ cvt.s.w $f14, $f14
/* B41774 800CA5D4 46101082 */ mul.s $f2, $f2, $f16
/* B41778 800CA5D8 46806320 */ cvt.s.w $f12, $f12
/* B4177C 800CA5DC 460E1082 */ mul.s $f2, $f2, $f14
/* B41780 800CA5E0 468054A0 */ cvt.s.w $f18, $f10
/* B41784 800CA5E4 460C1082 */ mul.s $f2, $f2, $f12
/* B41788 800CA5E8 1443FFEF */ bne $v0, $v1, .L800CA5A8
/* B4178C 800CA5EC 00000000 */ nop
.L800CA5F0:
/* B41790 800CA5F0 244FFFFF */ addiu $t7, $v0, -1
/* B41794 800CA5F4 448F8000 */ mtc1 $t7, $f16
/* B41798 800CA5F8 46121082 */ mul.s $f2, $f2, $f18
/* B4179C 800CA5FC 2458FFFE */ addiu $t8, $v0, -2
/* B417A0 800CA600 44987000 */ mtc1 $t8, $f14
/* B417A4 800CA604 2459FFFD */ addiu $t9, $v0, -3
/* B417A8 800CA608 44996000 */ mtc1 $t9, $f12
/* B417AC 800CA60C 2463FFFC */ addiu $v1, $v1, -4
/* B417B0 800CA610 46808420 */ cvt.s.w $f16, $f16
/* B417B4 800CA614 2442FFFC */ addiu $v0, $v0, -4
/* B417B8 800CA618 468073A0 */ cvt.s.w $f14, $f14
/* B417BC 800CA61C 46101082 */ mul.s $f2, $f2, $f16
/* B417C0 800CA620 46806320 */ cvt.s.w $f12, $f12
/* B417C4 800CA624 460E1082 */ mul.s $f2, $f2, $f14
/* B417C8 800CA628 00000000 */ nop
/* B417CC 800CA62C 460C1082 */ mul.s $f2, $f2, $f12
/* B417D0 800CA630 00000000 */ nop
.L800CA634:
/* B417D4 800CA634 03E00008 */ jr $ra
/* B417D8 800CA638 46001006 */ mov.s $f0, $f2
glabel func_800CA63C
/* B417DC 800CA63C 2C81000D */ sltiu $at, $a0, 0xd
/* B417E0 800CA640 14200029 */ bnez $at, .L800CA6E8
/* B417E4 800CA644 00044880 */ sll $t1, $a0, 2
/* B417E8 800CA648 3C018013 */ lui $at, %hi(D_8012D300)
/* B417EC 800CA64C C422D300 */ lwc1 $f2, %lo(D_8012D300)($at)
/* B417F0 800CA650 2881000D */ slti $at, $a0, 0xd
/* B417F4 800CA654 14200027 */ bnez $at, .L800CA6F4
/* B417F8 800CA658 2402000D */ li $v0, 13
/* B417FC 800CA65C 2485FFF4 */ addiu $a1, $a0, -0xc
/* B41800 800CA660 30A50003 */ andi $a1, $a1, 3
/* B41804 800CA664 10A0000A */ beqz $a1, .L800CA690
/* B41808 800CA668 24A3000D */ addiu $v1, $a1, 0xd
/* B4180C 800CA66C 44822000 */ mtc1 $v0, $f4
.L800CA670:
/* B41810 800CA670 24420001 */ addiu $v0, $v0, 1
/* B41814 800CA674 468021A0 */ cvt.s.w $f6, $f4
/* B41818 800CA678 46061082 */ mul.s $f2, $f2, $f6
/* B4181C 800CA67C 5462FFFC */ bnel $v1, $v0, .L800CA670
/* B41820 800CA680 44822000 */ mtc1 $v0, $f4
/* B41824 800CA684 248E0001 */ addiu $t6, $a0, 1
/* B41828 800CA688 11C2001A */ beq $t6, $v0, .L800CA6F4
/* B4182C 800CA68C 00000000 */ nop
.L800CA690:
/* B41830 800CA690 44824000 */ mtc1 $v0, $f8
/* B41834 800CA694 244F0001 */ addiu $t7, $v0, 1
/* B41838 800CA698 448F8000 */ mtc1 $t7, $f16
/* B4183C 800CA69C 468042A0 */ cvt.s.w $f10, $f8
/* B41840 800CA6A0 24580002 */ addiu $t8, $v0, 2
/* B41844 800CA6A4 44982000 */ mtc1 $t8, $f4
/* B41848 800CA6A8 24590003 */ addiu $t9, $v0, 3
/* B4184C 800CA6AC 44994000 */ mtc1 $t9, $f8
/* B41850 800CA6B0 468084A0 */ cvt.s.w $f18, $f16
/* B41854 800CA6B4 460A1082 */ mul.s $f2, $f2, $f10
/* B41858 800CA6B8 24420004 */ addiu $v0, $v0, 4
/* B4185C 800CA6BC 24880001 */ addiu $t0, $a0, 1
/* B41860 800CA6C0 468021A0 */ cvt.s.w $f6, $f4
/* B41864 800CA6C4 46121082 */ mul.s $f2, $f2, $f18
/* B41868 800CA6C8 468042A0 */ cvt.s.w $f10, $f8
/* B4186C 800CA6CC 46061082 */ mul.s $f2, $f2, $f6
/* B41870 800CA6D0 00000000 */ nop
/* B41874 800CA6D4 460A1082 */ mul.s $f2, $f2, $f10
/* B41878 800CA6D8 1502FFED */ bne $t0, $v0, .L800CA690
/* B4187C 800CA6DC 00000000 */ nop
/* B41880 800CA6E0 03E00008 */ jr $ra
/* B41884 800CA6E4 46001006 */ mov.s $f0, $f2
.L800CA6E8:
/* B41888 800CA6E8 3C018013 */ lui $at, %hi(D_8012D2D0)
/* B4188C 800CA6EC 00290821 */ addu $at, $at, $t1
/* B41890 800CA6F0 C422D2D0 */ lwc1 $f2, %lo(D_8012D2D0)($at)
.L800CA6F4:
/* B41894 800CA6F4 03E00008 */ jr $ra
/* B41898 800CA6F8 46001006 */ mov.s $f0, $f2
glabel func_800CA6FC
/* B4189C 800CA6FC 3C013F80 */ li $at, 0x3F800000 # 0.000000
/* B418A0 800CA700 44811000 */ mtc1 $at, $f2
/* B418A4 800CA704 18A00004 */ blez $a1, .L800CA718
/* B418A8 800CA708 24A5FFFF */ addiu $a1, $a1, -1
.L800CA70C:
/* B418AC 800CA70C 460C1082 */ mul.s $f2, $f2, $f12
/* B418B0 800CA710 5CA0FFFE */ bgtzl $a1, .L800CA70C
/* B418B4 800CA714 24A5FFFF */ addiu $a1, $a1, -1
.L800CA718:
/* B418B8 800CA718 03E00008 */ jr $ra
/* B418BC 800CA71C 46001006 */ mov.s $f0, $f2
glabel func_800CA720
/* B418C0 800CA720 3C018014 */ lui $at, %hi(D_801463C0)
/* B418C4 800CA724 C42463C0 */ lwc1 $f4, %lo(D_801463C0)($at)
/* B418C8 800CA728 27BDFFE8 */ addiu $sp, $sp, -0x18
/* B418CC 800CA72C AFBF0014 */ sw $ra, 0x14($sp)
/* B418D0 800CA730 46046182 */ mul.s $f6, $f12, $f4
/* B418D4 800CA734 4600320D */ trunc.w.s $f8, $f6
/* B418D8 800CA738 44044000 */ mfc1 $a0, $f8
/* B418DC 800CA73C 00000000 */ nop
/* B418E0 800CA740 00042400 */ sll $a0, $a0, 0x10
/* B418E4 800CA744 00042403 */ sra $a0, $a0, 0x10
/* B418E8 800CA748 0C040114 */ jal sins
/* B418EC 800CA74C 3084FFFF */ andi $a0, $a0, 0xffff
/* B418F0 800CA750 44825000 */ mtc1 $v0, $f10
/* B418F4 800CA754 3C018014 */ lui $at, %hi(D_801463C4)
/* B418F8 800CA758 C43263C4 */ lwc1 $f18, %lo(D_801463C4)($at)
/* B418FC 800CA75C 46805420 */ cvt.s.w $f16, $f10
/* B41900 800CA760 8FBF0014 */ lw $ra, 0x14($sp)
/* B41904 800CA764 27BD0018 */ addiu $sp, $sp, 0x18
/* B41908 800CA768 46128002 */ mul.s $f0, $f16, $f18
/* B4190C 800CA76C 03E00008 */ jr $ra
/* B41910 800CA770 00000000 */ nop
glabel func_800CA774
/* B41914 800CA774 3C018014 */ lui $at, %hi(D_801463C8)
/* B41918 800CA778 C42463C8 */ lwc1 $f4, %lo(D_801463C8)($at)
/* B4191C 800CA77C 27BDFFE8 */ addiu $sp, $sp, -0x18
/* B41920 800CA780 AFBF0014 */ sw $ra, 0x14($sp)
/* B41924 800CA784 46046182 */ mul.s $f6, $f12, $f4
/* B41928 800CA788 4600320D */ trunc.w.s $f8, $f6
/* B4192C 800CA78C 44044000 */ mfc1 $a0, $f8
/* B41930 800CA790 00000000 */ nop
/* B41934 800CA794 00042400 */ sll $a0, $a0, 0x10
/* B41938 800CA798 00042403 */ sra $a0, $a0, 0x10
/* B4193C 800CA79C 0C0411E0 */ jal coss
/* B41940 800CA7A0 3084FFFF */ andi $a0, $a0, 0xffff
/* B41944 800CA7A4 44825000 */ mtc1 $v0, $f10
/* B41948 800CA7A8 3C018014 */ lui $at, %hi(D_801463CC)
/* B4194C 800CA7AC C43263CC */ lwc1 $f18, %lo(D_801463CC)($at)
/* B41950 800CA7B0 46805420 */ cvt.s.w $f16, $f10
/* B41954 800CA7B4 8FBF0014 */ lw $ra, 0x14($sp)
/* B41958 800CA7B8 27BD0018 */ addiu $sp, $sp, 0x18
/* B4195C 800CA7BC 46128002 */ mul.s $f0, $f16, $f18
/* B41960 800CA7C0 03E00008 */ jr $ra
/* B41964 800CA7C4 00000000 */ nop