summaryrefslogtreecommitdiff
path: root/home/sine.asm
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-09 19:51:29 -0700
committerBryan Bishop <kanzure@gmail.com>2013-09-09 19:51:29 -0700
commit0d6efda9bb3aa99cc9d28b9b9e7edaae121b7d75 (patch)
treee804b9ed15832481d632904f42355743d9232515 /home/sine.asm
parent6d7043c0c65161ad8ee97fa66b94beba86761d25 (diff)
parent84a9b3907b9db08ee38e873554d8a6b4ac1b72b4 (diff)
Merge pull request #198 from yenatch/split-predefs-specials-stds
decouple home/ from engine/
Diffstat (limited to 'home/sine.asm')
-rw-r--r--home/sine.asm22
1 files changed, 22 insertions, 0 deletions
diff --git a/home/sine.asm b/home/sine.asm
new file mode 100644
index 000000000..09d06ca89
--- /dev/null
+++ b/home/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
+