summaryrefslogtreecommitdiff
path: root/home/sine.asm
diff options
context:
space:
mode:
authorPikalaxALT <PikalaxALT@gmail.com>2016-01-29 18:36:31 -0500
committerPikalaxALT <PikalaxALT@gmail.com>2016-01-29 18:36:31 -0500
commit2bf93c5905319e9181f87b3f83cd3bce7b9feeca (patch)
tree3ebf17c8879e5d6243d81aac8f1c36eb226fac26 /home/sine.asm
parented3f9395f6d45f6554ed9d9c49c41ea86a8e2447 (diff)
Import stuff from pokecrystal; diff gold and silver
Diffstat (limited to 'home/sine.asm')
-rw-r--r--home/sine.asm21
1 files changed, 21 insertions, 0 deletions
diff --git a/home/sine.asm b/home/sine.asm
new file mode 100644
index 00000000..e1552db2
--- /dev/null
+++ b/home/sine.asm
@@ -0,0 +1,21 @@
+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