summaryrefslogtreecommitdiff
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
parent8474adf2641767c01f4e1b9b9e3bd283ddd697df (diff)
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