summaryrefslogtreecommitdiff
path: root/macros.asm
diff options
context:
space:
mode:
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