diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-04-18 15:51:07 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2021-04-18 15:51:07 -0400 |
commit | 3a97ec326ceba86c7afd3b3f92ef3b308beea835 (patch) | |
tree | 14bec0281e0708974011cf9f91aa2b7690839889 /macros/data.asm | |
parent | 7d667194684d2e047257958bad974891017414ce (diff) |
Use pokecrystal's sine_table macro
Diffstat (limited to 'macros/data.asm')
-rw-r--r-- | macros/data.asm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/macros/data.asm b/macros/data.asm index f9274392..b5836b50 100644 --- a/macros/data.asm +++ b/macros/data.asm @@ -69,11 +69,11 @@ dbbw: MACRO dw \3 ENDM -sine_wave: MACRO -; \1: amplitude +sine_table: MACRO +; \1 samples of sin(x) from x=0 to x<32768 (pi radians) x = 0 -REPT $20 +REPT \1 dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up -x = x + (\1) * $40000 +x = x + DIV(32768, \1) ; a circle has 65536 "degrees" ENDR ENDM |