summaryrefslogtreecommitdiff
path: root/macros/data.asm
diff options
context:
space:
mode:
Diffstat (limited to 'macros/data.asm')
-rw-r--r--macros/data.asm9
1 files changed, 9 insertions, 0 deletions
diff --git a/macros/data.asm b/macros/data.asm
index 16742d53..3f18fb6e 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -78,3 +78,12 @@ dbbw: MACRO
db \1, \2
dw \3
ENDM
+
+sine_wave: MACRO
+; \1: amplitude
+x = 0
+REPT $20
+ dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
+x = x + (\1) * $40000
+ENDR
+ENDM