diff options
Diffstat (limited to 'macros/data.asm')
-rw-r--r-- | macros/data.asm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/macros/data.asm b/macros/data.asm index eb5b5564..9d8a4406 100644 --- a/macros/data.asm +++ b/macros/data.asm @@ -60,3 +60,12 @@ ENDM dab: MACRO dwb \1, BANK(\1) ENDM + +sine_table: MACRO +; \1 samples of sin(x) from x=0 to x<32768 (pi radians) +x = 0 +REPT \1 + dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up +x = x + DIV(32768, \1) ; a circle has 65536 "degrees" +ENDR +ENDM |