calcCos:
ld b,-64
add a,b
calcSin:
cp 128
jr nc,greaterT128
cp 64
jr nc,greaterT64
jr sin_getEntry
greaterT64:
ld b,a
ld a,63
sub b
jr sin_getEntry
greaterT128:
ld b,128
sub b
cp 64
jr nc,greaterT64
jr sin_getEntry
sin_getEntry:
ld c,a
ld b,0
ld hl,sinLUT
add hl,bc
; hl = 8.8 FP result
sinLUT:
.db 0,3,6,9,12,15,18,21,24,28 ; sin(0-9)
.db 31,34,37,40,43,46,48,51,54,57 ; sin(10-19)
.db 60,63,65,68,71,73,76,78,81,83 ; sin(20-29)
.db 85,88,90,92,94,96,98,100,102,104 ; sin(30-39)
.db 106,108,109,111,112,114,115,117,118,119 ; sin(40-49)
.db 120,121,122,123,124,124,125,126,126,127 ; sin(50-59)
.db 127,128,128,128 ; sin(60-63)