	JUMPPTR B
;Bhaskara sine approx by Photon/SCX
;note that this is better than std parabolic so no 2% deviation \o/
;sin x=4x(180-x)/(40500-x(180-x))
;changed from 180 to 126 steps for 180 degs

steps2	=126	;orig 180
ampl	=-1	;orig 40500 => $1bd0 ampl, -1 => $1080 ampl, 11909=$7ff7 ampl

B:
	lea Sin(PC),a1
	moveq #steps2-1,d0
.l:	bsr.s BSine
	move.w d1,(a1)+
	neg.w d1
	move.w d1,steps2*2-2(a1)
	DBF d0,.l
	RTS

BSine:	;d0.w=x (0..steps2=0..179 degs)
	moveq #steps2,d1
	sub.w d0,d1
	mulu d0,d1		;x(180-x)
	moveq #-1,d2		;fine-stretch amplitude with this.
	sub.w d1,d2
	swap d1			;*4*16384ampl/2, lsl.l #8,d1 => 4*64ampl
;	clr.w d1		;@only nec at high amplitudes AND high coord/scr rez.
	divu d2,d1		;check if rest works as autorandomvalues. ;)
	RTS
Sin:
	blk.w steps2*2,0
E:
