From 73ea7c6326f16f84de1cf74193705328d1664645 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sat, 3 Feb 2018 21:11:55 -0500 Subject: Macro factors out sine code, just like sine data, since it's used 5 times --- home/sine.asm | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'home/sine.asm') diff --git a/home/sine.asm b/home/sine.asm index eff5ed299..a32a31612 100644 --- a/home/sine.asm +++ b/home/sine.asm @@ -1,13 +1,10 @@ Cosine:: ; 1b0f -; Return d * cos(a) in hl - add %010000 ; 90 degrees - +; a = d * cos(a * pi/32) + add %010000 ; cos(x) = sin(x + pi/2) + ; fallthrough Sine:: ; 1b11 -; Return d * sin(a) in hl -; a is a signed 6-bit value. - +; a = d * sin(a * pi/32) ld e, a - homecall _Sine ret ; 1b1e -- cgit v1.2.3