summaryrefslogtreecommitdiff
path: root/engine/sine.asm
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-05 11:30:12 -0700
committerBryan Bishop <kanzure@gmail.com>2013-09-05 11:30:12 -0700
commit40b4c87db7e9472d99186b67bdec3d48a2132e73 (patch)
treeb0ea0d40187c103dbb9f8bd185ee5f40770b5b53 /engine/sine.asm
parent4e36d85ee966f8f22531183679549061263b2166 (diff)
parent60dde1d03ed43de1e7ef777e4198963620c73958 (diff)
Merge pull request #188 from yenatch/split-common
recomment and split out a ton of common asm (bank 0)
Diffstat (limited to 'engine/sine.asm')
-rw-r--r--engine/sine.asm22
1 files changed, 22 insertions, 0 deletions
diff --git a/engine/sine.asm b/engine/sine.asm
new file mode 100644
index 000000000..09d06ca89
--- /dev/null
+++ b/engine/sine.asm
@@ -0,0 +1,22 @@
+Cosine: ; 1b0f
+; Return d * cos(a) in hl
+ add $10 ; 90 degrees
+
+Sine: ; 1b11
+; Return d * sin(a) in hl
+; a is a signed 6-bit value.
+
+ ld e, a
+
+ ld a, [hROMBank]
+ push af
+ ld a, BANK(_Sine)
+ rst Bankswitch
+
+ call _Sine
+
+ pop af
+ rst Bankswitch
+ ret
+; 1b1e
+