mirror of
https://github.com/zeldaret/oot.git
synced 2024-12-27 15:16:13 +00:00
164 lines
6.6 KiB
ArmAsm
164 lines
6.6 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 __d_to_ll
|
|
/* B7D6F0 80106550 46206109 */ trunc.l.d $f4, $f12
|
|
/* B7D6F4 80106554 44222000 */ dmfc1 $v0, $f4
|
|
/* B7D6F8 80106558 00000000 */ nop
|
|
/* B7D6FC 8010655C 0002183C */ dsll32 $v1, $v0, 0
|
|
/* B7D700 80106560 0003183F */ dsra32 $v1, $v1, 0
|
|
/* B7D704 80106564 03E00008 */ jr $ra
|
|
/* B7D708 80106568 0002103F */ dsra32 $v0, $v0, 0
|
|
|
|
glabel __f_to_ll
|
|
/* B7D70C 8010656C 46006109 */ trunc.l.s $f4, $f12
|
|
/* B7D710 80106570 44222000 */ dmfc1 $v0, $f4
|
|
/* B7D714 80106574 00000000 */ nop
|
|
/* B7D718 80106578 0002183C */ dsll32 $v1, $v0, 0
|
|
/* B7D71C 8010657C 0003183F */ dsra32 $v1, $v1, 0
|
|
/* B7D720 80106580 03E00008 */ jr $ra
|
|
/* B7D724 80106584 0002103F */ dsra32 $v0, $v0, 0
|
|
|
|
glabel __d_to_ull
|
|
/* B7D728 80106588 444EF800 */ cfc1 $t6, $31
|
|
/* B7D72C 8010658C 24020001 */ li $v0, 1
|
|
/* B7D730 80106590 44C2F800 */ ctc1 $v0, $31
|
|
/* B7D734 80106594 00000000 */ nop
|
|
/* B7D738 80106598 46206125 */ cvt.l.d $f4, $f12
|
|
/* B7D73C 8010659C 4442F800 */ cfc1 $v0, $31
|
|
/* B7D740 801065A0 00000000 */ nop
|
|
/* B7D744 801065A4 30410004 */ andi $at, $v0, 4
|
|
/* B7D748 801065A8 30420078 */ andi $v0, $v0, 0x78
|
|
/* B7D74C 801065AC 10400015 */ beqz $v0, .L80106604
|
|
/* B7D750 801065B0 3C0143E0 */ li $at, 0x43E00000 # 0.000000
|
|
/* B7D754 801065B4 44812800 */ mtc1 $at, $f5
|
|
/* B7D758 801065B8 44802000 */ mtc1 $zero, $f4
|
|
/* B7D75C 801065BC 24020001 */ li $v0, 1
|
|
/* B7D760 801065C0 46246101 */ sub.d $f4, $f12, $f4
|
|
/* B7D764 801065C4 44C2F800 */ ctc1 $v0, $31
|
|
/* B7D768 801065C8 00000000 */ nop
|
|
/* B7D76C 801065CC 46202125 */ cvt.l.d $f4, $f4
|
|
/* B7D770 801065D0 4442F800 */ cfc1 $v0, $31
|
|
/* B7D774 801065D4 00000000 */ nop
|
|
/* B7D778 801065D8 30410004 */ andi $at, $v0, 4
|
|
/* B7D77C 801065DC 30420078 */ andi $v0, $v0, 0x78
|
|
/* B7D780 801065E0 14400006 */ bnez $v0, .L801065FC
|
|
/* B7D784 801065E4 00000000 */ nop
|
|
/* B7D788 801065E8 3C0F8015 */ lui $t7, %hi(D_8014B2E0) # $t7, 0x8015
|
|
/* B7D78C 801065EC DDEFB2E0 */ ld $t7, %lo(D_8014B2E0)($t7)
|
|
/* B7D790 801065F0 44222000 */ dmfc1 $v0, $f4
|
|
/* B7D794 801065F4 10000007 */ b .L80106614
|
|
/* B7D798 801065F8 004F1025 */ or $v0, $v0, $t7
|
|
.L801065FC:
|
|
/* B7D79C 801065FC 10000005 */ b .L80106614
|
|
/* B7D7A0 80106600 2402FFFF */ li $v0, -1
|
|
.L80106604:
|
|
/* B7D7A4 80106604 44222000 */ dmfc1 $v0, $f4
|
|
/* B7D7A8 80106608 00000000 */ nop
|
|
/* B7D7AC 8010660C 0440FFFB */ bltz $v0, .L801065FC
|
|
/* B7D7B0 80106610 00000000 */ nop
|
|
.L80106614:
|
|
/* B7D7B4 80106614 44CEF800 */ ctc1 $t6, $31
|
|
/* B7D7B8 80106618 0002183C */ dsll32 $v1, $v0, 0
|
|
/* B7D7BC 8010661C 0003183F */ dsra32 $v1, $v1, 0
|
|
/* B7D7C0 80106620 03E00008 */ jr $ra
|
|
/* B7D7C4 80106624 0002103F */ dsra32 $v0, $v0, 0
|
|
|
|
glabel __f_to_ull
|
|
/* B7D7C8 80106628 444EF800 */ cfc1 $t6, $31
|
|
/* B7D7CC 8010662C 24020001 */ li $v0, 1
|
|
/* B7D7D0 80106630 44C2F800 */ ctc1 $v0, $31
|
|
/* B7D7D4 80106634 00000000 */ nop
|
|
/* B7D7D8 80106638 46006125 */ cvt.l.s $f4, $f12
|
|
/* B7D7DC 8010663C 4442F800 */ cfc1 $v0, $31
|
|
/* B7D7E0 80106640 00000000 */ nop
|
|
/* B7D7E4 80106644 30410004 */ andi $at, $v0, 4
|
|
/* B7D7E8 80106648 30420078 */ andi $v0, $v0, 0x78
|
|
/* B7D7EC 8010664C 10400014 */ beqz $v0, .L801066A0
|
|
/* B7D7F0 80106650 3C015F00 */ li $at, 0x5F000000 # 0.000000
|
|
/* B7D7F4 80106654 44812000 */ mtc1 $at, $f4
|
|
/* B7D7F8 80106658 24020001 */ li $v0, 1
|
|
/* B7D7FC 8010665C 46046101 */ sub.s $f4, $f12, $f4
|
|
/* B7D800 80106660 44C2F800 */ ctc1 $v0, $31
|
|
/* B7D804 80106664 00000000 */ nop
|
|
/* B7D808 80106668 46002125 */ cvt.l.s $f4, $f4
|
|
/* B7D80C 8010666C 4442F800 */ cfc1 $v0, $31
|
|
/* B7D810 80106670 00000000 */ nop
|
|
/* B7D814 80106674 30410004 */ andi $at, $v0, 4
|
|
/* B7D818 80106678 30420078 */ andi $v0, $v0, 0x78
|
|
/* B7D81C 8010667C 14400006 */ bnez $v0, .L80106698
|
|
/* B7D820 80106680 00000000 */ nop
|
|
/* B7D824 80106684 3C0F8015 */ lui $t7, %hi(D_8014B2E8) # $t7, 0x8015
|
|
/* B7D828 80106688 DDEFB2E8 */ ld $t7, %lo(D_8014B2E8)($t7)
|
|
/* B7D82C 8010668C 44222000 */ dmfc1 $v0, $f4
|
|
/* B7D830 80106690 10000007 */ b .L801066B0
|
|
/* B7D834 80106694 004F1025 */ or $v0, $v0, $t7
|
|
.L80106698:
|
|
/* B7D838 80106698 10000005 */ b .L801066B0
|
|
/* B7D83C 8010669C 2402FFFF */ li $v0, -1
|
|
.L801066A0:
|
|
/* B7D840 801066A0 44222000 */ dmfc1 $v0, $f4
|
|
/* B7D844 801066A4 00000000 */ nop
|
|
/* B7D848 801066A8 0440FFFB */ bltz $v0, .L80106698
|
|
/* B7D84C 801066AC 00000000 */ nop
|
|
.L801066B0:
|
|
/* B7D850 801066B0 44CEF800 */ ctc1 $t6, $31
|
|
/* B7D854 801066B4 0002183C */ dsll32 $v1, $v0, 0
|
|
/* B7D858 801066B8 0003183F */ dsra32 $v1, $v1, 0
|
|
/* B7D85C 801066BC 03E00008 */ jr $ra
|
|
/* B7D860 801066C0 0002103F */ dsra32 $v0, $v0, 0
|
|
|
|
glabel __ll_to_d
|
|
/* B7D864 801066C4 AFA40000 */ sw $a0, ($sp)
|
|
/* B7D868 801066C8 AFA50004 */ sw $a1, 4($sp)
|
|
/* B7D86C 801066CC DFAE0000 */ ld $t6, ($sp)
|
|
/* B7D870 801066D0 44AE2000 */ dmtc1 $t6, $f4
|
|
/* B7D874 801066D4 03E00008 */ jr $ra
|
|
/* B7D878 801066D8 46A02021 */ cvt.d.l $f0, $f4
|
|
|
|
glabel __ll_to_f
|
|
/* B7D87C 801066DC AFA40000 */ sw $a0, ($sp)
|
|
/* B7D880 801066E0 AFA50004 */ sw $a1, 4($sp)
|
|
/* B7D884 801066E4 DFAE0000 */ ld $t6, ($sp)
|
|
/* B7D888 801066E8 44AE2000 */ dmtc1 $t6, $f4
|
|
/* B7D88C 801066EC 03E00008 */ jr $ra
|
|
/* B7D890 801066F0 46A02020 */ cvt.s.l $f0, $f4
|
|
|
|
glabel __ull_to_d
|
|
/* B7D894 801066F4 AFA40000 */ sw $a0, ($sp)
|
|
/* B7D898 801066F8 AFA50004 */ sw $a1, 4($sp)
|
|
/* B7D89C 801066FC DFAE0000 */ ld $t6, ($sp)
|
|
/* B7D8A0 80106700 44AE2000 */ dmtc1 $t6, $f4
|
|
/* B7D8A4 80106704 05C10006 */ bgez $t6, .L80106720
|
|
/* B7D8A8 80106708 46A02021 */ cvt.d.l $f0, $f4
|
|
/* B7D8AC 8010670C 3C0141F0 */ li $at, 0x41F00000 # 0.000000
|
|
/* B7D8B0 80106710 44813800 */ mtc1 $at, $f7
|
|
/* B7D8B4 80106714 44803000 */ mtc1 $zero, $f6
|
|
/* B7D8B8 80106718 00000000 */ nop
|
|
/* B7D8BC 8010671C 46260000 */ add.d $f0, $f0, $f6
|
|
.L80106720:
|
|
/* B7D8C0 80106720 03E00008 */ jr $ra
|
|
/* B7D8C4 80106724 00000000 */ nop
|
|
|
|
glabel __ull_to_f
|
|
/* B7D8C8 80106728 AFA40000 */ sw $a0, ($sp)
|
|
/* B7D8CC 8010672C AFA50004 */ sw $a1, 4($sp)
|
|
/* B7D8D0 80106730 DFAE0000 */ ld $t6, ($sp)
|
|
/* B7D8D4 80106734 44AE2000 */ dmtc1 $t6, $f4
|
|
/* B7D8D8 80106738 05C10005 */ bgez $t6, .L80106750
|
|
/* B7D8DC 8010673C 46A02020 */ cvt.s.l $f0, $f4
|
|
/* B7D8E0 80106740 3C014F80 */ li $at, 0x4F800000 # 0.000000
|
|
/* B7D8E4 80106744 44813000 */ mtc1 $at, $f6
|
|
/* B7D8E8 80106748 00000000 */ nop
|
|
/* B7D8EC 8010674C 46060000 */ add.s $f0, $f0, $f6
|
|
.L80106750:
|
|
/* B7D8F0 80106750 03E00008 */ jr $ra
|
|
/* B7D8F4 80106754 00000000 */ nop
|