1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-12-05 01:06:37 +00:00
oot/asm/non_matchings/code/sinf/sinf.s

143 lines
6.2 KiB
ArmAsm
Raw Normal View History

.late_rodata
glabel D_8014B210
.incbin "baserom.z64", 0xBC23B0, 0x28
glabel D_8014B238
.incbin "baserom.z64", 0xBC23D8, 0x8 # probably 0.01 / M_PI
glabel D_8014B240
.incbin "baserom.z64", 0xBC23E0, 0x8 # Pi
glabel D_8014B248
.incbin "baserom.z64", 0xBC23E8, 0x8 # .double 3.17865095470564E-8
glabel D_8014B250
.incbin "baserom.z64", 0xBC23F0, 0x10
.text
glabel sinf
/* B77430 80100290 E7AC0000 */ swc1 $f12, ($sp)
/* B77434 80100294 8FA20000 */ lw $v0, ($sp)
/* B77438 80100298 C7A40000 */ lwc1 $f4, ($sp)
/* B7743C 8010029C 00021D83 */ sra $v1, $v0, 0x16
/* B77440 801002A0 306E01FF */ andi $t6, $v1, 0x1ff
/* B77444 801002A4 29C100FF */ slti $at, $t6, 0xff
/* B77448 801002A8 10200019 */ beqz $at, .L80100310
/* B7744C 801002AC 01C01825 */ move $v1, $t6
/* B77450 801002B0 29C100E6 */ slti $at, $t6, 0xe6
/* B77454 801002B4 14200014 */ bnez $at, .L80100308
/* B77458 801002B8 460020A1 */ cvt.d.s $f2, $f4
/* B7745C 801002BC 46221302 */ mul.d $f12, $f2, $f2
/* B77460 801002C0 3C038015 */ lui $v1, %hi(D_8014B210) # $v1, 0x8015
/* B77464 801002C4 2463B210 */ addiu $v1, %lo(D_8014B210) # addiu $v1, $v1, -0x4df0
/* B77468 801002C8 D4660020 */ ldc1 $f6, 0x20($v1)
/* B7746C 801002CC D46A0018 */ ldc1 $f10, 0x18($v1)
/* B77470 801002D0 D4640010 */ ldc1 $f4, 0x10($v1)
/* B77474 801002D4 462C3202 */ mul.d $f8, $f6, $f12
/* B77478 801002D8 462A4400 */ add.d $f16, $f8, $f10
/* B7747C 801002DC D46A0008 */ ldc1 $f10, 8($v1)
/* B77480 801002E0 462C8482 */ mul.d $f18, $f16, $f12
/* B77484 801002E4 46249180 */ add.d $f6, $f18, $f4
/* B77488 801002E8 462C3202 */ mul.d $f8, $f6, $f12
/* B7748C 801002EC 46285380 */ add.d $f14, $f10, $f8
/* B77490 801002F0 462C1402 */ mul.d $f16, $f2, $f12
/* B77494 801002F4 00000000 */ nop
/* B77498 801002F8 462E8482 */ mul.d $f18, $f16, $f14
/* B7749C 801002FC 46229100 */ add.d $f4, $f18, $f2
/* B774A0 80100300 03E00008 */ jr $ra
/* B774A4 80100304 46202020 */ cvt.s.d $f0, $f4
.L80100308:
/* B774A8 80100308 03E00008 */ jr $ra
/* B774AC 8010030C C7A00000 */ lwc1 $f0, ($sp)
.L80100310:
/* B774B0 80100310 28610136 */ slti $at, $v1, 0x136
/* B774B4 80100314 10200044 */ beqz $at, .L80100428
/* B774B8 80100318 C7A40000 */ lwc1 $f4, ($sp)
/* B774BC 8010031C C7A60000 */ lwc1 $f6, ($sp)
/* B774C0 80100320 3C018015 */ lui $at, %hi(D_8014B238)
/* B774C4 80100324 D42AB238 */ ldc1 $f10, %lo(D_8014B238)($at)
/* B774C8 80100328 460030A1 */ cvt.d.s $f2, $f6
/* B774CC 8010032C 44804800 */ mtc1 $zero, $f9
/* B774D0 80100330 462A1002 */ mul.d $f0, $f2, $f10
/* B774D4 80100334 44804000 */ mtc1 $zero, $f8
/* B774D8 80100338 3C013FE0 */ li $at, 0x3FE00000 # 0.000000
/* B774DC 8010033C 4620403E */ c.le.d $f8, $f0
/* B774E0 80100340 00000000 */ nop
/* B774E4 80100344 4502000B */ bc1fl .L80100374
/* B774E8 80100348 44813800 */ mtc1 $at, $f7
/* B774EC 8010034C 3C013FE0 */ li $at, 0x3FE00000 # 0.000000
/* B774F0 80100350 44818800 */ mtc1 $at, $f17
/* B774F4 80100354 44808000 */ mtc1 $zero, $f16
/* B774F8 80100358 00000000 */ nop
/* B774FC 8010035C 46300480 */ add.d $f18, $f0, $f16
/* B77500 80100360 4620910D */ trunc.w.d $f4, $f18
/* B77504 80100364 44022000 */ mfc1 $v0, $f4
/* B77508 80100368 10000009 */ b .L80100390
/* B7750C 8010036C 44828000 */ mtc1 $v0, $f16
/* B77510 80100370 44813800 */ mtc1 $at, $f7
.L80100374:
/* B77514 80100374 44803000 */ mtc1 $zero, $f6
/* B77518 80100378 00000000 */ nop
/* B7751C 8010037C 46260281 */ sub.d $f10, $f0, $f6
/* B77520 80100380 4620520D */ trunc.w.d $f8, $f10
/* B77524 80100384 44024000 */ mfc1 $v0, $f8
/* B77528 80100388 00000000 */ nop
/* B7752C 8010038C 44828000 */ mtc1 $v0, $f16
.L80100390:
/* B77530 80100390 3C018015 */ lui $at, %hi(D_8014B240)
/* B77534 80100394 D432B240 */ ldc1 $f18, %lo(D_8014B240)($at)
/* B77538 80100398 46808021 */ cvt.d.w $f0, $f16
/* B7753C 8010039C 3C018015 */ lui $at, %hi(D_8014B248)
/* B77540 801003A0 D426B248 */ ldc1 $f6, %lo(D_8014B248)($at)
/* B77544 801003A4 3C038015 */ lui $v1, %hi(D_8014B210) # $v1, 0x8015
/* B77548 801003A8 2463B210 */ addiu $v1, %lo(D_8014B210) # addiu $v1, $v1, -0x4df0
/* B7754C 801003AC 46320102 */ mul.d $f4, $f0, $f18
/* B77550 801003B0 D4680020 */ ldc1 $f8, 0x20($v1)
/* B77554 801003B4 D4720018 */ ldc1 $f18, 0x18($v1)
/* B77558 801003B8 30590001 */ andi $t9, $v0, 1
/* B7755C 801003BC 46260282 */ mul.d $f10, $f0, $f6
/* B77560 801003C0 46241081 */ sub.d $f2, $f2, $f4
/* B77564 801003C4 462A1081 */ sub.d $f2, $f2, $f10
/* B77568 801003C8 D46A0010 */ ldc1 $f10, 0x10($v1)
/* B7756C 801003CC 46221302 */ mul.d $f12, $f2, $f2
/* B77570 801003D0 00000000 */ nop
/* B77574 801003D4 462C4402 */ mul.d $f16, $f8, $f12
/* B77578 801003D8 46328100 */ add.d $f4, $f16, $f18
/* B7757C 801003DC D4720008 */ ldc1 $f18, 8($v1)
/* B77580 801003E0 462C2182 */ mul.d $f6, $f4, $f12
/* B77584 801003E4 462A3200 */ add.d $f8, $f6, $f10
/* B77588 801003E8 462C4402 */ mul.d $f16, $f8, $f12
/* B7758C 801003EC 17200007 */ bnez $t9, .L8010040C
/* B77590 801003F0 46309380 */ add.d $f14, $f18, $f16
/* B77594 801003F4 462C1102 */ mul.d $f4, $f2, $f12
/* B77598 801003F8 00000000 */ nop
/* B7759C 801003FC 462E2182 */ mul.d $f6, $f4, $f14
/* B775A0 80100400 46223280 */ add.d $f10, $f6, $f2
/* B775A4 80100404 03E00008 */ jr $ra
/* B775A8 80100408 46205020 */ cvt.s.d $f0, $f10
.L8010040C:
/* B775AC 8010040C 462C1202 */ mul.d $f8, $f2, $f12
/* B775B0 80100410 00000000 */ nop
/* B775B4 80100414 462E4482 */ mul.d $f18, $f8, $f14
/* B775B8 80100418 46229400 */ add.d $f16, $f18, $f2
/* B775BC 8010041C 46208020 */ cvt.s.d $f0, $f16
/* B775C0 80100420 03E00008 */ jr $ra
/* B775C4 80100424 46000007 */ neg.s $f0, $f0
.L80100428:
/* B775C8 80100428 46042032 */ c.eq.s $f4, $f4
/* B775CC 8010042C 3C018015 */ lui $at, %hi(D_8014B250)
/* B775D0 80100430 45010004 */ bc1t .L80100444
/* B775D4 80100434 00000000 */ nop
/* B775D8 80100438 3C018015 */ lui $at, %hi(D_8014B2D0)
/* B775DC 8010043C 03E00008 */ jr $ra
/* B775E0 80100440 C420B2D0 */ lwc1 $f0, %lo(D_8014B2D0)($at)
.L80100444:
/* B775E4 80100444 C420B250 */ lwc1 $f0, %lo(D_8014B250)($at)
/* B775E8 80100448 03E00008 */ jr $ra
/* B775EC 8010044C 00000000 */ nop