aboutsummaryrefslogtreecommitdiffstats
path: root/macros.asm
diff options
context:
space:
mode:
authorpikalaxalt <PikalaxALT@gmail.com>2016-05-25 10:20:45 -0400
committerpikalaxalt <PikalaxALT@gmail.com>2016-05-25 10:20:45 -0400
commite933fb3639329a40576b2878344d647fe42218cb (patch)
treef8895c4009e93f407650d106adc9b586601216da /macros.asm
parentMore code and gfx pointers (diff)
downloadpokeyellow-e933fb3639329a40576b2878344d647fe42218cb.tar.gz
pokeyellow-e933fb3639329a40576b2878344d647fe42218cb.tar.xz
pokeyellow-e933fb3639329a40576b2878344d647fe42218cb.zip
More pikachu engine stuff
Diffstat (limited to 'macros.asm')
-rw-r--r--macros.asm11
1 files changed, 11 insertions, 0 deletions
diff --git a/macros.asm b/macros.asm
index f153e379..969d9465 100644
--- a/macros.asm
+++ b/macros.asm
@@ -758,3 +758,14 @@ ENDC
endr
db x
ENDM
+
+sine_wave: MACRO
+; \1: amplitude
+
+x = 0
+ rept $20
+ ; Round up.
+ dw (sin(x) + (sin(x) & $ff)) >> 8
+x = x + (\1) * $40000
+ endr
+ENDM